cancel
Showing results for 
Search instead for 
Did you mean: 

Missing activiti:formKey in StartEvent cause userTask to skip?

p792
Champ in-the-making
Champ in-the-making
if I don't use activiti:formKey="wf:submitAdhocTask" inside startEvent, then the workflow skip addUpdateTask and go straight to ReviewTask. Do anyone know why this happens?  I am new to alfresco
Thanks,


<?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="myProcess" name="My process" isExecutable="true">
    <startEvent id="alfrescoStartevent1" name="Alfresco start"  activiti:formKey="wf:submitAdhocTask"></startEvent>
    <userTask id="addUpdateTask" name="Add Update Task" activiti:candidateGroups="GROUP_Reviewers" activiti:formKey="wf:adhocTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[logger.log("Inside custom addContentTask Create-1111");]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[logger.log("Inside addContentTask Complete-1111");]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="ReviewTask" name="Review Task" activiti:candidateGroups="GROUP_Reviewers" activiti:formKey="wf:adhocTask"></userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="alfrescoStartevent1" targetRef="addUpdateTask"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="addUpdateTask" targetRef="ReviewTask"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="ReviewTask" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="alfrescoStartevent1" id="BPMNShape_alfrescoStartevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="220.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="addUpdateTask" id="BPMNShape_addUpdateTask">
        <omgdc:Bounds height="55.0" width="105.0" x="210.0" y="210.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ReviewTask" id="BPMNShape_ReviewTask">
        <omgdc:Bounds height="55.0" width="105.0" x="380.0" y="210.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="590.0" y="220.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="85.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="210.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="315.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="380.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="485.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="590.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
3 REPLIES 3

arak
Confirmed Champ
Confirmed Champ
Hi,

The "activiti:formKey" does not affect the workflow order. The "sequenceFlow" affects the order, and in you workflow, this is correct:

<sequenceFlow id="flow1" sourceRef="alfrescoStartevent1" targetRef="addUpdateTask"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="addUpdateTask" targetRef="ReviewTask"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="ReviewTask" targetRef="endevent1"></sequenceFlow>

Maybe you have a confusion, why the "formKey" and "candidateGroup" of the "addUpdateTask" and the "ReviewTask" is the same.

If the problem persist, Can you send more information (i.e.: screenshot)?

Greetings,
Arak.

swathirajan
Champ in-the-making
Champ in-the-making
By default, it takes adhoc task.
No you cannot skip the formkey as it defines the action to be performed.

p792
Champ in-the-making
Champ in-the-making
thank you for quick response.