06-12-2017 09:12 PM
I have a simple workflow which basically completes a UserTask from within Service Task. The requirement is also to complete the service task as well. I am not able to obtain the currently running service task from within JavaDelegate. I want to pro grammatically complete the Service Task. Does Activiti store information about service task in ACT_RE_TASKINST table?
Any kind of help would be very much appreciated?
06-13-2017 09:29 AM
Was the user task instance already created at the time the JavaDelegate got invoked? Sharing you process definition BPMN could help better understand what you are trying to achieve.
06-13-2017 09:37 AM
The objective is to complete all the user tasks which is already being created for a logged in user. The user task has its own workflow and is separate from Service task. The requirment is to create a service task and from the service task complete all the user tasks. I am able to complete all the user task. But when it comes to the point to complete the service task that's where I am facing exceptions. Here is XML part of process definition:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="ad-hoc">
<process id="ClarificationReceivedProcess" name="Clarification Received" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<serviceTask id="ClarificationReceived" name="Clarification Received" activiti:class="activiti.util.HandleWaitForResponseTask"></serviceTask>
<sequenceFlow id="flow4" sourceRef="startevent1" targetRef="ClarificationReceived"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="ClarificationReceived" targetRef="endevent1"></sequenceFlow>
</process>
</definitions>
06-13-2017 12:48 PM
The service task does not need to be completed manually it will complete after the JavaDelegate execute method is called.
Does Activiti store information about service task in ACT_RE_TASKINST table?
No, thats only for saving unfinished user tasks.
Does your JavaDelegate ("activiti.util.HandleWaitForResponseTask") block the execution?
06-13-2017 02:48 PM
No it does not. Is there a way to have Service Task completion event listener registered?
06-13-2017 06:30 PM
You can use an execution listener (on end event), see the user guide Activiti User Guide
06-13-2017 01:04 PM
No it does not. Is there a way to have Service Task completion event listener registered?
06-13-2017 11:49 PM
> activiti.util.HandleWaitForResponseTask
> But when it comes to the point to complete the service task that's where I am facing exceptions. Here is XML part of process definition:
Please provide the source of service task and the stack trace of exception.
Explore our Alfresco products with the links below. Use labels to filter content by product module.