流程发布后怎样拿到流程节点的Destination User

Last post 09-10-2008, 1:55 by karonwu. 7 replies.
Sort Posts: Previous Next
  •  08-09-2007, 2:11 17619

    流程发布后怎样拿到流程节点的Destination User

     在这个话题里指的是流程发布后,不是发起后一个流程实例,这时候所有流程节点的Destination可能是定好(直接指定某个处理人),也可能是未定(代码实现或指某个Destination Queue).这时候我们如果想去确认某个节点的处理人或定义了什么Destination Queue可以通过一下方式获取:

    1.在K2的DB中找到_Proc表,在ID字段中找到对应的流程ID.

    2.打开_Act表,利用_Proc中得到的ID在ProcID列找到对应流程的多个节点.

    3.在需要得到Destination的节点数据中找到DestRuleID字段.

    4.DestRuleID字段是对应_Code表的ID字段. _Code表中的Code字段,存放的就是在流程中Destination Rule里定义的Rule.当流程中的Destination Rule中是定义一个Destination Queue, Code字段里存放的会是整个Destination Rule的代码,只是代码中添加Destination的代码会是对应到定义的Destination Queue.如果需要得到流程中某个节点的Destination Queue, 可以通过对Code字段的解析找到对应的Queue.同样要确认Destination User也是可以通过解析Code字段获得.

  •  08-11-2007, 11:02 17676 in reply to 17619

    Re: 流程发布后怎样拿到流程节点的Destination User

    在k2中如何定义流程编号?

  •  08-12-2007, 10:46 17681 in reply to 17676

    Re: 流程发布后怎样拿到流程节点的Destination User

    Process的ID是导出到K2 server时, Server自动赋值的.而Process InstID是在用户发起一个新的流程实例时, Server给的.用户只能去取,无能去更改.

  •  08-16-2007, 1:56 17810 in reply to 17681

    Re: 流程发布后怎样拿到流程节点的Destination User

    哦,对的。是Folio可以自定义的.这几天在虚拟机上尝试把如何它update掉,试了培训资料里worklistitem的用法可是报错说 没有权限。。。

    还有就是如果要update这个记录,我必须取得具体的processID那这个ProcessID又怎么找呢?好比我要在request建立后根据当前最大的request编号+1(实际过程中可能还要加日期代号)生成这个request的Folio.也就是说必须在这个request生成后才能知道我的Folio然后去update它,那我如何做到获知刚建立的这个processID呢?

    Thanks Louis

  •  08-16-2007, 2:07 17811 in reply to 17810

    Re: 流程发布后怎样拿到流程节点的Destination User

    Although not ideal (for performance reasons), you could loop through all worklist items and look for some other matching information - like folio. When you've found the worklistitem with the correct folio, you can retrieve the serial number.

    [code:1:43c78c9f7b]'Get Worklist for current Logged on User
    oWorkList = oK2Connection.OpenWorklist("ASP")

    For Each oWorkListItem In oWorkList
    If oWorkListItem.ProcessInstance.Folio = strFolio Then
    // Serial number given by: oWorkListItem.SerialNumber
    End If
    Next[/code:1:43c78c9f7b]

    I say again - from a performance perspective, this is NOT ideal since each worklist item is instantiated, the one after the other.

    Failing this, the only other way would be to store the serial number somewhere for retrieval. You can for example, in the client event where the worklist item is created, store the process instance id and serial number for the specific ActivityInstanceDestination in an external database for later retrieval.

    HTH,
    Ockert

    -----------------------------------------------------------------------------

    似乎找到答案,原来还是用这个赖招。。。。 看来只能跟据日期时间这些非重复信息在递交前放进smartform后保存到k2在读worklistitem的时候找到拉出。。。

     

  •  04-10-2008, 2:10 23085 in reply to 17811

    Re: 流程发布后怎样拿到流程节点的Destination User

    Hello,

         K2 寫的Workspace 不是這樣做的嗎?還是有更好的做法?

  •  07-15-2008, 10:43 PM 24887 in reply to 23085

    Re: 流程发布后怎样拿到流程节点的Destination User

    顶一下。怎么让任何一个人看到所有的worklist?
  •  09-10-2008, 1:55 25994 in reply to 24887

    Re: 流程发布后怎样拿到流程节点的Destination User

    顶楼上的,管理员看到所有流程也有不少方法,其中不乏“偏招”:)

    K2 service manager中管理员默认可以看到所有流程实;

    在设计流程的时候加一个分支,管理员得到代办任务,可随时取消;

    K2 blackpearl中的notification应该也是可以的。

    k2 blackpearl中有也个API,可动态添加一个人共享代办任务(但只能一个人处理)。

    善用SO,让管理员看到SO(相关的流程)。

    最后的一招,代码总是可以做到的。

     

View as RSS news feed in XML