Showing posts with label BPMN2. Show all posts
Showing posts with label BPMN2. Show all posts

Friday, November 18, 2011

Executable BPMN 2.0

Bruce Silver did a blog recently, wondering whether any tools already exist that truly support executable BPMN 2.0. He defines supporting executable BPMN 2.0 as not just following the graphical notation guidelines (that are probably not that different from BPMN 1.x), but also supporting the underling XML serialization. And not just the basic high-level elements, but also the details that are necessary to come to executable processes, like process data, data mappings, service interfaces, etc.

I believe that jBPM satisfies these requirements!

As of jBPM 5.0, we are now using the BPMN 2.0 specification, not just for the visual representation, but also as the underlying XML serialization. And it's more than an import/export format, it is the representation that our tools use to communicate with each other (instead of using yet another proprietary model for that). This means that you can round-trip your processes between your developers (using the Eclipse-based editor integrated in their development environment) and your business users (using the web-based designer) based on the BPMN 2.0 XML.

And yes, unlike some other vendors, we're following the BPMN 2.0 specification as close as possible, and avoid using custom extensions (whenever not necessary). This for example means that we use BPMNDI for storing the diagram information (i.e. location and size of the nodes etc.), like this (click here to see the full process):
  <bpmndi:BPMNDiagram>
    <bpmndi:BPMNPlane bpmnElement="Minimal" >
      <bpmndi:BPMNShape bpmnElement="_1" >
        <dc:Bounds x="15" y="91" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2" >
        <dc:Bounds x="95" y="88" width="83" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_3" >
        <dc:Bounds x="258" y="86" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="_1-_2" >
        <di:waypoint x="39" y="115" />
        <di:waypoint x="75" y="46" />
        <di:waypoint x="136" y="112" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-_3" >
        <di:waypoint x="136" y="112" />
        <di:waypoint x="240" y="240" />
        <di:waypoint x="282" y="110" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

Process data and input/output mappings are also defined using the (sometimes rather verbose) ioSpecification (full example here):
  <ioSpecification>
    <dataInput id="_4_employeeIdInput" name="employeeId" />
    <inputSet>
      <dataInputRefs>_4_employeeIdInput</dataInputRefs>
    </inputSet>
    <outputSet>
    </outputSet>
  </ioSpecification>
  <dataInputAssociation>
    <sourceRef>employee</sourceRef>
    <targetRef>_4_employeeIdInput</targetRef>
  </dataInputAssociation>

Or, if you want to invoke a service (a Java service in this case), the service is modeled like this:
  <itemDefinition id="_2_InMessageType" structureRef="java.lang.String" />
  <message id="_2_InMessage" itemRef="_2_InMessageType" />
  <interface id="_2_ServiceInterface" name="org.jbpm.examples.junit.HelloService">
    <operation id="_2_ServiceOperation" name="hello">
      <inMessageRef>_2_InMessage</inMessageRef>
    </operation>
  </interface>
and to invoke the service (full example here):
  <serviceTask id="_2" name="Hello" operationRef="_2_ServiceOperation" implementation="Other" >
    <ioSpecification>
      <dataInput id="_2_param" name="Parameter" />
      <dataOutput id="_2_result" name="Result" />
      <inputSet>
        <dataInputRefs>_2_param</dataInputRefs>
      </inputSet>
      <outputSet>
        <dataOutputRefs>_2_result</dataOutputRefs>
      </outputSet>
    </ioSpecification>
    <dataInputAssociation>
      <sourceRef>s</sourceRef>
      <targetRef>_2_param</targetRef>
    </dataInputAssociation>
    <dataOutputAssociation>
      <sourceRef>_2_result</sourceRef>
      <targetRef>s</targetRef>
    </dataOutputAssociation>
  </serviceTask>

