Skip to main content
Hi All,

My process looks like this:

|Start|
|
|
|
|
|Do Some Stuff Here|---------------------------|Client Event 2|
|
|
|
|
|Client Event 1|

Client Event 1 is a webform assigned to the destination user. He can complete the form and the process finishes

Client Event 2 is a webform assigned to the originator. He can press a button and the process is cancelled.

I need to put a server event in after both client events, to expire the other activity.

So if the destination user completes Client Event 1 then Client Event 2 is expired, and vice-versa.

When I just enter:


public void Main(ServerEventContext K2)
{
K2.Syncronous = true;

K2.ExpireActivity("Name of the other activity");

}


The code executes and moves on with no errors. But the other activity doesn't get expired.

Can anyone tell me what I'm doing wrong? Many thanks,

Richard
Hey Richard,

The name of the Activity used in the call to ExpireActivity is not used at all - we just had to include it for backward compatibility. THE CURRENT ACTIVITY IS ALWAYS EXPIRED.

There is no way to get to the another Activity from within the same process instance.

What you could do is to keep process level datafields for the other activity to access like:
blnClientEvent1Completed and blnClientEvent2Completed.

In ClientEvent1, check if blnClientEvent2Completed is set to True. If so, redirect to a page that says something like: "Sorry, the Originator has cancelled this request."

In ClientEvent2, check if blnClientEvent1Completed is set to True. If so, redirect to a page that says something like: "Sorry, the request has already been handled - too late sucker."

Put a repeating Escalation on each of the Activities which fires once a day for say 30 days. In the Escalation, check the status of the two process level variables. If one is set, use a GoTo Escalation to send the process flow to a very last Activity with a blank Server Event.

HTH,
Ockert
Thanks a lot Ockert.

That makes perfect sense.

The speed at which you reply on this forum is incredible :shock: and your help is always appreciated 😃

Richard
No problem. Just be careful of too many escalations. Depending on your volumes, you may experience a performance hit.

- Ockert

Reply