cancelActivity=true not working for service tasks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012 05:03 AM
Hi,
I have a service tasks that waits for a synchronous response to come back. If a timeout is reached (timer boundary event), I want the subprocess to be canceled (cancelActivity=true).
I already found out the hard way that the boundary events don't work on service tasks, so I wrapped the service tasks in a subprocess scope.
Still the service task execution is not getting cancelled although the time boundary event is triggered. I was expecting that the service task thread (async=true) is getting signaled.
My questions:
- Is support for boundary events on service tasks planned?
- The fact that the service task thread continues to run, is that a bug or a feature?
- Is there a way to store an error code in process variables? I would like to have a catch-all for errors happening in the process and create a notification with that error code.
Thanks,
Timo
I have a service tasks that waits for a synchronous response to come back. If a timeout is reached (timer boundary event), I want the subprocess to be canceled (cancelActivity=true).
I already found out the hard way that the boundary events don't work on service tasks, so I wrapped the service tasks in a subprocess scope.
Still the service task execution is not getting cancelled although the time boundary event is triggered. I was expecting that the service task thread (async=true) is getting signaled.
My questions:
- Is support for boundary events on service tasks planned?
- The fact that the service task thread continues to run, is that a bug or a feature?
- Is there a way to store an error code in process variables? I would like to have a catch-all for errors happening in the process and create a notification with that error code.
Thanks,
Timo
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012 05:32 AM
1. No support for this is planned
2. The cancelActivity uses the database to cancel the running activity. As long as the async service-task is "running", the process-state in the DB is unaffected. When the service-tasks finished and tries to write it's data, it will get an optimistic lock-exception, effectively rolling back the work it did in the service-tasks, so transactionally speaking, it "never happened". There is no way of "notifying" or "canceling" the job-threads at the moment. Also a bit difficult to implement right, keeping in mind job-executor may be in different VM…
3. Do you mean the error-codes in the BPMNErrors/thowing boundary event?
2. The cancelActivity uses the database to cancel the running activity. As long as the async service-task is "running", the process-state in the DB is unaffected. When the service-tasks finished and tries to write it's data, it will get an optimistic lock-exception, effectively rolling back the work it did in the service-tasks, so transactionally speaking, it "never happened". There is no way of "notifying" or "canceling" the job-threads at the moment. Also a bit difficult to implement right, keeping in mind job-executor may be in different VM…
3. Do you mean the error-codes in the BPMNErrors/thowing boundary event?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012 10:34 AM
Thanks for your quick reply.
In re:2
Is there a way for the running thread to check if it should shutdown? How would you generally implement a synchronous invocation that should be interrupted at a certain timeout?
About 3)
I have a fairly simple process in mind that executes a number of steps. Each step can fail and essentially break out of the happy path. In a catch-all event subprocess I would like to notify which error code triggered the error start event. The error would be raised in a JavaDelegate by throwing BpmnError.
With that information I can tell the user if a process was successful or failed and why it failed.
How can I accomplish this scenario?
Thanks,
Timo
In re:2
Is there a way for the running thread to check if it should shutdown? How would you generally implement a synchronous invocation that should be interrupted at a certain timeout?
About 3)
I have a fairly simple process in mind that executes a number of steps. Each step can fail and essentially break out of the happy path. In a catch-all event subprocess I would like to notify which error code triggered the error start event. The error would be raised in a JavaDelegate by throwing BpmnError.
With that information I can tell the user if a process was successful or failed and why it failed.
How can I accomplish this scenario?
Thanks,
Timo