jBPM already supports a significant subset of nodes (and other elements) that you can use to model executable processes. To get an idea of what this looks like using BPMN 2.0 XML, simply browse through the examples module. A full list of supported elements and attributes (which is very similar to the Common Executable subclass, but extended with a few more elements) is added as part of the documentation here.

And finally, our new Eclipse-based editor is almost ready, and that supports the full BPMN 2.0 specification, and uses the BPMN 2.0 XML to store these process models. You can for example download the BPMN 2.0 examples (that are included as part of the specification) and open them up, as shown in this screencast.

So who says there's no tool that supports executable BPMN 2.0 ? :)

Friday, April 22, 2011

BPMN 2.0 data associations discussion

There's some discussion going on about some of the details in the BPMN 2.0 specification, more specifically the use of the process data input and process data outputs.

One of the issues of using an XSD to check the validity of an XML file (as the BPMN2 specification provides), is that the XSD does not express all the constraints that a process must fulfill to be valid. A lot of constraints are expressed in the narrative sections of the specification. That's why Bruce Silver is working on a profile for BPMN interoperability (BPMN-I) that could be used to check additional constraints, with the goal of achieving true interoperability between different vendors by making a lot of the "hidden" rules explicit.

During that work, Bruce (I hope he doesn't mind me calling him Bruce, maybe I should say Mr. Silver based on my appreciation for the work he has done and is still doing in this area ;)) discovered some discrepancies (or at least some confusing statements) in the specification itself when it comes to the use of process data inputs in relation to data input associations. I'm not going to try and explain the issue in detail, I would like to refer the readers that might be interested in the details to his blog and the followup blog, as it contains all the details, including numerous references to the spec itself and a discussion on the topic. But to make a long story short:

Can a process data input be used as the source of a data input association of task that is contained inside the process?

Since Bruce is asking for input from other interested parties, and jBPM is offering a BPMN 2.0 engine, I thought I'd give it a try. But since I couldn't find a way to put all this information and picture as a reply on his blog itself, I decided to write this blog entry and include my reply here (and to avoid splitting up the discussion I would suggest to add comments related to this topic on his blog as well). And at the same time I can invite other readers to give their 2 cents as well ;) So here it goes:

It seems to me, from reading the specification, that data input and output associations are meant to be "local", by which I mean they are not intended to be referenced from outside the element in which they are defined. On top of that, it also seems to me that they are intended to be "immediate" or "instantaneous" (not sure this is the best term but I couldn't come up with a better one at this point), meaning they are "executed" when they are reached, but they don't exist anymore after that.

Therefore, I would agree with your statement that process data inputs should not be the source of a data input association, as the process data input association only exists when the process is invoked and at that point, that data input association is executed. [I also believe that using a process data input when the process is actually started by a timer start event confusing, as it's unclear where this information would come from, but that's another issue.]

So how would you use your process data inputs in the remainder of your bpmn2 process then? I think the ioSpecification of the process, that contains these process data inputs, should also contain data output associations that map these data inputs to more persistent (as opposed to immediate or instantaneous) item-aware elements like a property or a data object. These can then serve as the source of other data input associations. So you don't directly use a process data input as the source of a data input association of (for example) a task, but you rather first map the process data input to a property using a data output association (as part of the process ioSpecification) and then use this property as the source of the data input association of the same task.

A screenshot of this in a real process is shown below (note that I deliberately chose a slightly different example to avoid using a start timer event in combination with a process data input as this makes it only more confusing):



You don't often come across people with such an in depth knowledge of how ioSpecifications in BPMN2 actually work, so I must admit I enjoyed reading the discussion so far ;)

Friday, March 4, 2011

New BPMN 2.0 Eclipse editor

We would like to show you our new and improved BPMN 2.0 Eclipse editor, which is currently being developed for jBPM 5.1 and will support a much larger part of the BPMN 2.0 specification (hopefully even including basic choreography and conversation).

For this, we've had a lot of help from the guys at Codehoop. They've been working on it for the last few months, and we believe it's currently at a stage where people can start to play it with and give us feedback.


(click on image to enlarge)

Features:
  • It supports almost all BPMN 2.0 process constructs and attributes (including lanes and pools, annotations and all the BPMN2 node types).
  • Support for the few custom attributes that jBPM5 introduces.
  • Allows you to configure which elements and attributes you want use when modeling processes (so we can limit the constructs for example to the subset currently supported by jBPM5, which is a profile we will support by default, or even more if you like).

Since it is still work in progress, there are still a few limitations or missing elements, but we should be able to clean it all up pretty soon, and include it as part of jBPM 5.1. But if you're looking for an open-source BPMN2 editor and might be interested in participating, let us know !

You can find the codebase here. We will be providing an easy-to-use update site for installation once we reach the final milestone, but if you already want to give it a go and build it from source:
  • Fetch the source and import the projects into Eclipse.
  • The project is reusing the Eclipse BPMN2 meta-model project for loading / saving BPMN 2.0 XML, so you will need to download and import the projects from the Eclipse BPMN2 repository (git://git.eclipse.org/gitroot/bpmn2) as well.
  • If you then run as Eclipse application, a new Eclipse environment should come up.
  • Create a new BPMN2 diagram by selecting File -> New -> Other and then select BPMN2 Diagram Wizard (under BPMN2 category).
There is also a Wiki page that contains some screenshots useful information.

Codehoop is a small agency building Eclipse toolkits and Java+Scala enterprise middleware. The team has been excited to work with Fortune 500 companies as well as small startups. The result is a great variety of expertise on Eclipse technologies, ranging from database management to code editors, visual modelling and vector-based animation studio.

Let us know what you think !

Monday, October 18, 2010

jBPM5 and BPMN 2.0

jBPM5 introduces a new language for representing process definitions based on the BPMN 2.0 specification, replacing older (proprietary) formats like jPDL or RuleFlow. Because not everyone might be familiar with this specification, let me give you some background. [The BPMN 2.0 specification has been finalized for some time now, but still needs to go through the final steps of the administrative process. Nevertheless, the contents of the specification seems to be stable and ready to be used.]

What is BPMN 2.0?
"The primary goal of BPMN is to provide a notation that is readily understandable by all business users, from the business analysts that create the initial drafts of the processes, to the technical developers responsible for implementing the technology that will perform those processes, and finally, to the business people who will manage and monitor those processes."
The second version of the Business Process Model and Notation specification (BPMN 2.0) by OMG not only defines a standard on how to graphically represent a business process (like BPMN 1.x), but now also includes execution semantics for the elements defined, and an XML format on how to store (and share) process definitions.

For example, a very simple process that would write out "Hello World" when it is started would look something like this (both visual and using XML):


<definitions ... >
 <process id="com.sample.bpmn.hello" name="Hello World">
   <startevent id="_1" name="StartProcess">
   <sequenceflow sourceref="_1" targetref="_2">
   <scripttask id="_2" name="Hello">
     <script>System.out.println("Hello World");</script>
   </scripttask>
   <sequenceflow sourceref="_2" targetref="_3">
   <endevent id="_3" name="EndProcess">
 </process>
</definitions>

The BPMN2 specification contains an explanation of how to represent executable business processes, both visually and syntactically, by combining a large set of different node types (and related elements). jBPM5 supports most of the "Common Executable" subset of the BPMN2 specification (containing the most common node types and attributes for specifying executable business processes) and already a few more node types. The documentation gives a detailed overview of which elements an attributes exactly.

To get started, the BPMN2 specification obviously serves as the reference, but additional to that, the jbpm-bpmn2 module contains a lot of junit tests for each of the currently supported node types. These test processes can also serve as simple examples: they don't really represent an entire real life business processes but can definitely be used to show how specific features can be used. For example, the following figures shows the flow chart of a few of those examples. The entire list can be found here.


Want to know more details, check out the BPMN2 chapter in the jBPM5 documentation.