Originator of IPC process


Badge +3

Now I'm using IPC event to fire another process


in IPC event wizard, I use "Impersonate Originator"


and I set destination user of the activity to be someone I want to be Orginator of subprocess (using all at once)


but it turned out the originator of subprocess is the one who submit in the previous activity of main process...


how can I pass that user to be Originator or the one who is destination user of first activity in subprocess?


thanks for any suggestions...


6 replies

Badge +8

Impersonate Originator refers to the Originator of the parent process, not the activity. You can't really change the originator of the child using an IPC, apart form using the K2 Service account or parent process originator (technically you can by using the Basic option, but its not really applicable in this case as it requires you to provide the username and password).


You can however pass in the Destination user of the Activity into a datafield in the child. You can use the Activity Destination Instance object's User --> FQN property in the Workflow Context Browser. Just make sure that you configure the data direction to the child only, not back, as this field is read-only in the child. 


What is reason for wanting the child process to be started under different user IDs?

Badge +3

Thanks for your reply :)


Actually I have the main process that user can pickup multiple destination users to do the job.


So I follow this link http://www.k2underground.com/blogs/fromthebench/archive/2008/05/22/activity-destination-users-based-upon-a-repeating-xml-element.aspx (but using ASP.NET in my case) So I create process Xml field and use it store destination users and it works fine...


But for my situation, it will start another flow instead of just recieving the task, and the assigned users will be the first destination users in each flow...


So I tried to pass each user to the sub process by setting them to be destination user of the IPC Event, but it seems destination user of IPC Event does not have anything with the subprocesses.


I have created process field for subprocess and tried to pass destination user (that is repeated element) to each subprocess with the same technique as the link but K2 does not allow me to do that :(


So that means I cannot follow the link above and I have to use Server Event instead?


Sorry if it is not clearly understand, I'm still very new to K2...


Thanks in advance for any suggestions

Badge +8

For your approach to work, you will need to ensure that the Destination rule is set to Plan per Destination, all at once. This will create an instance for each user and you can then assign the Activity Destination Instance's User object --> FQN to the Child. Also, make sure your direction is out only. I tested this on my side and works like a charm.


Alternatively (and a bit cleaner maybe) is to use the Plan per slot option in the Destination Rule. Just point the List Field to your User XML Field, you can then pass the Initialization Data to child. This will contain the individual values for each repeating node. It's nicely documented here:


http://www.k2underground.com/blogs/fromthebench/archive/2008/10/22/using-a-repeating-xml-node-to-start-child-ipcs.aspx

Badge +3

Thank you very much, you saved my life!! :P


I have tested both ways and it seems work fine... I create data field in child process and set it as destination user for the 1st activity...


but would you mind if I still have some questions?


1. for the 2nd way I'm not sure what is "ActivityInstanceDestInstanceData"? Does it always mean the value in split xml node?


2. In my workflow, it has generated 3 subprocesses but when 1 of them is finished, the main flow go to next activity immediately... how to track for waiting finish all subprocesses to finish the IPC acitivity in main process. I tried to go to succeeding rule but still in the darkness.


Thank you very much :)

Badge +8

No Probs. Answers to your questions:


  1.  It basically contains that piece of info that caused the Activity instance to exist. For example, if your xml looks like this: <Users><User>U1</User><User>U2</User></Users>, U1 and U2 will be the instance data for the two instances.
  2.  You will need to track the succeeding rule with that. Typically, create an Activity datafield (lets say "IPC Status") and set it to "Done" after the IPC completed. The succeeding rule will then check if all Slots of "IPC Status" = "Done".
Badge +3

Ha! it works :)


thank you very much for your answer, it helps me solving problem and makes me understand how k2 works more :))

Reply