Skip a call activity

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 07:20 AM
Hi,
I have a workflow in which I have multiple subprocesses (using call activity). When a particular subprocess (call activity) is executing, the user should be able to cancel/skip that call activity and should be able to execute the next subprocess in order. Is there any way this can be acheived ?
Thanks,
Himanshu
I have a workflow in which I have multiple subprocesses (using call activity). When a particular subprocess (call activity) is executing, the user should be able to cancel/skip that call activity and should be able to execute the next subprocess in order. Is there any way this can be acheived ?
Thanks,
Himanshu
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 07:55 AM
Add a catching boundary-event to the call-activity/subprocess, a message-boundary event for example - with cancelActivity="false". Make the outgoing flow go to the next call-activity… Make your UI send a message to the execution to "cancel" the execution of the ongoing call-activity. That should work


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2014 11:13 PM
Hi,
I am able to attach the message boundary event. But I don't see any method in the runtime service to actually send a cancel message to the particular process. Could you please provide a code snippet so that it is clear ?
Also, shouldn't be cancelActivity set to "true" in this case ?
I am able to attach the message boundary event. But I don't see any method in the runtime service to actually send a cancel message to the particular process. Could you please provide a code snippet so that it is clear ?
Also, shouldn't be cancelActivity set to "true" in this case ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2014 02:57 AM
Yes, it should indeed be set to "true", the value of the cancelActivity attribute.
Messaging an executions can be done using the runtimeService:
The right execution to message can be found using an ExecutionQuery, filtering by processInstanceId and message-event subscription.
Messaging an executions can be done using the runtimeService:
/**
* Notifies the process engine that a message event with name 'messageName'
* has been received and has been correlated to an execution with id
* 'executionId'.
*
* The waiting execution is notified synchronously.
*
* @param messageName
* the name of the message event
* @param executionId
* the id of the execution to deliver the message to
* @throws ActivitiObjectNotFoundException
* if no such execution exists.
* @throws ActivitiException
* if the execution has not subscribed to the signal
*/
void messageEventReceived(String messageName, String executionId);
The right execution to message can be found using an ExecutionQuery, filtering by processInstanceId and message-event subscription.
