cancel
Showing results for 
Search instead for 
Did you mean: 

activiti generated bpmn xml headers does not map correct schema

ismail1
Champ in-the-making
Champ in-the-making
Hi folks,
Latest Activiti ecplise editor generates bpmn xml with this definitions on top,


<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">


But none of those map to correct located xsd schema,so i can not validate bpmn xml…Can someone please share correct locations..
As i mentioned earlier when bpmn process is getting more complicated and longer, xml problems tah you cant address start to occur…
4 REPLIES 4

ismail1
Champ in-the-making
Champ in-the-making
i ve validated, problems are kinds of sticky types as far as i researched from the forums… the generated process xml and referring definitions have some kind of dont match issues…

<code>
Description Resource Path Location Type
cvc-attribute.3: The value 'mail' of attribute 'activiti:type' on element 'serviceTask' is not valid with respect to its type, 'null'. expense_process.bpmn /demo/src/main/resources/diagrams line 22 XML Problem
cvc-attribute.3: The value 'mail' of attribute 'activiti:type' on element 'serviceTask' is not valid with respect to its type, 'null'. expense_process.bpmn /demo/src/main/resources/diagrams line 124 XML Problem
cvc-complex-type.2.1: Element 'activiti:formProperty' must have no character or element information item [children], because the type's content type is empty. expense_process.bpmn /demo/src/main/resources/diagrams line 49 XML Problem
cvc-complex-type.2.1: Element 'activiti:formProperty' must have no character or element information item [children], because the type's content type is empty. expense_process.bpmn /demo/src/main/resources/diagrams line 76 XML Problem
cvc-complex-type.3.2.2: Attribute 'datePattern' is not allowed to appear in element 'activiti:formProperty'. expense_process.bpmn /demo/src/main/resources/diagrams line 17 XML Problem
cvc-complex-type.3.2.2: Attribute 'datePattern' is not allowed to appear in element 'activiti:formProperty'. expense_process.bpmn /demo/src/main/resources/diagrams line 43 XML Problem
cvc-complex-type.3.2.2: Attribute 'datePattern' is not allowed to appear in element 'activiti:formProperty'. expense_process.bpmn /demo/src/main/resources/diagrams line 70 XML Problem
cvc-complex-type.3.2.2: Attribute 'datePattern' is not allowed to appear in element 'activiti:formProperty'. expense_process.bpmn /demo/src/main/resources/diagrams line 95 XML Problem
cvc-enumeration-valid: Value 'mail' is not facet-valid with respect to enumeration '[shell]'. It must be a value from the enumeration. expense_process.bpmn /demo/src/main/resources/diagrams line 22 XML Problem
cvc-enumeration-valid: Value 'mail' is not facet-valid with respect to enumeration '[shell]'. It must be a value from the enumeration. expense_process.bpmn /demo/src/main/resources/diagrams line 124 XML Problem

</code>

still cant deploy the process above, resulting in xml "Deployment failed.Error parsing xml."…
this is turning to be cumbersome, any help?

ismail1
Champ in-the-making
Champ in-the-making
Here is the full process

