Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Create target UML Association with conditions
Create target UML Association with conditions [message #1852731] Thu, 02 June 2022 11:57 Go to next message
Ivy Tran is currently offline Ivy TranFriend
Messages: 2
Registered: June 2022
Junior Member
I'm new in ATL and I'm stucking in making rule to create target UML Association Dependency from BPMN SequenceFlow with conditions: only sequenceFlow between 2 tasks can generate target Dependency.
This is sample input
<bpmn2:startEvent id="StartEvent_1" name="Start">
<bpmn2:task id="Task_1" name="Task1">
<bpmn2:sequenceFlow id="SequenceFlow_1" sourceRef="StartEvent_1" targetRef="Task_1"/>
<bpmn2:task id="Task_2" name="Task2">
<bpmn2:task id="Task_3" name="Task3">
<bpmn2:sequenceFlow id="SequenceFlow_2" sourceRef="Task_2" targetRef="Task_3"/>

And this is expected output
<packagedElement xmi:type="uml:UseCase" xmi:id="_EN2dgODjEeyvxv2Cgy" name="Task2">
<packagedElement xmi:type="uml:UseCase" xmi:id="_2Ig6gODiEeyvxv2Cgy-ucw" name="Task3">
<packagedElement xmi:type="uml:Dependency" xmi:id="_o6utwOD" name="<<precedes>>" client="_EN2dgODjEeyvxv2Cgy" supplier="_2Ig6gODiEeyvxv2Cgy"/>

My current rule processes all SequenceFlow to target and I really don't know how to filter the source.
rule Dependency {
      from  s : BPMN!SequenceFlow
      to t : UML!Dependency (
             name <- '<<precedes>>
      )
}

How would I modify the rule or make the helpers or anything to filter that? Please help to guide me. Thanks in advance.
Re: Create target UML Association with conditions [message #1852753 is a reply to message #1852731] Thu, 02 June 2022 21:48 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

I don't know the metamodel for BPMN by hart, but the following should get you further:
rule Dependency {
  from
    s : BPMN!SequenceFlow (
      s.sourceRef.oclIsKindOf(BPMN!Task) and
      s.targetRef.oclIsKindOf(BPMN!Task)
    )
  to
    t : UML!Dependency (
      name <- '<<precedes>>',
      client <- thisModule.UseCase(s.sourceRef),
      supplier <- thisModule.UseCase(targetRef)
    )
}

unique lazy rule UseCase {
  from
    s : BPMN!Task
  to
    t : UML!UseCase (
      name <- s.name
    )
}


Cheers,
Dennis
Re: Create target UML Association with conditions [message #1852755 is a reply to message #1852753] Fri, 03 June 2022 04:26 Go to previous message
Ivy Tran is currently offline Ivy TranFriend
Messages: 2
Registered: June 2022
Junior Member
Hi Dennis Wagelaar,
Thank you so much for your help. It works like miracle.
Also, this kind of sample code makes me understand ATL logic more clearly than any other reading of documents and examples. I really appreciate your support.

[Updated on: Sat, 04 June 2022 05:52]

Report message to a moderator

Previous Topic:Strange error with the __xmiID__ field
Next Topic:Default value serialization in XMI
Goto Forum:
  


Current Time: Tue Apr 23 14:24:29 GMT 2024

Powered by FUDForum. Page generated in 0.03176 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top