cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow with only serviceTask

oskar201
Champ in-the-making
Champ in-the-making
Hi all,
I am developing a custom workflow only with ServiceTask, however as far as I've tried can not.
I have deployed a simple test model as follows:

<?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:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="prueba2" name="Prueba 2" isExecutable="true">

    <serviceTask id="alfrescoScripttask1" name="Lanzar Tarea" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
      <extensionElements>
         <activiti:field name="script">
            <activiti:string>logger.log("Holas");</activiti:string>
         </activiti:field>
      </extensionElements>
   </serviceTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <startEvent id="startevent1" name="Start"></startEvent>
    <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="alfrescoScripttask1"></sequenceFlow>
    <serviceTask id="alfrescoScripttask2" name="Alfresco Script Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
      <extensionElements>
         <activiti:field name="script">
            <activiti:string>logger.log("Holas1");</activiti:string>
         </activiti:field>
      </extensionElements>
   </serviceTask>
    <sequenceFlow id="flow3" sourceRef="alfrescoScripttask1" targetRef="alfrescoScripttask2"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="alfrescoScripttask2" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="prueba2" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="alfrescoScripttask1" id="BPMNShape_alfrescoScripttask1">
        <omgdc:Bounds height="55.0" width="105.0" x="150.0" y="180.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="450.0" y="190.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="190.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoScripttask2" id="BPMNShape_alfrescoScripttask2">
        <omgdc:Bounds height="55.0" width="105.0" x="305.0" y="180.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="85.0" y="207.0"></omgdi:waypoint>
        <omgdi:waypoint x="150.0" y="207.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="255.0" y="207.0"></omgdi:waypoint>
        <omgdi:waypoint x="305.0" y="207.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="410.0" y="207.0"></omgdi:waypoint>
        <omgdi:waypoint x="450.0" y="207.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>


The flow is displayed without errors from the activiti-console however when I try to create an instance of this a error message throws me  "WorkflowException: 05100012 Route workflow activiti $ 235 does not exist." The log shows what I write through serviceTask successfully, however the flow does not stop as it should.
Do you need to use a type UserTask tasks for this workflow run normally?
Can you make a pure flow serviceTask?

Thanks for help!
1 REPLY 1

muralidharand
Star Contributor
Star Contributor
Hi,
I debugged the workflow code.
The workflow is getting completed before it completes the singnalStart() method called.
If you're really interested to debug the code, please debug org.alfresco.repo.workflow.WorkflowBuilder.build() method.

Hope this helps you.