无法添加资产:进程:任务节点[2]没有任务类型

时间:2016-10-18 05:46:10

标签: jbpm

我使用的是jBPM 6.4版本。我试图执行异步服务任务:



<?xml version="1.0" encoding="UTF-8"?>
<!-- origin at X=0.0 Y=0.0 -->
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.2.5.Final-v20160831-1132-B114" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
  <bpmn2:itemDefinition id="ItemDefinition_79" isCollection="false" structureRef="java.lang.String"/>
  <bpmn2:process id="com.hp.AsyncProcess" tns:packageName="com.hp" name="AsyncProcess" isExecutable="true" processType="Private">
    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
      <bpmn2:extensionElements>
        <tns:metaData name="elementname">
          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
        </tns:metaData>
      </bpmn2:extensionElements>
      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:task id="Task_1" name="AsyncService">
      <bpmn2:extensionElements>
        <tns:metaData name="elementname">
          <tns:metaValue><![CDATA[AsyncService]]></tns:metaValue>
        </tns:metaData>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
      <bpmn2:ioSpecification id="InputOutputSpecification_2">
        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_79" name="tableName"/>
        <bpmn2:inputSet id="InputSet_2" name="Input Set 2">
          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
        </bpmn2:inputSet>
        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2"/>
      </bpmn2:ioSpecification>
      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
        <bpmn2:assignment id="Assignment_2">
          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_6">userinfo</bpmn2:from>
          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_4">DataInput_1</bpmn2:to>
        </bpmn2:assignment>
      </bpmn2:dataInputAssociation>
    </bpmn2:task>
    <bpmn2:scriptTask id="ScriptTask_1" name="Script Task 1" scriptFormat="http://www.java.com/java">
      <bpmn2:extensionElements>
        <tns:metaData name="elementname">
          <tns:metaValue><![CDATA[Script Task 1]]></tns:metaValue>
        </tns:metaData>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
      <bpmn2:script>System.out.println(&quot;Srript task 1&quot;);</bpmn2:script>
    </bpmn2:scriptTask>
    <bpmn2:scriptTask id="ScriptTask_2" name="Script Task 2" scriptFormat="http://www.java.com/java">
      <bpmn2:extensionElements>
        <tns:metaData name="elementname">
          <tns:metaValue><![CDATA[Script Task 2]]></tns:metaValue>
        </tns:metaData>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
      <bpmn2:script>System.out.println(&quot;Srript task 2&quot;);</bpmn2:script>
    </bpmn2:scriptTask>
    <bpmn2:parallelGateway id="ParallelGateway_1" name="Parallel Gateway 1" gatewayDirection="Diverging">
      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
    </bpmn2:parallelGateway>
    <bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="StartEvent_1" targetRef="ParallelGateway_1"/>
    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="ParallelGateway_1" targetRef="Task_1"/>
    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="ParallelGateway_1" targetRef="ScriptTask_1"/>
    <bpmn2:sequenceFlow id="SequenceFlow_7" tns:priority="1" sourceRef="ScriptTask_1" targetRef="ScriptTask_2"/>
    <bpmn2:parallelGateway id="ParallelGateway_2" name="Parallel Gateway 2" gatewayDirection="Converging">
      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>
    </bpmn2:parallelGateway>
    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ScriptTask_2" targetRef="ParallelGateway_2"/>
    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="Task_1" targetRef="ParallelGateway_2"/>
    <bpmn2:endEvent id="EndEvent_1" name="End Event 1">
      <bpmn2:extensionElements>
        <tns:metaData name="elementname">
          <tns:metaValue><![CDATA[End Event 1]]></tns:metaValue>
        </tns:metaData>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_10" tns:priority="1" sourceRef="ParallelGateway_2" targetRef="EndEvent_1"/>
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="com.hp.AsyncProcess">
      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
        <dc:Bounds height="36.0" width="36.0" x="450.0" y="11.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="15.0" width="71.0" x="433.0" y="47.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Task_1" bpmnElement="Task_1">
        <dc:Bounds height="50.0" width="110.0" x="324.0" y="231.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="15.0" width="72.0" x="343.0" y="248.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1">
        <dc:Bounds height="50.0" width="110.0" x="555.0" y="170.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="15.0" width="71.0" x="574.0" y="187.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_2" bpmnElement="ScriptTask_2">
        <dc:Bounds height="50.0" width="110.0" x="555.0" y="280.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="15.0" width="71.0" x="574.0" y="297.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_ParallelGateway_1" bpmnElement="ParallelGateway_1" isMarkerVisible="true">
        <dc:Bounds height="50.0" width="50.0" x="445.0" y="65.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="30.0" width="57.0" x="442.0" y="115.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_ParallelGateway_2" bpmnElement="ParallelGateway_2" isMarkerVisible="true">
        <dc:Bounds height="50.0" width="50.0" x="475.0" y="365.0"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds height="30.0" width="57.0" x="472.0" y="415.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="EndEvent_1">
        <dc:Bounds height="36.0" width="36.0" x="482.0" y="482.0"/>
        <bpmndi:BPMNLabel labelStyle="#//@definitions/@diagrams.0/@labelStyle.0">
          <dc:Bounds height="15.0" width="65.0" x="468.0" y="518.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ParallelGateway_1">
        <di:waypoint xsi:type="dc:Point" x="468.0" y="47.0"/>
        <di:waypoint xsi:type="dc:Point" x="468.0" y="56.0"/>
        <di:waypoint xsi:type="dc:Point" x="470.0" y="56.0"/>
        <di:waypoint xsi:type="dc:Point" x="470.0" y="65.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_Task_1">
        <di:waypoint xsi:type="dc:Point" x="445.0" y="90.0"/>
        <di:waypoint xsi:type="dc:Point" x="379.0" y="90.0"/>
        <di:waypoint xsi:type="dc:Point" x="379.0" y="231.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_ScriptTask_1">
        <di:waypoint xsi:type="dc:Point" x="495.0" y="90.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="90.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="170.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_ScriptTask_2">
        <di:waypoint xsi:type="dc:Point" x="610.0" y="220.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="235.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="235.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="280.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ScriptTask_2" targetElement="BPMNShape_ParallelGateway_2">
        <di:waypoint xsi:type="dc:Point" x="610.0" y="330.0"/>
        <di:waypoint xsi:type="dc:Point" x="610.0" y="390.0"/>
        <di:waypoint xsi:type="dc:Point" x="525.0" y="390.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_Task_1" targetElement="BPMNShape_ParallelGateway_2">
        <di:waypoint xsi:type="dc:Point" x="379.0" y="281.0"/>
        <di:waypoint xsi:type="dc:Point" x="379.0" y="390.0"/>
        <di:waypoint xsi:type="dc:Point" x="475.0" y="390.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="BPMNShape_ParallelGateway_2" targetElement="BPMNShape_EndEvent_1">
        <di:waypoint xsi:type="dc:Point" x="500.0" y="415.0"/>
        <di:waypoint xsi:type="dc:Point" x="500.0" y="448.0"/>
        <di:waypoint xsi:type="dc:Point" x="500.0" y="482.0"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
    <bpmndi:BPMNLabelStyle>
      <dc:Font name="arial" size="9.0"/>
    </bpmndi:BPMNLabelStyle>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>
