cancel
Showing results for 
Search instead for 
Did you mean: 

Error deploying bpmn20.xml

bhimnanna
Champ in-the-making
Champ in-the-making
Hi Tijs,

I am deploying :
getRepositoryService().createDeployment()
      .addClasspathResource("resources/tpmbda.bpmn20.xml").deploy();
      ProcessInstance processInstance = getRuntimeService().startProcessInstanceByKey("tpmbda");

It working fine for initial restart of my server (added Activiti engine in my application).

If I restart the my server then (above statements are not executing):
But I am trying get the task definition:
   getRepositoryService().createDeployment().addClasspathResource("resources/tpmbda.bpmn20.xml").deploy();
   Task task = getTaskbyId(MSDIUtil.getUserName(), taskid);
      ProcessDefinition processDefinition = getRepositoryService().createProcessDefinitionQuery()
              .processDefinitionId(task.getProcessDefinitionId()).singleResult();
            
   Map<String, String> formProperties =
         new HashMap<String, String>();
         formProperties.put("remarks", remarks);
         formProperties.put("requestApproved", requestApproved);
         getFormService().submitTaskFormData(taskid, formProperties);

It is throwing following exception:

Nov 11, 2012 7:41:50 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource resources/tpmbda.bpmn20.xml
Nov 11, 2012 7:41:50 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiException: couldn't parse 'resources/tpmbda.bpmn20.xml': Content is not allowed in prolog.
   at org.activiti.engine.impl.util.xml.Parse.execute(Parse.java:136)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:210)
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:86)
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:38)
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.resolveProcessDefinition(DeploymentCache.java:91)
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedProcessDefinitionById(DeploymentCache.java:53)

Please can you help me to fix this issue.

Regards

Bhimanna
4 REPLIES 4

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
First of all, this should be in the user forum, but more importantly, just search the internet for error you see. Very common and not (specifically) Activiti related! The xml contains data that in the beginningn of the file that should not be there.

bhimnanna
Champ in-the-making
Champ in-the-making
Hi Ronald,

Thanks for your reply.

The bpmn20.xml file is working using activity-explorer, but if I deploy in my web application with spring this issue is exist. The issue may be related to file path of deployment.

Following is the xml file:

<?xml version="1.0" encoding="UTF-8"?>
<definitions id="taskAssigneeExample"
   xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
targetNamespace="http://www.bpmnwithactiviti.org/loanrequest">

  <process id="tpmbda" name="Process to handle a approval(anumati) request">
    <startEvent id="theStart"></startEvent>
    <!–  Process Starts –>
    <sequenceFlow sourceRef="theStart" targetRef="usertask1" />
    <userTask id="usertask1" name="Clark" activiti:assignee="user1">
      <extensionElements>
        <activiti:formProperty id="remarks" name="Remarks"/>
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <!– <activiti:formProperty id="explanation" name="Explanation"/> –>
      </extensionElements>
    </userTask>
   
    <!–  usertask1 –>
   <!–  <sequenceFlow sourceRef="evaluateApprovalRequest" targetRef="approvalGateway" />
    <boundaryEvent id="escalationTimer" cancelActivity="true" attachedToRef="evaluateApprovalRequest">
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
    </timerEventDefinition>
    </boundaryEvent> –>
    <sequenceFlow sourceRef="usertask1" targetRef="usertask2" />
    <userTask id="usertask2" name="OS" activiti:assignee="user2">
      <extensionElements>
        <activiti:formProperty id="remarks1" name="Remark1" />
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
   
    <sequenceFlow sourceRef="usertask2" targetRef="approvalGateway2" />
    <exclusiveGateway id="approvalGateway2" />
    <sequenceFlow sourceRef="approvalGateway2" targetRef="usertask1">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway2" targetRef="usertask3">
    <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
   
    <!–  usertask3 –>
    <userTask id="usertask3" name="DD" activiti:assignee="user3">
      <extensionElements>
        <activiti:formProperty id="remarks2" name="Remark2" />
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
   
    <sequenceFlow sourceRef="usertask3" targetRef="approvalGateway3" />
    <exclusiveGateway id="approvalGateway3" />
    <sequenceFlow sourceRef="approvalGateway3" targetRef="usertask2">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway3" targetRef="usertask4">
    <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
   
    <!–  usertask4 –>
    <userTask id="usertask4" name="JD" activiti:assignee="user4">
      <extensionElements>
        <activiti:formProperty id="remarks3" name="Remark3" />
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
   
    <sequenceFlow sourceRef="usertask4" targetRef="approvalGateway4" />
    <exclusiveGateway id="approvalGateway4" />
    <sequenceFlow sourceRef="approvalGateway4" targetRef="usertask3">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway4" targetRef="usertask5">
    <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
   
    <!–  usertask5 –>
    <userTask id="usertask5" name="TPM" activiti:assignee="user5">
      <extensionElements>
        <activiti:formProperty id="remarks4" name="Remark4" />
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
   
    <sequenceFlow sourceRef="usertask5" targetRef="approvalGateway5" />
    <exclusiveGateway id="approvalGateway5" />
    <sequenceFlow sourceRef="approvalGateway5" targetRef="usertask4">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway5" targetRef="usertask6">
    <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
   
    <!–  usertask6 –>
    <userTask id="usertask6" name="COM" activiti:assignee="user6">
      <extensionElements>
        <activiti:formProperty id="remarks4" name="Remark4" />
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
   
    <sequenceFlow sourceRef="usertask6" targetRef="approvalGateway6" />
    <exclusiveGateway id="approvalGateway6" />
    <sequenceFlow sourceRef="approvalGateway6" targetRef="informCustomer">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway6" targetRef="processRequest">
    <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
 
   
   
    <serviceTask id="informCustomer" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to" expression="${loanApplication.emailAddress}" />
        <activiti:field name="subject" stringValue="Loan Request Denied" />
        <activiti:field name="html">
          <activiti:expression>
            <![CDATA[
              <html>
                <body>
                  Hello ${loanApplication.customerName},<br/><br/>
                 
                  Your loan request has been denied for the following reason: ${explanation}.<br/><br/>
                 
                  Kind regards,<br/>
                 
                  The Loan Sharks Company.
                </body>
              </html>
            ]]>
          </activiti:expression>
        </activiti:field>     
      </extensionElements>
    </serviceTask>
    <sequenceFlow sourceRef="informCustomer" targetRef="theEnd" />
    <userTask id="processRequest" name="Process the loan request" activiti:assignee="fozzie" />
    <sequenceFlow sourceRef="processRequest" targetRef="theEnd" />
    <endEvent id="theEnd" />
  </process>
</definitions>

Regards,

Bhimanna

bhimnanna
Champ in-the-making
Champ in-the-making
Hi Ronald/Tijs,

Still I am same issue.Please any update on this.

Regards,

Bhimanna

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Posting the file does not help in these cases. Looking at what spring is actually trying to deploy does… E.g. with a debugger…