WebService IPC Activity

  • 22 June 2009
  • 7 replies
  • 3 views

Badge +6

Greetings,


The process instance will be created for the Job. A Job can have multiple cases, the job should not be completed unless all the cases are completed. To achieve this I have created a main process and a Sub process. As sub process can be completed but the Job (Main process should not unless the sub process instances are completed).


For spliting the Job into case I have a logic defined in the Web Service, where the Job will get splitted into cases. I have to call the Webservice in the IPC event. But I am not able to understand which part of the IPC event I need to write the code. I right click the event in the IPC activity and inside that I see a Windows WorkFlow. I right clicked the IPC event in that and said View Code in the _ExecuteCode I wrote the code to call the webservice. But the code execution throws the runtime error.


Please help to understand and write the code in the event. It was pretty easy in the K2.Net 2003. I am not getting the option in the K2 Back pearl.


Thanks in advance


Aman


7 replies

Badge +6

Hi Aman,


Please have a look at this exelent post (http://www.k2underground.com/blogs/pitchblack/archive/2008/08/26/looping-through-an-activity-for-each-item-returned-from-a-smartobject-list.aspx)... at the end, with the succeding rule of the activity hosting the IPC event, you will be able to achieve what you need.


In the meantime, read the entire post, it gives you a way to launch dynamic multiple IPC. And with the SmartObject, it is easier than in K2.net 2003.


HTH

Badge +6

Greeting Jan,

The post was really helpful to understand how smartobjects can be used even to create the Sub-processes for the main process.

My main process should not move to the next activities till all the sub-process instances are completed. How can this be achieved?

Thanks in advance

 

Badge +8

In the IPC  Event wizard, set synchronous in 'select how to call the procss'. Main process would wait for all the activities to be completed in the child process

Badge +6

Thanks, for the prompt response.

I would like to know, How can I check the count of sub-process instance running for the main process ?

 

Badge +6

You have several ways to achieve this.



  1. if you need to count the number of IPC instances finished, you can add a server event which is going to increment a process datafield (int type).
  2. if you just need to continue your parent process when all your instances are completed, you just need to add a succedding rule to your activity hosting the IPC event (the succedding rule is "all of ActivityINstanceDestinationStatus are equal to Completed"

HTH

Badge +6

You are awesome, you always explain to the point.

I have archived the functionality using the Succeeding rule. I got the option in the white paper which you had suggested.

Thanks a lot Jan.

Badge +6

;-)


I'm glad, you sorted out. Please remember to change the thread status when a valid answer has been given.

Reply