<code>
<process id="expenseProcess" name="New Expense process with confirmation" isExecutable="true">
    <startEvent id="startevent1" name="Start" activiti:initiator="employee">
      <extensionElements>
        <activiti:formProperty id="amount" name="Amount for expense" type="long" required="true"></activiti:formProperty>
        <activiti:formProperty id="expenseDate" name="Date of expense" type="date" datePattern="dd-MM-yyyy hh:mm" required="true"></activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation for expense" type="string"></activiti:formProperty>
      </extensionElements>
    </startEvent>
   
    <serviceTask id="mailtask1" name="Mail to management" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:expression>${employee.mail}</activiti:expression>
        </activiti:field>
        <activiti:field name="from">
          <activiti:string>expenses@kkb.com.tr</activiti:string>
        </activiti:field>
        <activiti:field name="subject">
          <activiti:string>Expense request received</activiti:string>
        </activiti:field>
        <activiti:field name="html">
          <activiti:expression>Hello Pal, ${employee} has requested a refund of ${amount} Euro.</activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>
   
    <userTask id="usertask2" name="Management handle request" activiti:candidateGroups="management">
      <documentation>${employee} has requested a refund of ${amount} Euro.</documentation>
      <extensionElements>
        <activiti:formProperty id="amount" name="Amount for expense" type="long" required="true"></activiti:formProperty>
        <activiti:formProperty id="expenseDate" name="Date of expense" type="date" datePattern="dd-MM-yyyy hh:mm" required="true"></activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation for expense" type="string"></activiti:formProperty>
        <activiti:formProperty id="managerMotivation" name="Motivation" type="string"></activiti:formProperty>
        <activiti:formProperty id="managerApproved" name="Do you approve this expense?" type="enum" required="true">
          <activiti:value id="true" name="Approve"></activiti:value>
          <activiti:value id="false" name="Reject"></activiti:value>
        </activiti:formProperty>
        <activiti:taskListener event="complete" class="org.activiti.engine.impl.bpmn.listener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
             var approvingManager = task.assignee; 
    approvingManager // implicit return value
   </activiti:string>
          </activiti:field>
          <activiti:field name="language">
            <activiti:string>javascript</activiti:string>
          </activiti:field>
          <activiti:field name="resultVariable">
            <activiti:string>approvingManager</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="usertask3" name="Accountancy handle request" activiti:candidateGroups="accountancy">
      <documentation>${employee} has requested a refund of ${amount} Euro. ${approvingManager} has been approved.</documentation>
      <extensionElements>
        <activiti:formProperty id="amount" name="Amount for expense" type="long" required="true"></activiti:formProperty>
        <activiti:formProperty id="expenseDate" name="Date of expense" type="date" datePattern="dd-MM-yyyy hh:mm" required="true"></activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation for expense" type="string"></activiti:formProperty>
        <activiti:formProperty id="managerMotivation" name="Manager Motivation" type="string"></activiti:formProperty>
        <activiti:formProperty id="accountantApproved" name="Do you approve this expense?(Limit for employee is 5000 Euro.)" type="enum" required="true">
          <activiti:value id="true" name="Approve"></activiti:value>
          <activiti:value id="false" name="Reject"></activiti:value>
        </activiti:formProperty>
        <activiti:formProperty id="accountancyMotivation" name="Accountancy Motivation" type="string"></activiti:formProperty>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" sourceRef="mailtask1" targetRef="usertask2"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="usertask2" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="usertask3" targetRef="exclusivegateway2"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="startevent1" targetRef="mailtask1"></sequenceFlow>
    <exclusiveGateway id="exclusivegateway1" name="Manager Approve Decision"></exclusiveGateway>
    <sequenceFlow id="flow5" name="Manager approved" sourceRef="exclusivegateway1" targetRef="usertask3">
      <conditionExpression xsi:type="tFormalExpression">${managerApproved == 'true'}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow6" name="Manager disapproved" sourceRef="exclusivegateway1" targetRef="usertask4">
      <conditionExpression xsi:type="tFormalExpression">${managerApproved == 'false'}</conditionExpression>
    </sequenceFlow>
    <userTask id="usertask4" name="Adjust expense request" activiti:assignee="${employee}">
      <documentation>${approvingManager} has requested to adjust your request.</documentation>
      <extensionElements>
        <activiti:formProperty id="amount" name="Amount for expense" type="long" required="true"></activiti:formProperty>
        <activiti:formProperty id="expenseDate" name="Date of expense" type="date" datePattern="dd-MM-yyyy hh:mm" required="true"></activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation for expense" type="string"></activiti:formProperty>
        <activiti:formProperty id="managerMotivation" name="Manager Motivation" type="string"></activiti:formProperty>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow7" sourceRef="usertask4" targetRef="mailtask1"></sequenceFlow>
    <exclusiveGateway id="exclusivegateway2" name="Accountant Approve Decision"></exclusiveGateway>
    <serviceTask id="servicetask1" name="Call Muhasebe Web Service" activiti:class="org.activiti.demo.muhasebe.MuhasebeWebServiceCaller">
      <extensionElements>
        <activiti:field name="wsdl">
          <activiti:expression>muhasebeWebService.wsdl</activiti:expression>
        </activiti:field>
        <activiti:field name="operation">
          <activiti:string>payAmount</activiti:string>
        </activiti:field>
        <activiti:field name="parameters">
          <activiti:expression>${amount},${employee}</activiti:expression>
        </activiti:field>
        <activiti:field name="returnValue">
          <activiti:string>payAmountResult</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow8" name="Account Manager Approved" sourceRef="exclusivegateway2" targetRef="servicetask1">
      <conditionExpression xsi:type="tFormalExpression">${accountantApproved == 'true'}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow12" name="Account Manager Disapproved" sourceRef="exclusivegateway2" targetRef="mailtask2">
      <conditionExpression xsi:type="tFormalExpression">${accountantApproved == 'false'}</conditionExpression>
    </sequenceFlow>
    <serviceTask id="mailtask2" name="Mail Expense Request Result" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:expression>${employee.mail}</activiti:expression>
        </activiti:field>
        <activiti:field name="cc">
          <activiti:expression>${approvingManager.mail}</activiti:expression>
        </activiti:field>
        <activiti:field name="from">
          <activiti:string>expenses@kkb.com.tr</activiti:string>
        </activiti:field>
        <activiti:field name="subject">
          <activiti:expression>${accountantApproved == 'true' ? 'Expense request Approved' : 'Expense request Disapproved'}</activiti:expression>
        </activiti:field>
        <activiti:field name="html">
          <activiti:expression>Your expense request of ${amount} Euro was ${accountantApproved == 'true' ? 'approved','disapproved. Sorry'}</activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow10" sourceRef="servicetask1" targetRef="mailtask2"></sequenceFlow>
    <sequenceFlow id="flow11" sourceRef="mailtask2" targetRef="endevent1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
  </process>
</code>

frederikherema1
Star Contributor
Star Contributor
Please don't post the same question twice, that won't get it answered quicker, on the contrary…

ismail1
Champ in-the-making
Champ in-the-making
Ok, thanks….