Jump to: navigation, search

STP/IM Component/Transformation Approaches/From BPMN/Runtime Technology Based

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){
          ...
}

Transformation Outline

  1. The BPMN diagram version is read and a IM property is created with this version.
  2. "IM Iter Configuration" starts: the "im.iter" EAnnotation from the BPMN diagram is read and copied to the IM instance.
  3. The used runtimes are read from the BPMN diagram. This is done by reading the "technology" EAnnotation from every Pool. For each used runtime:
    1. Create ServiceBindings.
    2. Create Services and put them in a ServiceCollection.
  4. For each Pool:
    1. Create a Process.
    2. Copy BPMN process artifacts into IM process variables.
    3. For each Activity:
      1. Create a Step. If this Activity is a Subprocess, find inner activities and create more Steps.
    4. For each SequenceEdge:
      1. Create a Transition. If this SequenceEdge's Activity on the source side is a Subprocess, find inner SequenceEdges and create more Transitions.

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.

TravelReservation.jpg

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)