1

我已经通过 Apache Tomcat 部署了 Flowable 6.3.1。尝试对以下模型进行建模Flowable BpmnJsonConverter(顺便说一下,我不知道它与 CMMN 建模有什么关系)抛出NullPointerException. CMMN模型

生成的xml如下。

    <?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
  <case id="holidayRequest" name="HolidayRequest" flowable:initiatorVariableName="initiator">
    <casePlanModel id="casePlanModel" flowable:formKey="requestHoliday">
      <planItem id="planItem1" name="checkRequest" definitionRef="sid-0F1F1EF4-7661-4CC8-9AD7-4F2566DF989C">
        <entryCriterion id="sid-43F0EC01-FD2F-417C-9CC7-46F0F3141D40" sentryRef="sentry1"></entryCriterion>
      </planItem>
      <planItem id="planItem2" name="isCheckNeeded" definitionRef="sid-C7C05BD3-1D12-4060-9AE8-FD5E4CB9DF94">
        <itemControl>
          <requiredRule></requiredRule>
        </itemControl>
      </planItem>
      <sentry id="sentry1">
        <ifPart>
          <condition><![CDATA[${decisionNeeded == "true"}]]></condition>
        </ifPart>
      </sentry>
      <humanTask id="sid-0F1F1EF4-7661-4CC8-9AD7-4F2566DF989C" name="checkRequest" flowable:candidateUsers="admin,boss" flowable:formKey="checkHoliday"></humanTask>
      <decisionTask id="sid-C7C05BD3-1D12-4060-9AE8-FD5E4CB9DF94" name="isCheckNeeded" isBlocking="false">
        <extensionElements>
          <flowable:field name="decisionTaskThrowErrorOnNoHits">
            <flowable:string><![CDATA[false]]></flowable:string>
          </flowable:field>
        </extensionElements>
      </decisionTask>
    </casePlanModel>
  </case>
  <cmmndi:CMMNDI>
    <cmmndi:CMMNDiagram id="CMMNDiagram_holidayRequest">
      <cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
        <dc:Bounds height="424.0" width="580.0" x="40.0" y="40.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
        <dc:Bounds height="80.0" width="100.0" x="300.0" y="180.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_sid-43F0EC01-FD2F-417C-9CC7-46F0F3141D40" cmmnElementRef="sid-43F0EC01-FD2F-417C-9CC7-46F0F3141D40">
        <dc:Bounds height="22.0" width="14.0" x="292.58765691867626" y="227.54247101841793"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
        <dc:Bounds height="80.0" width="100.0" x="105.5" y="183.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNEdge id="CMMNEdge_sid-BDE0FC41-0461-4EAB-93E8-4E3E19709E7B" cmmnElementRef="sid-C7C05BD3-1D12-4060-9AE8-FD5E4CB9DF94" targetCMMNElementRef="sid-0F1F1EF4-7661-4CC8-9AD7-4F2566DF989C">
        <di:waypoint x="205.44999999999806" y="222.2287917737789"></di:waypoint>
        <di:waypoint x="299.99999999999847" y="220.77043701799485"></di:waypoint>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNEdge>
    </cmmndi:CMMNDiagram>
  </cmmndi:CMMNDI>
</definitions>

我需要做什么来修复它?

PS我以前遇到过这个问题,当我尝试部署它的应用程序时,它曾经抛出一个异常,说明extensionElement标签以及它不应该有孩子的事实!但现在它毫无例外地部署。

EDIT-1:我发现决策表引用为空,所以当我更改它以指出决策表时,我得到了与我之前在 PS 部分中提到的相同的异常。这是一个 CmmnXMLException。堆栈跟踪摘要如下。

错误 19300 --- [nio-8090-exec-8] ofumsModelImageService:创建缩略图 cmmn 图像时出错 073fbc3d-b36b-11e8-ae0a-005056c00008 java.lang.NullPointerException:在 org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator 处为空。 connectionPerfectionizer(DefaultCaseDiagramGenerator.java:393)~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator.drawAssociation(DefaultCaseDiagramGenerator.java:369) ~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator.generateCaseDiagram(DefaultCaseDiagramGenerator.java:261) ~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator.generateImage(DefaultCaseDiagramGenerator.java:222) ~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator.generateImage(DefaultCaseDiagramGenerator.java:227) ~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.image.impl.DefaultCaseDiagramGenerator.generatePngImage(DefaultCaseDiagramGenerator.java:232) ~[flowable-cmmn-image-generator-6.3.1.jar:6.3.1]

错误 19300 --- [nio-8090-exec-8] ofceiiCommandContext:关闭命令上下文时出错

org.flowable.cmmn.converter.CmmnXMLException:cvc-complex-type.2.4.d:发现以元素“extensionElements”开头的无效内容。此时不需要子元素。在

org.flowable.cmmn.converter.CmmnXmlConverter.convertToCmmnModel(CmmnXmlConverter.java:173) ~[flowable-cmmn-converter-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.engine.impl.parser.CmmnParserImpl.parse(CmmnParserImpl.java:89) ~[flowable-cmmn-engine-6.3.1.jar:6.3.1] 在

org.flowable.cmmn.engine.impl.parser.CmmnParserImpl.parse(CmmnParserImpl.java:67) ~[flowable-cmmn-engine-6.3.1.jar:6.3.1]

原因:org.xml.sax.SAXParseException:cvc-complex-type.2.4.d:发现以元素“extensionElements”开头的无效内容。此时不需要子元素。在 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(未知来源)~[xercesImpl-2.10.0.jar:?]

错误 19300 --- [nio-8090-exec-2] ofumsAppDefinitionPublishService:部署结果代码无效:HTTP/1.1 500

EDIT-2:我尝试逐步构建案例,并发现当向其中添加表单时,CasePlanModel 在保存时崩溃。此外,建模器和引擎在集成决策任务参考方面存在严重问题。

4

1 回答 1

0

您的定义标签的最后一个参数是错误的:

targetNamespace="http://www.flowable.org/casedef"

应该:

targetNamespace="http://www.flowable.org/processdef"
于 2019-04-04T11:47:04.980 回答