conditionally executing an IPC event

  • 7 December 2006
  • 3 replies
  • 2 views

Badge +8
I have a need to execute an IPC event on many different activities, but only when certain conditions exist. I have added an IPC event, then generated the code for it and put it inside an If Then End If block so that if certain conditions are not met that it would not do the IPC call.

However, it still tries to do the call, but fails because I have not set any of the parameters needed (connection string, binding, etc.). These are all set within the If Then End If block, so if the conditions are not true none of the parameters get set.

Now I've thought that I might be able to use a server event that will dynamically do an IPC when the conditions are right, but will not do it when the conditions are false. I can't figure out exactly how to do this.

Basically I want the capability for the destination user of an InfoPath Activity to be able to click a button to send his activity to someone else for review, and when the review is completed it comes back to the original dest user.

Is anyone else doing something like this?

3 replies

Badge +11
It tries to create the child process because the IPC event is instantiated before your conditional code is executed and the IPC event NEEDS to create to child process.

I would do one of the following:
1. Change your process design so that your conditions are met through line rules and direct your process flow to go to a single activity containing the IPC event. This can lead to a VERY complex process definition; Alternatively,
2. Create an external assembly which can create and start a 'child' process instance through K2ROM. Use a Server Event in each Activity you need to IPC and call this external assembly if the appropriate conditions are met. You can even pass the appropriate folio and other datafields to the assembly to update the new 'child' process before it is started.

HTH,
Ockert
Badge +4

icon-quote.gifOckert:
2. Create an external assembly which can create and start a 'child' process instance through K2ROM. Use a Server Event in each Activity you need to IPC and call this external assembly if the appropriate conditions are met. You can even pass the appropriate folio and other datafields to the assembly to update the new 'child' process before it is started.


Is it possible to do this and still be able to have a Synchronous child process Ockert?  I need to be able to conditionally start a child process but also maintain the abillity for it to be called Synchronously, i.e. the process won't continue until the child process has completed.


thanks,


Wes

Badge +2

Alternatively, what you could do is to put the condition IF..THEN...ELSE inside of the child IPC process rather than in the IPC Server Event, i.e. if the condition is FALSE then exit immediately (back to the IPC Server Event), and if TRUE then proceeds to do what it's supposed to do.   The condition is based on parameters set by the IPC Server Event.

Reply