Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "STP/IM Component/Transformation Approaches/From BPMN/Runtime Technology Based"
(→Transformation Rules Sketch) |
m (STP/IM Component/BPMN To IM Transformation moved to STP/IM Component/Transformation Approaches/From BPMN/Runtime Technology Based) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
+ | ! Rule ID | ||
! From | ! From | ||
! To | ! To | ||
|- | |- | ||
+ | | R1 | ||
| BPMN!BpmnDiagram | | BPMN!BpmnDiagram | ||
− | | IM!StpIntermediateModel | + | | IM!StpIntermediateModel[IM!ProcessCollection, IM!ServiceCollection] |
|- | |- | ||
+ | | R2 | ||
| BPMN!BpmnDiagram.getEAnnotation(IM_VERSION_ANNOTATION) | | BPMN!BpmnDiagram.getEAnnotation(IM_VERSION_ANNOTATION) | ||
| IM!BasicProperty[ITER_VERSION] | | IM!BasicProperty[ITER_VERSION] | ||
+ | |||
|- | |- | ||
+ | | R3 | ||
| BPMN!BpmnDiagram.getEAnnotation(IM_ITER_ANNOTATION) | | BPMN!BpmnDiagram.getEAnnotation(IM_ITER_ANNOTATION) | ||
− | | IM!BasicProperty[IM_ITER_NAME] | + | | IM!BasicProperty[IM_ITER_NAME] |
IM!BasicProperty[IM_ITER_FIRST_PROCESS_NAME] | IM!BasicProperty[IM_ITER_FIRST_PROCESS_NAME] | ||
+ | |||
IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION] | IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION] | ||
+ | |||
IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION_LANGUAGE] | IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION_LANGUAGE] | ||
+ | |||
IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_LIST_SIZE] | IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_LIST_SIZE] | ||
+ | |||
IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_MAP] | IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_MAP] | ||
− | + | ||
+ | Collection{IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_ID]} | ||
+ | |||
+ | |- | ||
+ | | R4 | ||
+ | | BPMN!Pool.getEAnnotation(TECHNOLOGY_ANNOTATION); | ||
+ | | map serviceBindingsMap := Collection{IM!ServiceBinding} | ||
+ | Collection{IM!Service[bindings := serviceBindingsMap]} | ||
+ | |- | ||
+ | | R5 | ||
+ | | BPMN!Pool | ||
+ | | IM!Process[properties += IM!BasicProperty[PROCESS_VERSION]] | ||
+ | |- | ||
+ | | R6 | ||
+ | | BPMN!Artifact | ||
+ | | IM!Variable | ||
+ | |- | ||
+ | | R7 | ||
+ | | BPMN!Vertex | ||
+ | | IM!Step | ||
+ | |- | ||
+ | | R8 | ||
+ | | BPMN!SequenceEdge | ||
+ | | IM!Transition | ||
+ | |- | ||
+ | | R9 | ||
+ | | BPMN!Subprocess | ||
+ | | Collection{IM!Step} | ||
+ | Collection{IM!Transition} | ||
|} | |} | ||
+ | ==Usage in the Sample Scenario== | ||
+ | This is the BPMN model of the [[STP/IM Component/Sample scenario involving the intermediate meta-model|STP-IM sample scenario]]. | ||
+ | |||
+ | [[Image:TravelReservation.jpg]] | ||
+ | After you invoke the "Export BPMN to Intermediate Model" action, a dialog pops up asking for each <code>Pool</code>'s technology. However, it isn't required and you can just click OK. By doing this, you get the following IM instance as output: | ||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0" encoding="ASCII"?> | ||
+ | <im:StpIntermediateModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:im="http://eclipse.org/stp/im"> | ||
+ | <properties key="im.iter.version"> | ||
+ | <value xsi:type="im:BasicProperty" key="im.iter.version" value="0"/> | ||
+ | </properties> | ||
+ | <processCollection> | ||
+ | <processes name="Travel Reservation"> | ||
+ | <properties key="im.process.version"> | ||
+ | <value xsi:type="im:BasicProperty" key="im.process.version" value="0"/> | ||
+ | </properties> | ||
+ | <steps name="Book_Hotel" description=" Description for Book Hotel" sourceTransitions="//@processCollection/@processes.0/@transitions.1" targetTransitions="//@processCollection/@processes.0/@transitions.0"/> | ||
+ | <steps name="Start1" description=" Description for Start1" sourceTransitions="//@processCollection/@processes.0/@transitions.0"/> | ||
+ | <steps name="Get_Forecast" description=" Description for Get Forecast" sourceTransitions="//@processCollection/@processes.0/@transitions.2" targetTransitions="//@processCollection/@processes.0/@transitions.1"/> | ||
+ | <steps name="Send_Email_Summary" description=" Description for Send Email Summary" sourceTransitions="//@processCollection/@processes.0/@transitions.3" targetTransitions="//@processCollection/@processes.0/@transitions.2"/> | ||
+ | <steps name="End1" description=" Description for End1" targetTransitions="//@processCollection/@processes.0/@transitions.3"/> | ||
+ | <transitions source="//@processCollection/@processes.0/@steps.1" target="//@processCollection/@processes.0/@steps.0"/> | ||
+ | <transitions source="//@processCollection/@processes.0/@steps.0" target="//@processCollection/@processes.0/@steps.2"/> | ||
+ | <transitions source="//@processCollection/@processes.0/@steps.2" target="//@processCollection/@processes.0/@steps.3"/> | ||
+ | <transitions source="//@processCollection/@processes.0/@steps.3" target="//@processCollection/@processes.0/@steps.4"/> | ||
+ | </processes> | ||
+ | </processCollection> | ||
+ | <serviceCollection/> | ||
+ | </im:StpIntermediateModel> | ||
+ | </source> | ||
==Comments== | ==Comments== | ||
+ | Apparently, the R4 rule has been created to add the technology information for later transformations (IM>BPEL and IM>JBI). However, I think these concepts aren't required for a pure IM instance representing this process, so maybe this dialog shouldn't come up everytime the transformation action is invoked. Other than that, the current output looks perfectly clean. [[User:Juanjosecg.gmail.com|Juanjosecg.gmail.com]] 22:44, 11 May 2008 (EDT) |
Latest revision as of 02:50, 29 May 2008
This transformation can be found in the class org.eclipse.stp.im.in.bpmn2im.Bpmn2ImWorkspaceOperation
under the method with the following signature:
public StpIntermediateModel createIntermediateModelFromBpmn(BpmnDiagram bpmnDiagram, List<String> selectedPools, IProgressMonitor monitor){ ... }
Contents
Transformation Outline
- The BPMN diagram version is read and a IM property is created with this version.
- "IM Iter Configuration" starts: the "im.iter" EAnnotation from the BPMN diagram is read and copied to the IM instance.
- The used runtimes are read from the BPMN diagram. This is done by reading the "technology" EAnnotation from every
Pool
. For each used runtime:- Create
ServiceBinding
s. - Create
Service
s and put them in aServiceCollection
.
- Create
- For each
Pool
:- Create a
Process
. - Copy BPMN process artifacts into IM process variables.
- For each
Activity
:- Create a
Step
. If thisActivity
is aSubprocess
, find inner activities and create moreStep
s.
- Create a
- For each
SequenceEdge
:- Create a
Transition
. If thisSequenceEdge
'sActivity
on the source side is aSubprocess
, find innerSequenceEdge
s and create moreTransition
s.
- Create a
- Create a
Transformation Rules Sketch
Rule ID | From | To |
---|---|---|
R1 | BPMN!BpmnDiagram | IM!StpIntermediateModel[IM!ProcessCollection, IM!ServiceCollection] |
R2 | BPMN!BpmnDiagram.getEAnnotation(IM_VERSION_ANNOTATION) | IM!BasicProperty[ITER_VERSION] |
R3 | BPMN!BpmnDiagram.getEAnnotation(IM_ITER_ANNOTATION) | IM!BasicProperty[IM_ITER_NAME]
IM!BasicProperty[IM_ITER_FIRST_PROCESS_NAME] IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION] IM!BasicProperty[IM_ITER_RULE_FOR_DETERMINATION_LANGUAGE] IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_LIST_SIZE] IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_MAP] Collection{IM!BasicProperty[IM_ITER_OBSERVABLE_ATTRIBUTE_ID]} |
R4 | BPMN!Pool.getEAnnotation(TECHNOLOGY_ANNOTATION); | map serviceBindingsMap := Collection{IM!ServiceBinding}
Collection{IM!Service[bindings := serviceBindingsMap]} |
R5 | BPMN!Pool | IM!Process[properties += IM!BasicProperty[PROCESS_VERSION]] |
R6 | BPMN!Artifact | IM!Variable |
R7 | BPMN!Vertex | IM!Step |
R8 | BPMN!SequenceEdge | IM!Transition |
R9 | BPMN!Subprocess | Collection{IM!Step}
Collection{IM!Transition} |
Usage in the Sample Scenario
This is the BPMN model of the STP-IM sample scenario.
After you invoke the "Export BPMN to Intermediate Model" action, a dialog pops up asking for each Pool
's technology. However, it isn't required and you can just click OK. By doing this, you get the following IM instance as output:
<?xml version="1.0" encoding="ASCII"?> <im:StpIntermediateModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:im="http://eclipse.org/stp/im"> <properties key="im.iter.version"> <value xsi:type="im:BasicProperty" key="im.iter.version" value="0"/> </properties> <processCollection> <processes name="Travel Reservation"> <properties key="im.process.version"> <value xsi:type="im:BasicProperty" key="im.process.version" value="0"/> </properties> <steps name="Book_Hotel" description=" Description for Book Hotel" sourceTransitions="//@processCollection/@processes.0/@transitions.1" targetTransitions="//@processCollection/@processes.0/@transitions.0"/> <steps name="Start1" description=" Description for Start1" sourceTransitions="//@processCollection/@processes.0/@transitions.0"/> <steps name="Get_Forecast" description=" Description for Get Forecast" sourceTransitions="//@processCollection/@processes.0/@transitions.2" targetTransitions="//@processCollection/@processes.0/@transitions.1"/> <steps name="Send_Email_Summary" description=" Description for Send Email Summary" sourceTransitions="//@processCollection/@processes.0/@transitions.3" targetTransitions="//@processCollection/@processes.0/@transitions.2"/> <steps name="End1" description=" Description for End1" targetTransitions="//@processCollection/@processes.0/@transitions.3"/> <transitions source="//@processCollection/@processes.0/@steps.1" target="//@processCollection/@processes.0/@steps.0"/> <transitions source="//@processCollection/@processes.0/@steps.0" target="//@processCollection/@processes.0/@steps.2"/> <transitions source="//@processCollection/@processes.0/@steps.2" target="//@processCollection/@processes.0/@steps.3"/> <transitions source="//@processCollection/@processes.0/@steps.3" target="//@processCollection/@processes.0/@steps.4"/> </processes> </processCollection> <serviceCollection/> </im:StpIntermediateModel>
Comments
Apparently, the R4 rule has been created to add the technology information for later transformations (IM>BPEL and IM>JBI). However, I think these concepts aren't required for a pure IM instance representing this process, so maybe this dialog shouldn't come up everytime the transformation action is invoked. Other than that, the current output looks perfectly clean. Juanjosecg.gmail.com 22:44, 11 May 2008 (EDT)