2017-07-18 19 views
0

JavaとActivitiを使用して既存のワークフローを視覚化しようとしています。Activitiを使用してワークフローにメモを追加する方法

バックグラウンドで独自のワークフローエンジンを使用していますが、ワークフローデータを表形式で表示するだけなので、実際は不明です。このため、表のデータを標準のBPMN 2.0形式に変換する必要があります。したがって、パッケージorg.activiti.bpmn.modelが使用されます。さまざまなタスクはUserTaskクラスによって作成され、SequenceFlowは期待通りに生成され、レイアウトはActivitiの自動bpmnレイアウト機能によって設計されます。私の問題は、さまざまな前提条件とユーザータスクの持つ影響です。場合によっては、順序フローの名前として追加するにはテキストが多すぎることがあります。私の考えは、これらのものを含むStringを追加できるノードをユーザータスクに追加することだけでしたが、この問題を解決するオブジェクトを見つけられませんでした。私はMessageFlowオブジェクトと組み合わせてMessageオブジェクトを試しましたが、期待通りに動作しませんでした。

ワークフローの作成後、XMLファイルとして保存され、変換されたワークフローの見た目を確認するために、bpmn.io(XMLファイルがbpmnにアップロードされている場合は表示されないMessageオブジェクトを含む)にアップロードされます。 io):

<?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:xsd="http://www.w3.org/2001/XMLSchema" 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"> 
    <message id="message123" name="This is a test message" itemRef="ut5"></message> 
    <process id="process" name="New Prod" isExecutable="true"> 
    <startEvent id="startEvent" name="New Product"></startEvent> 
    <exclusiveGateway id="exclusiveGateway1"></exclusiveGateway> 
    <sequenceFlow id="sequenceFlow-672ba4b9-2f30-41b4-b638-bb05cde15cde" sourceRef="startEvent" targetRef="exclusiveGateway1"></sequenceFlow> 
    <userTask id="ut1" name="Workbox Musterprodukte"></userTask> 
    <sequenceFlow id="sequenceFlow-20c9fdf5-52f4-4c8c-9d30-9522b8cac16b" name="Check: mobile Category set" sourceRef="exclusiveGateway1" targetRef="ut1"></sequenceFlow> 
    <exclusiveGateway id="exclusiveGateway2"></exclusiveGateway> 
    <sequenceFlow id="sequenceFlow-0651ad02-735a-4311-bf3c-55bb6146e764" sourceRef="ut1" targetRef="exclusiveGateway2"></sequenceFlow> 
    <sequenceFlow id="sequenceFlow-039e61e4-6404-4fc8-b074-606ec2e0032a" name="Check: mobile Category NOT set" sourceRef="exclusiveGateway1" targetRef="exclusiveGateway2"></sequenceFlow> 
    <userTask id="ut2" name="Step1"></userTask> 
    <sequenceFlow id="sequenceFlow-833b5285-e302-4ab3-a0fc-b1442ec4909f" sourceRef="exclusiveGateway2" targetRef="ut2"></sequenceFlow> 
    <parallelGateway id="pg1"></parallelGateway> 
    <userTask id="ut3" name="Step2A"></userTask> 
    <userTask id="ut4" name="Step2B"></userTask> 
    <sequenceFlow id="sequenceFlow-b5f991a9-4d2c-4537-8ab2-7d5a6449cdf1" sourceRef="ut2" targetRef="pg1"></sequenceFlow> 
    <sequenceFlow id="sequenceFlow-7c12d9ea-c96f-4715-a8a5-39654053225a" name="Check: Main Image available" sourceRef="pg1" targetRef="ut3"></sequenceFlow> 
    <sequenceFlow id="sequenceFlow-19439ed1-2af5-43c4-8abf-df013fe24cdc" name="toom_Freigabe_CM = y" sourceRef="pg1" targetRef="ut4"></sequenceFlow> 
    <parallelGateway id="pg2"></parallelGateway> 
    <sequenceFlow id="sequenceFlow-faf33a66-a6db-4636-8ddf-d46484dbaa1e" sourceRef="ut3" targetRef="pg2"></sequenceFlow> 
    <sequenceFlow id="sequenceFlow-6180eea1-14e6-47c8-9e68-d6c3aed0b322" sourceRef="ut4" targetRef="pg2"></sequenceFlow> 
    <userTask id="ut5" name="Step3"></userTask> 
    <sequenceFlow id="sequenceFlow-efb2cef7-0b4a-410b-b076-19f0cf0a97ce" sourceRef="pg2" targetRef="ut5"></sequenceFlow> 
    <endEvent id="end" name="Step4"></endEvent> 
    <sequenceFlow id="sequenceFlow-7129e658-6004-4004-907b-f1ea6d5602a3" sourceRef="ut5" targetRef="end"></sequenceFlow> 
    </process> 
    <bpmndi:BPMNDiagram id="BPMNDiagram_process"> 
    <bpmndi:BPMNPlane bpmnElement="process" id="BPMNPlane_process"> 
     <bpmndi:BPMNShape bpmnElement="ut2" id="BPMNShape_ut2"> 
     <omgdc:Bounds height="60.0" width="100.0" x="410.0" y="73.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="ut1" id="BPMNShape_ut1"> 
     <omgdc:Bounds height="60.0" width="100.0" x="170.0" y="130.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="exclusiveGateway2" id="BPMNShape_exclusiveGateway2"> 
     <omgdc:Bounds height="40.0" width="40.0" x="320.0" y="78.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="exclusiveGateway1" id="BPMNShape_exclusiveGateway1"> 
     <omgdc:Bounds height="40.0" width="40.0" x="80.0" y="76.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="ut4" id="BPMNShape_ut4"> 
     <omgdc:Bounds height="60.0" width="100.0" x="650.0" y="160.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="ut3" id="BPMNShape_ut3"> 
     <omgdc:Bounds height="60.0" width="100.0" x="650.0" y="0.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent"> 
     <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="81.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="ut5" id="BPMNShape_ut5"> 
     <omgdc:Bounds height="60.0" width="100.0" x="890.0" y="80.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="pg2" id="BPMNShape_pg2"> 
     <omgdc:Bounds height="40.0" width="40.0" x="800.0" y="90.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end"> 
     <omgdc:Bounds height="30.0" width="30.0" x="1040.0" y="95.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNShape bpmnElement="pg1" id="BPMNShape_pg1"> 
     <omgdc:Bounds height="40.0" width="40.0" x="560.0" y="88.0"></omgdc:Bounds> 
     </bpmndi:BPMNShape> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-7129e658-6004-4004-907b-f1ea6d5602a3" id="BPMNEdge_sequenceFlow-7129e658-6004-4004-907b-f1ea6d5602a3"> 
     <omgdi:waypoint x="990.0" y="110.0"></omgdi:waypoint> 
     <omgdi:waypoint x="1040.0" y="110.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-efb2cef7-0b4a-410b-b076-19f0cf0a97ce" id="BPMNEdge_sequenceFlow-efb2cef7-0b4a-410b-b076-19f0cf0a97ce"> 
     <omgdi:waypoint x="840.0" y="110.0"></omgdi:waypoint> 
     <omgdi:waypoint x="890.0" y="110.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-672ba4b9-2f30-41b4-b638-bb05cde15cde" id="BPMNEdge_sequenceFlow-672ba4b9-2f30-41b4-b638-bb05cde15cde"> 
     <omgdi:waypoint x="30.0" y="96.0"></omgdi:waypoint> 
     <omgdi:waypoint x="80.0" y="96.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-039e61e4-6404-4fc8-b074-606ec2e0032a" id="BPMNEdge_sequenceFlow-039e61e4-6404-4fc8-b074-606ec2e0032a"> 
     <omgdi:waypoint x="120.0" y="88.5"></omgdi:waypoint> 
     <omgdi:waypoint x="132.0" y="88.5"></omgdi:waypoint> 
     <omgdi:waypoint x="132.0" y="98.0"></omgdi:waypoint> 
     <omgdi:waypoint x="320.0" y="98.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-833b5285-e302-4ab3-a0fc-b1442ec4909f" id="BPMNEdge_sequenceFlow-833b5285-e302-4ab3-a0fc-b1442ec4909f"> 
     <omgdi:waypoint x="360.0" y="98.0"></omgdi:waypoint> 
     <omgdi:waypoint x="372.0" y="98.0"></omgdi:waypoint> 
     <omgdi:waypoint x="372.0" y="103.0"></omgdi:waypoint> 
     <omgdi:waypoint x="410.0" y="103.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-6180eea1-14e6-47c8-9e68-d6c3aed0b322" id="BPMNEdge_sequenceFlow-6180eea1-14e6-47c8-9e68-d6c3aed0b322"> 
     <omgdi:waypoint x="750.0" y="190.0"></omgdi:waypoint> 
     <omgdi:waypoint x="762.0" y="190.0"></omgdi:waypoint> 
     <omgdi:waypoint x="762.0" y="110.0"></omgdi:waypoint> 
     <omgdi:waypoint x="800.0" y="110.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-0651ad02-735a-4311-bf3c-55bb6146e764" id="BPMNEdge_sequenceFlow-0651ad02-735a-4311-bf3c-55bb6146e764"> 
     <omgdi:waypoint x="270.0" y="160.0"></omgdi:waypoint> 
     <omgdi:waypoint x="282.0" y="160.0"></omgdi:waypoint> 
     <omgdi:waypoint x="282.0" y="98.0"></omgdi:waypoint> 
     <omgdi:waypoint x="320.0" y="98.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-b5f991a9-4d2c-4537-8ab2-7d5a6449cdf1" id="BPMNEdge_sequenceFlow-b5f991a9-4d2c-4537-8ab2-7d5a6449cdf1"> 
     <omgdi:waypoint x="510.0" y="103.0"></omgdi:waypoint> 
     <omgdi:waypoint x="522.0" y="103.0"></omgdi:waypoint> 
     <omgdi:waypoint x="522.0" y="108.0"></omgdi:waypoint> 
     <omgdi:waypoint x="560.0" y="108.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-faf33a66-a6db-4636-8ddf-d46484dbaa1e" id="BPMNEdge_sequenceFlow-faf33a66-a6db-4636-8ddf-d46484dbaa1e"> 
     <omgdi:waypoint x="750.0" y="30.0"></omgdi:waypoint> 
     <omgdi:waypoint x="762.0" y="30.0"></omgdi:waypoint> 
     <omgdi:waypoint x="762.0" y="110.0"></omgdi:waypoint> 
     <omgdi:waypoint x="800.0" y="110.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-7c12d9ea-c96f-4715-a8a5-39654053225a" id="BPMNEdge_sequenceFlow-7c12d9ea-c96f-4715-a8a5-39654053225a"> 
     <omgdi:waypoint x="600.0" y="100.5"></omgdi:waypoint> 
     <omgdi:waypoint x="612.0" y="100.5"></omgdi:waypoint> 
     <omgdi:waypoint x="612.0" y="30.000000000000007"></omgdi:waypoint> 
     <omgdi:waypoint x="650.0" y="30.000000000000007"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-20c9fdf5-52f4-4c8c-9d30-9522b8cac16b" id="BPMNEdge_sequenceFlow-20c9fdf5-52f4-4c8c-9d30-9522b8cac16b"> 
     <omgdi:waypoint x="120.0" y="103.5"></omgdi:waypoint> 
     <omgdi:waypoint x="132.0" y="103.5"></omgdi:waypoint> 
     <omgdi:waypoint x="132.0" y="160.0"></omgdi:waypoint> 
     <omgdi:waypoint x="170.0" y="160.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
     <bpmndi:BPMNEdge bpmnElement="sequenceFlow-19439ed1-2af5-43c4-8abf-df013fe24cdc" id="BPMNEdge_sequenceFlow-19439ed1-2af5-43c4-8abf-df013fe24cdc"> 
     <omgdi:waypoint x="600.0" y="115.5"></omgdi:waypoint> 
     <omgdi:waypoint x="612.0" y="115.5"></omgdi:waypoint> 
     <omgdi:waypoint x="612.0" y="190.0"></omgdi:waypoint> 
     <omgdi:waypoint x="650.0" y="190.0"></omgdi:waypoint> 
     </bpmndi:BPMNEdge> 
    </bpmndi:BPMNPlane> 
    </bpmndi:BPMNDiagram> 
</definitions> 

答えて

1

アクティビティまたはシーケンスフローでドキュメンテーションフィールドを使用しない理由を教えてください。

<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway1"> 
    <documentation>This is some element documentation.</documentation> 
</sequenceFlow> 

が続いBPMNエディタでは、ドキュメントのように表示されます。それは、このようなXMLで 。 本当に興味深いプロジェクトです。

グレッグ

+0

私はそれをそのように試みており、XMLの処理部は、説明を含むが、私はドキュメントとして設定されているテキストは、図には示されていません。 私はTextAnnotationを使用するのが最適なオブジェクトだと思います。しかし、私は同じ問題を抱えています。 addAtrifact()を介してTextAnnotationをプロセスインスタンスにアタッチします。しかし、レイアウトの情報を提供するXMLの下部には、そのオブジェクトに関する情報が含まれていないので、図にも表示されません。 – Sasa

+0

これでUserTaskをTextAnnotationにリンクするAssociationが必要であることがわかりましたが、BpmnAutoLayoutが実行されたときにNPEを取得します。失敗したメソッドはgenerateAssociationDiagramInterchangeElements()です。どうやらgetState(Edge)を実行するときに、このメソッドはnull値を受け取ります。 – Sasa