Creating a Process but not making it appear at an activity until another Process has completed

  • 18 June 2007
  • 2 replies
  • 0 views

Badge +5

I am creating a process from code (vb.net) however I don't want it to appear at the first activity until the related workitems of another process are completed. The related workitems are released from code as well so I can set a process field or something easily.


My problem is that the only way I can see how do do this is by setting a start rule on the first activity, but the start rule requires a date and I guess this date is set once and can not be updated. Is this start rule only evaluated once or could I chnage a process/activity datafield to start the activity.


I guess the preceding rule is an option but if this fails the condition will the process automatically complete.


What is the best way of doing this?


Thanks


 Dean


2 replies

Badge +5
The problem is I need to create a new process instance copying the same data from the first work item. This needs to sit in the new process (not visible to users) untill the other related work items complete which are in a different process. My code knows when the last item has been completed and therefore I can trigger somthing in the workitem. The start rule seems best for this but this requires a date which isn't quite right for me. I guess I could also create an activity which no user has access to then release the workitem to an activity that has user access when all work items complete. I'm sure there is a better way of doing this in K2 but I'm having a K2 mind block at the moment.
Badge +8

I can think of two possible ways to achieve this without the need of a start rule.


 


The first is to use an Async server event in the first activity of the child process that should wait. You can do a simple insert into a lookup table storing the event’s serial number and an identifier that will allow the parent process to uniquely identify it. I’d probably go for the parent process’ ProcInst ID. When you need the child process to continue, you can simply get the serial number from the lookup table mentioned, finish the Async server event and the child will continue.


 


The second option (typically if you don’t want to have a lookup) is similar to your suggestion of using a Worklist item in the first activity to stop the process, but instead of assigning it to “nobody”, you can assign it to a special user used for only this. You can then create a simple web service (with the app pool using the account mentioned) and the parent process can then call the web service passing in some info to identify the Worklist item for the child on hold. Using standard K2ROM you can then search and open the applicable item in the web service, finish it and your child process will then progress as per normal.


 


I guess the principle behind the two approaches are the same, you will just need to decide which approach you are more comfortable with.

Reply