cancel
Showing results for 
Search instead for 
Did you mean: 

Error during deploy of a bpmn20.xml process file

matthias1
Champ in-the-making
Champ in-the-making
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! Smiley Wink

Hope someone can help me out.

Kind Regards
Matthias
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I have never seen this. Are you sure in the designer the usertasks are all 'valid'? Meaning no markers/problems in eclipse on them (e.g. a forgotten assignee)

matthias1
Champ in-the-making
Champ in-the-making
Hey,

what exactly have you never seen? The error message or the way my example bpmn20.xml file looks like?
And the process is without any problems or markers.
I have a couple of custom export tools working fine on this example, e.g. exporting to a XACML-Policy, so the tasks have to be valid.

Kind Regards,
Matthias

matthias1
Champ in-the-making
Champ in-the-making
After some testing of my own I found what is causing this trouble.
My custom flows and flow nodes cannot be parsed and because they are connected to standard activiti usertasks these usertasks are left out in the bpmn20.xml file for some reason.

If I delete the custom flows / flow nodes from my example diagram the bpmn20.xml export works just fine and creates the <usertask> labels which are missing in my version WITH the custom objects.

So my solution would be to tell the bpmn20 export marshaller to ignore my custom objects, because they are not needed for the activiti process but by another server.
If you could give me a hint or a little push on how to do this, or if you have a more proper solution/idea please tell me!

Kind Regards,
Matthias