Skip to content

Message flows arrows generation bug  #2

@sgupta1007

Description

@sgupta1007

Message flows arrows are not being correctly generated between empty and non-empty process.

Expected behavior
bpmn_bug5

** Original Behavior **
bpmn_bug4

To Reproduce

  1. I have placed the code below to generate the Original Behavior Diagram
  2. I have purposely commented the message flow lines. Uncommenting them leads to compiling error.
Code:
from` bpmn_tools.flow import Process, Flow, Lane,LaneSet
from bpmn_tools.flow import End,Start, ScriptTask, SendTask,Task,ExclusiveGateway,IntermediateCatch,IntermediateThrow,BoundaryEvent, MessageEventDefinition
from bpmn_tools.collaboration import Collaboration, Participant
from bpmn_tools.notation import Definitions
from bpmn_tools.diagrams import Diagram, Plane
from bpmn_tools.layout import simple
from bpmn_tools.util import model2xml

#creating activities gateways 
a=SendTask('A')
b=ScriptTask('B')
decision=ExclusiveGateway("Decision")
decision2=ExclusiveGateway("Decision2")
decision3=ExclusiveGateway("Decision3")
c=SendTask('C')
d=Task('D')
e=Task('E') 
f=End('F')
g=Task('G')
h=Task('H')
i=End('I')



#creating events
message1=MessageEventDefinition(id="message1")
message2=MessageEventDefinition(id="message2")
message3=MessageEventDefinition(id="message3")

a1=Start(id="event1",definition=message1,name="a1")
a2=IntermediateThrow(id="event2",definition=message2,name="a2")
a3=IntermediateThrow(id="event3",definition=message3,name="a3")

#creating lanes 
lane1=Lane('Department 1')
lane2=Lane('Department 2')



#appending activities gateways and events to the lanes
lane1.append(a1).append(a).append(c).append(d).append(e).append(decision2).append(h).append(g).append(a3).append(i)
lane2.append(b).append(decision).append(a2).append(decision3).append(f)


#creating edges
flow0=Flow(source=a1,target=a)
flow1=Flow(source=a,target=b)
flow2=Flow(source=b,target=decision)
flow3=Flow(source=decision,target=c,name='Yes')
flow4=Flow(source=decision,target=a2,name='No')
flow5=Flow(source=c,target=d)
flow6=Flow(source=d,target=e)
flow7=Flow(source=e,target=decision2)
flow8=Flow(source=decision2,target=g,name='Yes')
flow9=Flow(source=decision2,target=h,name='No')
flow10=Flow(source=g,target=a3)
flow11=Flow(source=decision3,target=f)
flow12=Flow(source=h,target=decision3)

#intermediate events flow
flow13=Flow(source=a2,target=decision3)
flow14=Flow(source=a3,target=i)

#appending lanes flows and activities to the process
process1=Process().append(lane1).append(lane2).append(flow0).append(flow1).append(flow2).append(flow3).append(flow4).append(flow5).append(flow6).append(flow7).append(flow8).append(flow9).append(flow10).append(flow11).append(flow12).append(flow13).append(flow14)
process2=Process()

collaboration=Collaboration(id='Colaboration').extend([
    Participant('Corporation ',process1,id="p1"),
    Participant('External StakeHolder',process2,id="p2")
    
     #,MessageFlow(source=process2, target=a1),
     #MessageFlow(source=d, target=process2),
     #MessageFlow(source=a2, target=process2)
  ])





definitions = Definitions(id="definitions").extend([
    process1,
    collaboration,
  ])

definitions.append(
    Diagram( id="diagram", plane=Plane(id="plane", element=collaboration) )
  )

simple.layout(definitions)
print(model2xml(definitions))`



Metadata

Metadata

Assignees

Labels

missing featureA feature isn't available, e.g. a specific BPMN tag can't be constructed.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions