AnsweredAssumed Answered

Activiti 5.14 - FormService.submitTaskFormData(taskId, properties) leading to wrong flow?

Question asked by bernhardthalmayr on Feb 9, 2016
Latest reply on Feb 11, 2016 by jbarrez
dear experts, I'm kind of newbie, so please apologise if my question sound stupid

I'm using Activit 5.14 right now.

I have a process definition like …

    <serviceTask id="createRequestTask" name="Create Request Data" activiti:expression="${assignAuthzGroupRequestTask.assignAuthzGroupRequest(execution,authenticatedUserId)}"></serviceTask>
    <serviceTask id="checkAutoApprovalTask" name="Check for Auto Approval" activiti:expression="${assignAuthzGroupRequestTask.checkAutoApproval(execution,authenticatedUserId)}"></serviceTask>   
    <userTask id="managerApprovalTask" name="Evaluate request by manager" activiti:assignee="${processService.findManagerForAuthzRequest(authorizationRequestData)}">
      <extensionElements>
        <activiti:taskListener expression="${notificationTask.notifyAssignee(task, execution)}" event="assignment" />    
        <activiti:formProperty id="requestApprovedManager" name="Approve" type="enum" required="true">
          <activiti:value id="true" name="Yes"></activiti:value>
          <activiti:value id="false" name="No"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"></activiti:formProperty>
      </extensionElements>
    </userTask>
    <userTask id="ownerApprovalTask" name="Evaluate request by component owner" activiti:candidateUsers="${processService.findCandidatesForAuthzRequest(authorizationRequestData)}">
      <extensionElements>
        <activiti:taskListener expression="${notificationTask.notifyCandidates(task, execution)}" event="create" />    
        <activiti:formProperty id="requestApprovedOwner" name="ApproveOwner" type="enum" required="true">
          <activiti:value id="true" name="Yes"></activiti:value>
          <activiti:value id="false" name="No"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"></activiti:formProperty>
      </extensionElements>
    </userTask>

    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="createRequestTask"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="createRequestTask" targetRef="managerApprovalTask"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="managerApprovalTask" targetRef="authorizationRequestApprovalGatewayManager"></sequenceFlow>
    <sequenceFlow id="flow4" name="managerApproval" sourceRef="authorizationRequestApprovalGatewayManager" targetRef="checkAutoApprovalTask">
        <conditionExpression xsi:type="tFormalExpression">${requestApprovedManager == 'true'}</conditionExpression>
    </sequenceFlow>


In Java code when I use FormService.submitTaskFormData(taskId, properties) to complete the userTask 'managerApprovalTask' I get into serviceTask 'createRequestTask' but I would actually expect to get into serviceTask 'checkAutoApprovalTask'.

I bet I'm making some mistake, although I've consulted the book 'Activiti in Action' several times on this topic.

Could someone please shed some light on this?

Thanks and regards,
Bernhard

Outcomes