Skip to main content
Hello
My scenario is:
We have an activity where we created a default escalation and called a web service that called another process. (This have been done in order to not expire the first activity)
But the problem is that when this escalation is lunched there is a default client event that asks if the the user want to finish the process.
When the user will click the finish button it will lunch a server event that will expire the activity in the first process and finish the escalation process.

Hoe can it be done code wise To expire an activity in a different process

thank You
In order to expire an Activity through code, you need access to either an EscalationActionContext (for the Activity you want to expire) or a ServerEventContext (also within the Activity you want to expire). Since the Activity you want to expire probably waits for a client event to be finished, this would be very difficult to accomplish.

I would rather use GotoActivity - which also expires the current Activity and directs the process flow to the specified Activity.

Use an external assembly which references the K2Mng object model. Get a handle to the specific process instance id and use K2Manager.GotoActivity to redirect process flow.

Two pitfalls:
1. If your process branch into more than one parallel legs, ALL current Activities are expired by the GotoActivity call and only the specified Activity becomes active.
2. In order to use K2Mng, you'll need the credentials of a K2Server administrative user to log in.

HTH,
Ockert

Reply