&#13;
&#13;
&#13;

但我收到以下错误:

我已经编写了jUnit以及要执行它的主类。两者都给出了同样的错误。请帮忙。

Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject notifyKieModuleFound
INFO: Found kmodule: file:/C:/Amoolya/workspace/maventest/AsyncProcess/bin/META-INF/kmodule.xml
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject getPomPropertiesFromFileSystem
WARNING: Unable to find pom.properties in /C:/Amoolya/workspace/maventest/AsyncProcess/bin
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject generatePomPropertiesFromPom
WARNING: As folder project tried to fall back to pom.xml, but could not find one for null
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject getPomProperties
WARNING: Unable to load pom.properties from/C:/Amoolya/workspace/maventest/AsyncProcess/bin
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject fetchKModule
WARNING: Cannot find maven pom properties for this project. Using the container's default ReleaseId
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.KieRepositoryImpl addKieModule
INFO: KieModule was added: FileKieModule[releaseId=org.default:artifact:1.0.0-SNAPSHOT,file=C:\Amoolya\workspace\maventest\AsyncProcess\bin]
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.ClasspathKieProject notifyKieModuleFound
INFO: Found kmodule: jar:file:/C:/Amoolya/jbpm-installer/runtime/drools-pmml-6.3.0.Final.jar!/META-INF/kmodule.xml
Oct 17, 2016 4:27:53 PM org.drools.compiler.kie.builder.impl.KieRepositoryImpl addKieModule
INFO: KieModule was added: ZipKieModule[releaseId=org.drools:drools-pmml:6.3.0.Final,file=C:\Amoolya\jbpm-installer\runtime\drools-pmml-6.3.0.Final.jar]
Oct 17, 2016 4:27:54 PM org.drools.compiler.kie.builder.impl.AbstractKieModule buildKnowledgePackages
WARNING: No files found for KieBase kbase, searching folder C:\Amoolya\workspace\maventest\AsyncProcess\bin
0    [main] WARN  org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl  - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Oct 17, 2016 4:27:57 PM bitronix.tm.BitronixTransactionManager logVersion
INFO: Bitronix Transaction Manager version 2.1.4
Oct 17, 2016 4:27:57 PM bitronix.tm.Configuration buildServerIdArray
WARNING: cannot get this JVM unique ID. Make sure it is configured and you only use ASCII characters. Will use IP address instead (unsafe for production usage!).
Oct 17, 2016 4:27:57 PM bitronix.tm.Configuration buildServerIdArray
INFO: JVM unique ID: <16.169.150.163>
Oct 17, 2016 4:27:58 PM bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, did you call BitronixTransactionManager.shutdown() at the end of the last run?
Oct 17, 2016 4:28:00 PM bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 1 resource(s) [jdbc/jbpm-ds] (restricted to serverId '16.169.150.163')
Oct 17, 2016 4:28:01 PM org.drools.core.xml.ExtensibleXmlParser error
SEVERE: (null: 123, 82): cvc-datatype-valid.1.2.1: '#//@definitions/@diagrams.0/@labelStyle.0' is not a valid value for 'QName'.
Oct 17, 2016 4:28:01 PM org.drools.core.xml.ExtensibleXmlParser error
SEVERE: (null: 123, 82): cvc-attribute.3: The value '#//@definitions/@diagrams.0/@labelStyle.0' of attribute 'labelStyle' on element 'bpmndi:BPMNLabel' is not valid with respect to its type, 'QName'.
Exception in thread "main" java.lang.IllegalArgumentException: Cannot add asset: Process 'AsyncProcess' [com.hp.AsyncProcess]: Task node 'AsyncService' [2] has no task type.,
  at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:171)
  at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)
  at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:74)
  at com.hp.main.ProcessMain.createRuntimeManager(ProcessMain.java:92)
  at com.hp.main.ProcessMain.main(ProcessMain.java:38)

1 个答案:

答案 0 :(得分:0)

您的流程定义似乎无效。尝试在Designer中使用验证来查看需要修复的所有错误。