cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 6 Task Assignment Issue

abu
Champ in-the-making
Champ in-the-making
Hi,

I ran into an issue when trying to setup a simple workflow using Activiti 6.0.0 Beta1.

My Development Environment:
Spring Boot 1.2.6
Activiti 6.0.0. Beta 1
Eclipse STS.

Note:
I'm using spring boot and have added the Activiti 6 jar dependencies manually in the gradle file.

Scenario:
The workflow process is a simple one - basically, from my spring base java code, whenever there is an exception, I instantiate an Activiti "ErrorProcess" (a process that I created using Activiti 6 UI App). This "ErrorProcess" is passed the "exceptionDetails" from the java code as a string, and in the workflow, there is a UserTask that uses "user@company.com" as the Assignee. Basically, the form just retrieves the ${exceptionDetails} from the start node and displays in a "display text" field.

Issues:

There are two issues that I can observe:
1. The process does get deployed correctly. However, the issue is that the task assignment doesn't seem to be happening correctly. I.e., when I log into the Activiti 6 UI App and view the Tasks tab, there are no tasks assigned for "user@company.com". I also tried assigning to a candidate group (Superusers) that the user "user@company.com" is part of, but that yielded the same result (i.e. the task was not visible in the tasks tab).

2. In the Activiti UI App (AngularJS based), when I try to initiate a new process instance, the right hand pane seems to be loading the form but it doesn't appear (all I can see is animation with three dots indicating that it is still being loaded…). The actual form with exceptionDetails field is not displayed.

What could be the issue ? Greatly appreciate any insights you could provide as we are looking forward to use Activiti 6 in a large project, however, this has become a show stopper.

The BPMN file is given below:

<?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" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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="ErrorProcess" name="ErrorProcess" isExecutable="true">
    <startEvent id="startevent1" name="Start" activiti:initiator="user@company.com" activiti:isInterrupting="false">
      <extensionElements>
        <activiti:formProperty id="exceptionDetails" name="Exception Details" type="string" required="true"></activiti:formProperty>
      </extensionElements>
    </startEvent>
    <userTask id="usertask1" name="User Task" activiti:assignee="user@company.com" activiti:candidateGroups="Superusers" activiti:formKey="10">
      <extensionElements>
        <modeler:form-reference-id xmlns:modeler="http://activiti.com/modeler">10</modeler:form-reference-id>
        <modeler:form-reference-name xmlns:modeler="http://activiti.com/modeler">ErrorDetailsForm</modeler:form-reference-name>
        <modeler:initiator-can-complete xmlns:modeler="http://activiti.com/modeler">true</modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_ErrorProcess">
    <bpmndi:BPMNPlane bpmnElement="ErrorProcess" id="BPMNPlane_ErrorProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="30.0" width="30.0" x="100.0" y="300.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="180.0" y="285.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="28.0" width="28.0" x="330.0" y="300.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="129.99660595085598" y="314.68092327764134"></omgdi:waypoint>
        <omgdi:waypoint x="180.0" y="313.6170212765957"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="285.0" y="313.2062780269058"></omgdi:waypoint>
        <omgdi:waypoint x="330.0012666944829" y="313.81167623355805"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

The java code that creates a new process instance:

Map<String, Object> variables = new HashMap<String, Object>();
      variables.put("exceptionDetails", "exception details…");
ProcessInstance processInstance = runtimeService
            .startProcessInstanceByKey(
                  "ErrorProcess", variables);


Many Thanks !
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

I don't see any BPMN file. Did you set an assignee or a candidate user? A candidate user is only able to claim a task, it doesn't get assigned automatically. About your second issue, it would be good if you could share the app you created so we can try to reproduce.

Best regards,