AnsweredAssumed Answered

Error during deploy of a bpmn20.xml process file

Question asked by matthias1 on Jun 5, 2012
Latest reply on Jun 5, 2012 by matthias1
Hi!

First of all, the setup I am using is Activiti 5.8 and Eclipse Helios with the Activiti Designer 5.8.0 on JDK 1.6.
After I had successfully tested the 10-minute-tutorial on using the process engine and deploying processes, I tried to use the demo setup for my own example process.
I should mention, that this Process uses some custom flow-elements and flow-nodes.

The Java Class I use for creating the process engine and deploying is the one from the tutorial, except for the way of getting the file:

public class Main_Test {

   /**
    * @param args
    * @throws FileNotFoundException
    */
   public static void main(String[] args) throws FileNotFoundException {
      // Create Activiti process engine
        ProcessEngine processEngine = ProcessEngineConfiguration
          .createStandaloneProcessEngineConfiguration()
          .buildProcessEngine();
       
        // Get Activiti services
        RepositoryService repositoryService = processEngine.getRepositoryService();
        RuntimeService runtimeService = processEngine.getRuntimeService();
       
        // Deploy the process definition
        repositoryService.createDeployment().addInputStream("TravelApproval.bpmn20.xml", new FileInputStream(new File
                           ("C:/[…]/TravelApproval/TravelApproval.bpmn20.xml"))).deploy();
         
        // Start a process instance
        runtimeService.startProcessInstanceByKey("TravelApproval");

   }

}

The TravelApproval.bpmn20.xml looks like this and it was created by the Activiti Designer:

<?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="TravelApproval" name="TravelApproval">
    <documentation>Place documentation for the 'TravelApproval' process here.</documentation>
    <startEvent id="startevent1" name="Start"></startEvent>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="parallelgateway1"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="parallelgateway1" targetRef="usertask2"></sequenceFlow>
    <sequenceFlow id="flow4" name="" sourceRef="parallelgateway1" targetRef="usertask3"></sequenceFlow>
    <parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow5" name="" sourceRef="usertask2" targetRef="parallelgateway2"></sequenceFlow>
    <sequenceFlow id="flow6" name="" sourceRef="usertask3" targetRef="parallelgateway2"></sequenceFlow>
    <serviceTask id="servicetask1" name="Send Result" activiti:class="com.mycompany.bpmn.ResultSender"></serviceTask>
    <sequenceFlow id="flow7" name="" sourceRef="parallelgateway2" targetRef="servicetask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow8" name="" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_TravelApproval">
    <bpmndi:BPMNPlane bpmnElement="TravelApproval" id="BPMNPlane_TravelApproval">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="70" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55" width="105" x="150" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="parallelgateway1" id="BPMNShape_parallelgateway1">
        <omgdc:Bounds height="40" width="40" x="310" y="237"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
        <omgdc:Bounds height="55" width="105" x="390" y="100"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
        <omgdc:Bounds height="55" width="105" x="390" y="360"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="parallelgateway2" id="BPMNShape_parallelgateway2">
        <omgdc:Bounds height="40" width="40" x="550" y="237"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
        <omgdc:Bounds height="55" width="105" x="635" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="795" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="105" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="150" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="255" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="310" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="330" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="330" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="390" y="127"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="330" y="277"></omgdi:waypoint>
        <omgdi:waypoint x="330" y="387"></omgdi:waypoint>
        <omgdi:waypoint x="390" y="387"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="495" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="570" y="127"></omgdi:waypoint>
        <omgdi:waypoint x="570" y="237"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="495" y="387"></omgdi:waypoint>
        <omgdi:waypoint x="570" y="387"></omgdi:waypoint>
        <omgdi:waypoint x="570" y="277"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="590" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="635" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="740" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="795" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

When running the Java Class posted here or using the activiti-explorer to deploy, I get the following error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
05.06.2012 10:41:19 org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
05.06.2012 10:41:19 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource TravelApproval.bpmn20.xml
05.06.2012 10:41:19 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
05.06.2012 10:41:19 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
05.06.2012 10:41:19 org.activiti.engine.impl.interceptor.CommandContext close
SCHWERWIEGEND: Error while closing command context
org.activiti.engine.ActivitiException: cvc-id.1: There is no ID/IDREF binding for IDREF 'usertask3'. | TravelApproval.bpmn20.xml | line 83 | column 15
Invalid destination 'usertask1' of sequence flow 'flow1' | TravelApproval.bpmn20.xml | line 6 | column 84
Invalid source 'usertask1' of sequence flow 'flow2' | TravelApproval.bpmn20.xml | line 8 | column 89
Invalid destination 'usertask2' of sequence flow 'flow3' | TravelApproval.bpmn20.xml | line 9 | column 89
Invalid destination 'usertask3' of sequence flow 'flow4' | TravelApproval.bpmn20.xml | line 10 | column 89
Invalid source 'usertask2' of sequence flow 'flow5' | TravelApproval.bpmn20.xml | line 12 | column 89
Invalid source 'usertask3' of sequence flow 'flow6' | TravelApproval.bpmn20.xml | line 13 | column 89
Invalid reference in 'bpmnElement' attribute, activity usertask1not found | TravelApproval.bpmn20.xml | line 24 | column 74
Invalid reference in 'bpmnElement' attribute, activity usertask2not found | TravelApproval.bpmn20.xml | line 30 | column 74
Invalid reference in 'bpmnElement' attribute, activity usertask3not found | TravelApproval.bpmn20.xml | line 33 | column 74
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow1not found | TravelApproval.bpmn20.xml | line 45 | column 64
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow2not found | TravelApproval.bpmn20.xml | line 49 | column 64
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow3not found | TravelApproval.bpmn20.xml | line 53 | column 64
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow4not found | TravelApproval.bpmn20.xml | line 58 | column 64
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow5not found | TravelApproval.bpmn20.xml | line 63 | column 64
Invalid reference in 'bpmnElement' attribute, sequenceFlow flow6not found | TravelApproval.bpmn20.xml | line 68 | column 64

   at org.activiti.engine.impl.util.xml.Parse.throwActivitiExceptionForErrors(Parse.java:186)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:201)
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:81)
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:37)
   at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:39)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:58)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:30)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:43)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
   at test.Main_Test.main(Main_Test.java:32)

My guess with this error is, that my TravelApproval.bpmn20.xml is missing the definitions for all the usertasks. But if my guess is right, my question would be, why does the designer not create them when I export to bpmn20.xml? And how do I get him to do! ;)

Hope someone can help me out.

Kind Regards
Matthias

Outcomes