Skip to main content

Hi,


 I have 2 independent workflows running seperately. I would like the one workflow to kick off an activity in the other (already running) process without effecting the other already running activities in the second process.


As an example. Process/Workflow 1 has activity A, B, and C already running in parallel. I would like Process/Workflow 2 to start activity D of Process/Workflow 1 so that Activity A, B, C and D are now active.


 Is it possible?


Mike

A common technique is to use an asynchronous server event to do this.  Take a look at this KB article for ideas:


http://kb.k2workflow.com/Articles/KB000272.aspx


Would he always have to start an activity before D, and if it needs to be started the external process will finish the server event before activity D so activity D gets kicked off?

If activity D does not need to be used, at the end of the process can a server event finish the asynchronous server event that is before activity D?


Hi,


I have got it working correctly.


 On process 1 from the start node, I have 2 activities. The first is the start of the original process at activity A which leads on to Activity B, C, D....etc with parallel paths and branching back etc.


The other activity leading off from the start is a holding activity which has an asynchronous server code activity which just populates a process datafield with the serial number of the activity. This activity, when completed, leads off to activity D (as in my earlier example) and also back to itself for further instantiations from the external process.


 On the 2nd process, I read the process instance ID from a smart object and get the serial number from the process data fields which I use to pickup the server item with Connection.OpenServerItem(serialNumber). I then just call the Finish method on the server item which completes the activity in the first process.


The last thing to do is when the original process is complete, have a server code activty call GotoActivity to a finalizing activity to break the loop on the asynchronous activity and end the process.


 Thanks David for that useful link on Asynchronous Server events:


http://kb.k2workflow.com/Articles/KB000272.aspx


 


Reply