<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BPM-Guide.de &#187; jBPM</title>
	<atom:link href="http://www.bpm-guide.de/tag/jbpm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bpm-guide.de</link>
	<description>It's Business Process Management</description>
	<lastBuildDate>Wed, 08 Feb 2012 20:22:18 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Successful Process Automation with Open Source and BPMN</title>
		<link>http://www.bpm-guide.de/2011/03/09/11-internet-ag-erfolgreiche-prozessautomatisierung-mit-open-source-und-bpmn/</link>
		<comments>http://www.bpm-guide.de/2011/03/09/11-internet-ag-erfolgreiche-prozessautomatisierung-mit-open-source-und-bpmn/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 13:15:28 +0000</pubDate>
		<dc:creator>Jakob Freund</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[BPMN]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[success story]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=2386</guid>
		<description><![CDATA[It took a while, but now we also have one of those fancy &#8220;success stories&#8221;. Until now, we just did not have the time for such kind of things. But now it&#8217;s done, and if you want to, you can learn about a BPM-project we realized in 2010 for the German 1&#038;1 Internet AG (Big [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bpm-guide.de/wp-content/uploads/2011/03/11-logo-150x150.jpg" alt="" title="1&amp;1-logo" width="150" height="150" class="alignleft size-thumbnail wp-image-2388 colorbox-2386" /></p>
<p>It took a while, but now we also have one of those fancy &#8220;success stories&#8221;. Until now, we just did not have the time for such kind of things. But now it&#8217;s done, and if you want to, you can learn about a BPM-project we realized in 2010 for the German 1&#038;1 Internet AG (Big Telco Provider). This project was about automating a core process with the open source process engine JBoss jBPM, including process modeling in BPMN, so I hope it&#8217;s interesting for you. </p>
<p><a href="http://www.camunda.com/references/1&#038;1_en.pdf">Download as PDF</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2011/03/09/11-internet-ag-erfolgreiche-prozessautomatisierung-mit-open-source-und-bpmn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Service Invocation and asynchronous response correlation made lightweight</title>
		<link>http://www.bpm-guide.de/2010/12/29/service-invocation-and-asynchronous-response-correlation-made-lightweight/</link>
		<comments>http://www.bpm-guide.de/2010/12/29/service-invocation-and-asynchronous-response-correlation-made-lightweight/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 18:11:37 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=2097</guid>
		<description><![CDATA[As a Christmas present we got an assignment for developing a framework, which handles service invocation from processes including correlation support for asynchronous responses. And the best: We can open source it, so it will be available for everybody! Kudos to the customer (hopefully I am allowed to name them soon). In this post I [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_2100" class="wp-caption alignleft" style="width: 160px"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/iStock_000002804033Small-150x100.jpg" alt=" " title=" " width="150" height="100" class="size-thumbnail wp-image-2100 colorbox-2097" /><p class="wp-caption-text"> </p></div><br />
As a Christmas present we got an assignment for developing a framework, which handles service invocation from processes including correlation support for asynchronous responses. And the best: We can open source it, so it will be available for everybody! Kudos to the customer (hopefully I am allowed to name them soon). In this post I will write a bit about the scope, the tackled problems and the targeted solution. An interesting side information: The framework will be able to work with different Process Engines. At the customer it is jBPM 3, but we plan to do a Proof of Concept with Activiti as well.<br />
<span id="more-2097"></span><br />
In this post I want to give a very easy example of a mini business process: Procurement of material. As you can see in the following BPMN the order is created by a Human, send electronically to the Supplier afterwards and then printed and archived (I needed a manual step here <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2097' /> ). After archiving them we wait for the order confirmation of the Supplier and insert the order (maybe including the scheduled delivery date) into our ERP system automatically. Here you can see the BPMN of that process:</p>
<p><script type="text/javascript" src="https://editor.signavio.com/mashup/signavio.js"></script><br />
<script type="text/plain">
{
    url: "https://editor.signavio.com/p/model/25468d43302e4c9083a21c47218c2d7e",
    authToken: "5c465c8bb2c1456ea9b3cf37114e399db4299ead56a5620a370eefe9d7bea_90cb1fd3ca12ee9f3fcdceb232cd37adc41cab899e729f193c45d8933627f_fe61f05ca730e1271cecc69b468e6527dadd14b0e7393dc4f6a87496fdca3436",
    overflowX: "fit",
    overflowY: "fit",
    zoomSlider: true,
    linkSubProcesses: false
}
</script></p>
<p>The first problem we face: How can we communicate with the supplier and our SAP system? Or in other words: How can we do the Service Invocation? In my <a href="http://www.bpm-guide.de/2010/12/09/how-to-call-a-webservice-from-bpmn/">post about WebServices within BPMN</a> I already wrote about WebServices being the standard way in BPMN, but often not the best or easiest. Let&#8217;s assume in our example the communication with the supplier is done via JMS and the ERP system is developed in Java EE and offers an EJB interface. If we want to use WebServices, we would have to provide a WebService facade to these technologies. Actually I am not a big fan of that. It adds much work and complexity. So we want a more Java based solution&#8230;</p>
<p>A second problem we need to solve in that easy example already is correlation. When we get the answer from the supplier, we have to find the right process instance, where the answer belongs to. The BPMN standard defines two correlation approaches:</p>
<ul>
<li><strong>Correlation Key:</strong> A generated key without any business meaning is created for a conversation and added to all messages. This key must be present in the response as well, so it can be easily correlated. This is actually the best and safest way of correlation, since the keys are very unique. The problem typically is, that you have to deal with interfaces not being capable of handling correlation keys, hence the response will not contain that key any more. This is why there is a need for the other approach:</li>
<li><strong>Context-based Correlation:</strong> The response is correlated based on payload data in the response, typically business keys. In our case that could be an order reference number or the like. This is pretty handy and works even with legacy services not being capable of handling correlation keys, but is not always unique. Think of situations where you have parallel process paths both sending an order for the same reference number.</li>
</ul>
<p>Normally you use a combination of both, depending on the capabilities of the service you want to call. But there is a small detail really interesting in that story: In our process printing and archiving the order can take a while (maybe the accountant is on holiday drinking cocktails in the Caribbean), so the response from our supplier may arrive, before the process is in the correct state. What happens to the response? Shall it be thrown away or shall it be saved until the process instance is ready? If it is saved (queued), what if no process instance ever handles that response? These are really interesting questions, and the BPMN spec doesn&#8217;t cover them at all. This means, it is product or project specific. And how is it handled there?</p>
<p>Actually that was a funny small research task. I asked some of my contacts (consultants, vendors and end-users) about what they think of it, how their software does it, how they solved it or if they know an open source framework doing it. And the answers were somehow disillusioning (I freely translate and summarize them):</p>
<ul>
<li>For jBPM we definitely do not know an open source solution. It would be nice to have a more powerful solution in a seperate open source project!</li>
<li>Neither the BPEL nor the BPMN spec demand to save/queue messages.</li>
<li>The workaround in our BPEL projects is to design processes in a way, that they always wait for a pick (where the response is received) in parallel.</li>
<li>JMS and WS callbacks are pretty common, but inside an open source ESB I haven&#8217;t seen a lot good solutions (I&#8217;d better say none <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2097' /> ).</li>
<li>For some OSS ESB: Sadly, the integration doesn&#8217;t allow it yet.</li>
<li>If you have existing legacy systems, it always gets ugly.</li>
<li>&#8230;</li>
</ul>
<p>After a lot of mails and some discussions I came to the conclusion, that some single vendors seem to have solved that problem somehow behind closed doors, but despite that, it is still unsolved or solved in very project specific ways. And changing the process models is not an option as well, if we take the Business-IT-Alignment story serious. Especially disappointing was, that the ESB (Enterprise Service Bus) projects or products weren&#8217;t really helpful here. In earlier days I was naive enough to think, that this is why ESBs were invented in the first place <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2097' />  And not even the JBoss ESB as being hand in hand with jBPM in the JBoss SOA platform has a powerful answer (it is more like a very basic start). But I am not a big fan of ESBs anyway for reasons I mentioned in my WebService blog already. Basically I think they are too complicated and heavyweight, and very often you only need small parts of them to solve punctual problems. And as we can see, the really complicated problems aren&#8217;t solved anyway <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2097' /> </p>
<p>Hence, the conclusion was to go for an own lightweight framework, but provide it open source. It is not about Messaging, Message routing, <a href="http://www.eaipatterns.com/">Enterprise Integration Patterns</a> or other stuff ESBs or framework like Spring Integration provide. It&#8217;s &#8220;just&#8221; about calling services from your process engine and processing the responses. And &#8220;just&#8221; solving the problems for this problem, not more. And remember: We want to do that in a lightweight way in Java, easy understandable for Java people.</p>
<p>And just to give you an impression of the scope for correlation, these are examples of Patterns in BPMN, which should be supported by such a framework:</p>
<ul>
<li>Handling multiple responses in an unknown order</li>
<li>Saving responses if the process isn&#8217;t yet in the correct state</li>
<li>Handling event based gateways, were we wait for one of multiple possible responses</li>
<li>&#8230;</li>
</ul>
<p>Or the different correlation patterns visualized as BPMN:</p>
<p><script type="text/javascript" src="https://editor.signavio.com/mashup/signavio.js"></script><br />
<script type="text/plain">
{
    url: "https://editor.signavio.com/p/model/26a6c43f93484439a12faf57b2f8bd75",
    authToken: "7d84a15775a15387e197f378c3248eb45f56f1e0e39ac7acc4e6a27d45efb_6e7ddc8b8ab3a4a995ad1af7a6abfab7eca19b99e6b1094c97bb4fcae28dfd_549f67e5543b22d0115150c8b4cc5444978bcefb6498d39421834ae6d53fa788",
    overflowX: "fit",
    overflowY: "fit",
    zoomSlider: true,
    linkSubProcesses: false
}
</script></p>
<p><strong>Additional Requirements</strong></p>
<p>Beside the correlation problems we face two other requirements in that project, or let&#8217;s say goals we try to achieve with it: </p>
<ul>
<li><strong>Being Process Engine Independent:</strong> The whole solution shall not be tied to any specific Process Engine and should make as less assumptions about the environment as possible. Currently in the customers environment the JBoss SOA Platform with jBPM 3 is used, but for how long? Maybe it will be migrated to Activiti in future (see <a href="http://www.bpm-guide.de/2010/12/24/using-bpmn-2-0-models-with-jbpm-3-a-migration-path-and-more/">Using BPMN 2.0 Models with jBPM 3 – A migration path and more</a> for some ideas on a migration path).</li>
<li><strong>Productivity for Java People:</strong> At this customer (and actually in the most projects I see today) they have a lot of smart Java people but much less WebService or XSLT know how. Hence, the developers are most productive, if they can work in their known Java environment. This is why we tried to work with Java interfaces and Data Transformation being written in Java instead of using XSLT. This eliminates the need for additional tooling as well (and there is still no good open source XSLT Tooling available), you just need your IDE and code completion.</li>
</ul>
<p><strong>Solution: camunda fox PSI</strong></p>
<p><div id="attachment_2114" class="wp-caption alignleft" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/12/PsiComponents1.png"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/PsiComponents1-150x90.png" alt="PSI Building Blocks" title="PSI Building Blocks" width="150" height="90" class="size-thumbnail wp-image-2114 colorbox-2097" /></a><p class="wp-caption-text">PSI Building Blocks</p></div>  After some discussions we named the Open Source component PSI &#8211; the Process Service Invocation Framework (unfortunately Babelfox was already taken <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2097' /> ). The image on the left shows the big building blocks of PSI on a very high level. An important component are the so called <strong>Service Adapters</strong>. The idea is to write the code required for data transformation in simple Java classes independent of the concrete process engine. For the service you use a Java Interface. The Adapter can be easily written and tested with pure Unit testing. Here a quick example of how ServiceAdapter currently look like from <a href="http://fox.camunda.com/doc/#connectivity">the camunda fox docs</a> (but it is still subject to change):</p>
<pre>
public class StoreOrderServiceAdapter implements ServiceRequestAdapter, ServiceResponseAdapter<Order> {
  @DataObject
  private OrderDataObject order;
  @Service
  private OrderService orderService;
  @Override
  public void callService() throws Exception {
    orderService.storeOrder(order.getValue());
  }
  @Override
  public void processResponse(Order response) throws Exception {
    // lets assume the EJB call returns a Order object with filled order id or the like as response
    order.setValue(response);
  }
}
</pre>
<p>To hook them into your Process Engine environment there is the <strong>PSI Coordinator</strong>. It can be called from your processes (by small binding components providing jBPM Action Handlers or Activiti Delegates) and fulfills the following tasks:</p>
<ul>
<li>Retrieve <strong>process variables</strong> from the engine and inject them into the Service Adapter</li>
<li>Writing changes to the variables after the response has arrived</li>
<li><strong>Lookup Service Coordinates</strong> from a registry (the registry itself is pluggable)</li>
<li><strong>Steering the correlation service</strong> for correlation support, e.g. storing correlation keys or register for responses</li>
<li><strong>Dispatching the service call to the concrete technology</strong> like EJB or JMS (which is maybe determined by the answer from the Registry)</li>
<li><strong>Handling responses</strong> and translate incoming events to the Process Engine by using the API from <a href="http://fox.camunda.com/peal-psi/">PEAL (the Process Engine Abstraction Layer)</a></li>
</ul>
<p>Maybe you wonder, how we can use Java Interfaces if we talk about JMS communication? Good questions <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2097' />  The plan is to include the <a href="https://messageapi.dev.java.net/">Message API</a>, which can easily add Java Interfaces to JMS communication and even hide all the JMS hassle. I hope to give you concrete code examples soon.</p>
<p>As a last remark: There are even some more thoughts what the coordinator should do. At the current customer there is an own mechanism in place to handle failures of service calls. If these are technical errors (like the network is down) there is an own retry mechanism (in this case leveraging the jBPM jobs). So this is part of the solution as well, but I don&#8217;t want to bore you with all the details at once&#8230;</p>
<p><strong>Roadmap</strong></p>
<p>At the moment of writing this blog we already have more than just the rough picture I added here. We already have parts of the solution, but it was built too tightly coupled in the JBoss ESB and is not easily extensible. We already have more detailed architecture pictures, some pseudo-code and interfaces. So I am pretty confident, that we can make quick progress next year. The current project plan says, we should be finished at the end of march. So fingers crossed <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2097' /> </p>
<p><strong>And where can I find this Open Source project?</strong></p>
<p>PSI (The Process Service Invocation Framework) is part of <a href="http://fox.camunda.com/">camunda fox</a>. On the homepage you can find a link to the documentation as well as to the sources (but actually we haven&#8217;t yet committed anything, since till now all the package names are still customer specific and we have to change that first. We plan to move that from our internal SVN repository to the public fox repository as soon as possible).</p>
<p>Last but not least it would be (like always) hear your thoughts about it. So give me feedback! If you are interested in using PSI in your projects and maybe even want to participate in the development now (meaning you are maybe able to influence the development), don&#8217;t hesitate to <a href="mailto:bernd.ruecker@camunda.com">drop me an email</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2010/12/29/service-invocation-and-asynchronous-response-correlation-made-lightweight/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using BPMN 2.0 Models with jBPM 3 &#8211; A migration path and more</title>
		<link>http://www.bpm-guide.de/2010/12/24/using-bpmn-2-0-models-with-jbpm-3-a-migration-path-and-more/</link>
		<comments>http://www.bpm-guide.de/2010/12/24/using-bpmn-2-0-models-with-jbpm-3-a-migration-path-and-more/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 10:40:42 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Activiti]]></category>
		<category><![CDATA[BPMN]]></category>
		<category><![CDATA[jBPM]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=2090</guid>
		<description><![CDATA[If you are using JBoss jBPM 3 in your current process automation projects you may face the problem, that some stakeholder (business, analysts, customers, marketing, &#8230;) ask for BPMN process models. And they often do for a good reason. But how do you get to that world? Do you have to throw away the jBPM [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingPresent-150x115.png" alt=" " title=" " width="150" height="115" class="alignleft size-thumbnail wp-image-2082 colorbox-2090" /><br />
If you are using JBoss jBPM 3 in your current process automation projects you may face the problem, that some stakeholder (business, analysts, customers, marketing, &#8230;) ask for BPMN process models. And they often do for a good reason. But how do you get to that world? Do you have to throw away the jBPM 3 engine and start using a BPMN 2.0 Engine like Activiti? If yes, how could a migration path could look like?</p>
<p>But there are good news: Your are not the only one having this problem <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' />  Hence we already worked out strategies with some of our customers. One is to keep the jBPM 3 engine (at least for some time), but use BPMN 2.0 models anyway. Therefore we wrote a complete transformation and graphical tooling around it. And just in time for Christmas we open source it <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' />  And together with some other ideas this leads you towards a step by step migration strategy, so read on&#8230;<br />
<span id="more-2090"></span></p>
<p><strong>jBPM Process Definition Language</strong></p>
<p>Just to bring everybody on the same page: The problem is, that JBoss jBPM 3 &#8211; a proven and pretty stable Open Source process engine we do projects with for around 7 years now &#8211; uses a proprietary XML language called jPDL. That wasn&#8217;t a problem when jBPM started, because at this time no fitting standard was available (only XPDL which was very weak and BPEL which just emerged and didn&#8217;t fit for reasons I want to skip here). But nowadays BPMN 2.0 is the accepted standard, so there is a demand for BPMN process models, at least if you want to gain transparency by modeling your processes. This is not only about nice pictures, it is about being able to use BPMN the right way, e.g. like we describe in our <a href=" http://www.bpm-guide.de/bpmn">BPMN framework</a>. And additionally, jBPM 3 is in maintenance mode, meaning it is not actively developed any further, so sooner or later you will be asked about a possible migration path.</p>
<p><strong>How to get from jPDL (jBPM3) to BPMN 2.0?</strong> </p>
<p>The first thing everybody asks: Can I somehow import my jPDL processes into BPMN? Good question! Currently a XSLT-Transformation (jPDL -> BPMN 2.0) is developed by JBoss itself, but I am not yet sure, how powerful that will get. In our projects we choose another solution, which we are happier with than XSLT (and the XSLT wasn&#8217;t available at this time anyway). We implemented an own transformator in Java, using the jBPM 3 object model and creating a JSON file for the Signavio or Activiti Modeler, which then can export the BPMN 2.0 XML (sounds more complicated than it is, since we nicely integrated that in tooling, see below). The Java-Transformator supports basic transformations out of the box but allows for easy extensions in your project. So the goal was to be able to influence the resulting BPMN in every project easily, since for a couple of constructs there is not the one and only right way for transformation.</p>
<p>The transformator doesn&#8217;t preserve any layout information, in most cases the jPDL layouts wouldn&#8217;t be helpful anyway. In some cases we leveraged the Signavio Auto-Layout mechanism instead. But in all of our cases we did some manual adjustments afterwards, at least for the layout.</p>
<p><strong>Throw away jBPM 3?</strong> </p>
<p>So we found a way to migrate process definitions to BPMN 2.0. Fine <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' />  But that is only part of the story.  In a lot of jBPM projects business logic (or service calls) is attached to the process definition as so called ActionHandler&#8217;s or DecisionHandler&#8217;s (both Java Interfaces). How can we migrate them? Or how to embed a new engine in your environment, where you might have invested time to get going with jBPM 3? These are the hard tasks, and it is advisable to do them step by step.</p>
<p>So for our customers we didn&#8217;t migrate the engine immediately, but kept jBPM 3 for a while.</p>
<p><strong>Use BPMN 2.0 to jPDL transformation</strong> </p>
<p>If we keep jBPM 3 the interesting question is how to get from the BPMN process model to the jPDL XML, which then is deployed on the jBPM 3 Engine. Surprise, surprise, we introduced a second transformation, from BPMN to jPDL. And this direction is much more important, meaning we invested much more time in it than the reverse direction. We successfully used it at customers in various processes. Hence, it is already pretty proven, even if not totally complete. But again, our focus was to make it easy extensible. It can be done by writing a small Java class being added to the mapping. This is done by customers themselves.</p>
<p><strong>Extending this mapping with own magic</strong></p>
<p><div id="attachment_2077" class="wp-caption alignright" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingMeasuringPoint.png"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingMeasuringPoint-150x75.png" alt="Defining a measuring point in Signavio Modeler in BPMN" title="Defining a measuring point in Signavio Modeler in BPMN" width="150" height="75" class="size-thumbnail wp-image-2077 colorbox-2090" /></a><p class="wp-caption-text">Defining a measuring point in Signavio Modeler in BPMN</p></div>     I want to give you a quick example to make it more concrete. In a customer project we defined measuring points in the process, at these points an event will be sent to the so called Process Control Center (typical scenario). For sending these event there is a pre-defined jBPM3 ActionHandler doing it. The measuring point is modeled as intermediate event and a boolean property &#8220;measuringpoint&#8221; is set to true in Signavio (as shown in the screen-shot). This can be used during the Tranformation process and the ActionHandler with the correct configuration is added to the resulting jBPM process. You can see as well, that in that step we validate constructs of the BPMN model. If the name of the measuring point doesn&#8217;t match the conventions, an validation error is thrown. The following source code shows the implementation of this extension, as you can see it is a very easy Java code that can be hooked into the transformation:</p>
<pre>
public class MeasuringPointPattern extends OryxPattern {
  public Node modifyJpdl3(Node node, Shape shape) {
    if (BPMN20.NONE_INTERMEDIATE_EVENT.equals(shape.getStencilId()) &#038;&#038;
"true".equals(shape.getProperty("measuringpoint"))) {
      String name = shape.getProperty("name");
      if (name == null || !name.startsWith(MP_PREFIX)) {
        roundtrip.addMappingValidationError(shape, "The name of the None Intermediate Event '" + shape.getProperty("name") + "' does not start with '" + MP_PREFIX + "'."));
      }
      String mpName = name.substring(PREFIX.length());

      Event event = node.addEvent(new Event(Event.EVENTTYPE_NODE_ENTER));
      Delegation delegation = new Delegation(ACTION_HANDLER_CLASS_NAME);
      delegation.setConfiguration("<name>" + mpName + "</name>");
      Action action = new Action(delegation);
      event.addAction(action);
      action.setName(mpName);
    }
    return node;
  }
}
</pre>
<p>As a result, customers, departments or even projects may influence the mapping. There is no need to change anything in the &#8220;core&#8221; transformer.</p>
<p><strong>Graphical tooling for using the transformation</strong></p>
<p>The transformation from BPMN 2.0 to jBPM can be used in different ways. The easiest is to call the transformation via command line or in own Java code:</p>
<pre>
TransformationPerformer transform = new TransformationPerformer();
// add the patterns you need
transform.addJsonPattern(new Bpmn20JsonPattern());
transform.addJsonPattern(new MeasuringPointPattern());

// Fire it. In the background the Activiti Cycle Signavio Connector is used to read the process from the Signavio or Activiti Modeler
transform.performBpmn20ToJpdl3AndWriteToFile(
  signavioUrl, signavioUser, signavioPassword, sourceModelId, outputfileJson, outputfileXml, outputfileLog);
</pre>
<p><div id="attachment_2081" class="wp-caption alignright" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingMeasuringPointError.png"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingMeasuringPointError-150x97.png" alt="The Cycle Plug-In can show Validation Errors graphically" title="The Cycle Plug-In can show Validation Errors graphically" width="150" height="97" class="size-thumbnail wp-image-2081 colorbox-2090" /></a><p class="wp-caption-text">The Cycle Plug-In can show Validation Errors graphically</p></div>  But often you want to have more sophisticated tooling. What we did is to include the Mapping as Plug-in in Activiti Cycle. Since Cycle can browse the Signavio Process Repository as well as the Signavio Explorer, the Cycle GUI can be used as entry point for modeling. This allows to add the jBPM transformation as a view and a couple of actions on the fly. Especially interesting is, that by doing so you don&#8217;t need an additional Web-GUI, since you just use the tooling you would use anyway.</p>
<p>Additionally it adds a graphical view on transformation warnings and errors, as you can see in the screen-shot on the right. We created an extended Maven project wizard as well, to create technical projects that automatically contain the jBPM process definition (I described the Maven Wizard briefly in <a href="http://www.bpm-guide.de/2010/12/05/activiti-cycle-on-the-home-stretch/">my previous blog post about Cycle</a> already). </p>
<p><strong>Forward Engineering</strong></p>
<p><div id="attachment_2078" class="wp-caption alignright" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingActionHandler.png"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingActionHandler-150x77.png" alt="Adding jBPM Action Handler to BPMN process model in Signavio Modeler" title="Adding jBPM Action Handler to BPMN process model in Signavio Modeler" width="150" height="77" class="size-thumbnail wp-image-2078 colorbox-2090" /></a><p class="wp-caption-text">Adding jBPM Action Handler to BPMN process model in Signavio Modeler</p></div>  The customers using that transformation and tooling currently go for a pure forward engineering approach. Meaning: All information which results in the jBPM process must exist in the BPMN model already, like shown for ActionHandlers in the screen-shot on the right. We added the possibility to easily overwrite a jBPM process model if the BPMN has changed. In Cycle we remember the link between the BPMN model (e.g. in the Signavio Repository) and the jBPM XML (e.g. in the SVN). So it is easy to overwrite the model by one click. And we currently work on notification if models have changed as well. We even generate Java class stubs for ActionHandlers or ServiceAdpaters (see below), if they don&#8217;t exist in the project yet.</p>
<p>We currently roll out that tooling into production at one customer, so it is already more than a nice toy. The customer expects to gain speed in the development process and especially lower the learning curve for using BPMN for executable processes and the transformation to jBPM.</p>
<p><strong>Next step: Removing jBPM 3</strong></p>
<p>The next migration step would be to really remove jBPM 3 and introduce a BPMN 2.0 Engine. Therefore the business logic (or service calls) attached to the process definition as ActionHandler&#8217;s or DecisionHandler&#8217;s must be migrated as well. That is actually the harder part and IMHO cannot be done in the same way in all cases. And it always depends on the target engine. Let&#8217;s at least assume you migrate at least to a Java Engine like Activiti, where we have extensions available to call Java code directly. If you have an engine only capable of communication with WebServices it gets really complicated.</p>
<p>With the Java capabilities you could maybe think of some kind of Adapter class, calling your existing and untouched &#8220;legacy&#8221; jBPM 3 ActionHandlers. Maybe possible, but in our projects we choose another option:</p>
<p><strong>Writing Process Engine independent Service Adapters</strong></p>
<p>We transformed all existing jBPM 3 ActionHandlers into some easy Java POJOs, we call &#8220;Adapter&#8221;. We currently have three basic types:</p>
<ul>
<li>ServiceAdapter: Calling Services via EJB, JMS,&#8230;</li>
<li>GatewayAdapter: Making decisions</li>
<li>JavaAdapter: Arbitrary Java code</li>
</ul>
<p>These Adapters have some Injection mechanism for process variables and are then completely independent of the Process Engine. They can even be tested easier (no jBPM ExecutionContext must be mocked). Actually we are currently improving the Adapter concept a lot and add additional features in the infrastructure around them (like asynchronous communication, correlation of responses, supporting different technologies like EJB or WS without the need of changing the Adapter code, calling a Registry, &#8230;). Together with a customer we plan to create an own open source project for that soon, so I will for sure blog about this in more detail. If you are interested, drop me an email, it would be interesting to hear your requirements.</p>
<p>But back to our topic. These Adapters now could be used in as well jBPM3 and e.g. Activiti, the only thing you need is a generic Binding class calling the Adapter in the concrete Engine specific way. But this has to be done once for all processes and in the case of our Adapter framework are even provided by us for jBPM 3 and Activiti <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' />  And it is a pretty thin layer, which is easy to write.</p>
<p>OK, it is effort to migrate all ActionHandlers to Adapters, but it was really worth it, since the resulting code is engine independent once and for all. And since we took the opportunity to clean up and refactor a lot of code in that step, even the quality improved. And the Adapter concept forced us to define the code in a pretty clean and readable way, where no jBPM 3 hacks were allowed any more <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2090' />  </p>
<p><strong>Adding ServiceAdapters to BPMN process model</strong></p>
<p><div id="attachment_2079" class="wp-caption alignright" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingServiceAdapter.png"><img src="http://www.bpm-guide.de/wp-content/uploads/2010/12/jBPMMappingServiceAdapter-150x98.png" alt="Service Adapter in the BPMN lead to special code generated for jBPM" title="Service Adapter in the BPMN lead to special code generated for jBPM" width="150" height="98" class="size-thumbnail wp-image-2079 colorbox-2090" /></a><p class="wp-caption-text">Service Adapter in the BPMN lead to special code generated for jBPM</p></div>  As described above, we now add the ServiceAdapters to our BPMN process models, exchanging the jBPM ActionHandlers. In a first phase, we could even mix both possibilities, as long as we still run on jBPM3. As soon as we switch the Engine we exchanged the transformation to add the ServiceAdapters correctly e.g. to Activiti process definitions. This can be done once in the transformation, the BPMN process models as well as the Service Adapters keep untouched. You &#8220;just&#8221; have to exchange the Engine in your environment (which maybe is not that hard, if you used our <a href="http://www.bpm-guide.de/2010/04/17/abstracting-the-process-engine/">Process Engine Abstraction Layer</a> <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-2090' /> ). </p>
<p><strong>Migration Strategy</strong></p>
<p>So in short we currently made good experiences with a migration strategy like this:</p>
<ul>
<li>Migrate process models from jPDL to BPMN</li>
<li>Keep jBPM 3 and introduce forward engineering from BPMN models to jPDL</li>
<li>Test that everything still works</li>
<li>Migrate ActionHandlers to Engine Independent code (e.g. ServiceAdapters)</li>
<li>Test that everything still works</li>
<li>Migrate Engine by having a &#8220;phase out&#8221;-phase, where you run jBPM 3 and the new engine in parallel. Actually there are a lot of discussions going on, if that should be avoided by migrating running process instances to the new engine and make a hard cut. I think, phasing out is much easier and less error prone (and is actually not that hard to do), but maybe somebody proves me wrong in future <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' /> </li>
</ul>
<p>To be honest, none of our customers has already completely migrated. But hey, jBPM 3 is really stable, there is no time pressure for it, as soon as you can present BPMN process models to anybody asking for it <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-2090' /> </p>
<p><strong>And where can I find this transformation and Cycle Plug-in?</strong></p>
<p>We are currently releasing the transformation described and the Activiti Cycle Plug-in freely as Open Source on the <a href="http://fox.camunda.com/cycle-plugins/">camunda fox Cycle Plug-ins Page</a>. The downloads will be available together with the release of <a href="http://www.activiti.org/cycle.html">Activiti Cycle</a> 5.1 (1st of January 2011).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2010/12/24/using-bpmn-2-0-models-with-jbpm-3-a-migration-path-and-more/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Left. No right! Testing processes with scenarios.</title>
		<link>http://www.bpm-guide.de/2010/06/18/prozesse-mit-szenarien-testen/</link>
		<comments>http://www.bpm-guide.de/2010/06/18/prozesse-mit-szenarien-testen/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 05:32:39 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[fox]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=1202</guid>
		<description><![CDATA[In a current project we develop an executable process. Hence, this process is a &#8220;piece of software&#8221;, which need to be tested. In software development this is common sense, so there are enough tools and best practices. Is that the same for technical process models? Hmm, not that easy. On the one hand we can [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1203" class="wp-caption alignleft" style="width: 140px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/06/test-szenarien.jpg"><img class="size-thumbnail wp-image-1203 colorbox-1202" title="Test Scenarios" src="http://www.bpm-guide.de/wp-content/uploads/2010/06/test-szenarien-130x150.jpg" alt="Test Scenarios" width="130" height="150" /></a><p class="wp-caption-text">Test Scenarios</p></div>
<p>In a current project we develop an executable process. Hence, this process is a &#8220;piece of software&#8221;, which need to be tested. In software development this is common sense, so there are enough tools and best practices. Is that the same for technical process models? Hmm, not that easy. On the one hand we can use proved Java Test frameworks like JUnit for Open Source Process Engines like jBPM. On the other hand processes have some specialties, which aren&#8217;t surprising but somehow challenging&#8230;</p>
<p><span id="more-1202"></span></p>
<p>For the process we devloped process scenarios, which indicate on which path a process instance flows through the process. The picture on the left shows a foto from the current project. By the way: The green mark shows: This scneario was successfull tested <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-1202' />  Sorry for the bad quaility of the picture, but otherwiese I couldn&#8217;t have posted it here.</p>
<p>To implement such a scenario we can write a unit test, which set up some test data, trigger the process and waits, till the process arrives in a defined state. As soon as the process waits for an external trigger (like a Human enter some data or a system sends an asychronous answer) the unit tests comes into action and &#8220;fakes&#8221; that answer. By doing so, the whole process can be walked through to check if the behaviour is as expected. Some sample code is shown at the very end of this blog post, I don&#8217;t want to frighten non IT folks too early <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-1202' /> </p>
<p>To define these kinds of scenarios is pretty typical by the way, we did that in quite some projects already. The downside is at the moment, that there isn&#8217;t much good tooling for that. In the area of Open Source Process Engines there exists basically nothing and the commercial tools tend to be too GUI centered, which normally isn&#8217;t developers friendly. I see the following requirements for such a tooling:</p>
<ul>
<li>We want to organize these scenarios! We want to mark them in the real process model, save it and load it later on.</li>
<li>I want to compare the audit data from the really executed process with the defined scnerios (&#8220;Did the process really went that way?&#8221;). I want to recognize differences easily and graphically.</li>
<li>I want to create &#8220;smaller&#8221; scenarios for just parts of the process. In our example process we have different parts, e.g. data checking, customer creation, order provisioning, &#8230;. We want to test these parts independantly from each other (I want to spare the explanattion why we didn&#8217;t create subprocesses for them). So we want to start a scenario at an arbritrary node in the process, provide some input data and stop it at a defined node where we calidate the outgoing data.</li>
<li>Ideally Input and Output data are provided in a non technical format, like spreadsheets or <a href="http://fitnesse.org/">Fitnesse</a>.</li>
</ul>
<div id="attachment_1206" class="wp-caption alignleft" style="width: 57px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/06/test-coverage.jpg"><img class="size-thumbnail wp-image-1206 colorbox-1202" title="Test Coverage" src="http://www.bpm-guide.de/wp-content/uploads/2010/06/test-coverage-47x150.jpg" alt="Test Coverage" width="47" height="150" /></a><p class="wp-caption-text">Test Coverage</p></div>
<p>There is another interessting aspect of process testing: The so called <a href="http://en.wikipedia.org/wiki/Code_coverage">Test coverage</a>. The idea is easy: I want to make sure that every node and path in my processes was executed at least once. If you need every possible combination can be an endless discussion, but in my experience it would be already a big improvement for most projects if they had at least executed every path once. In our project I used a marker to indicate which parts we already tested as you can see indicated on the left. But this coverage report could be generated by the tooling itself, so to visualize this automatically would be another item on my wish list.</p>
<p>Currently we implement the mentioned use cases in <a href="http://fox.camunda.com">camunda fox</a> for <a href="http://www.jboss.org/jbpm">JBoss jBPM 3.2.x</a> and <a href="http://www.signavio.com/">Signavio</a>. The visualizations are done in the BPMN model in Signavio, the technical implementation and testing is done in jBPM. But we try to achieve that non technical folks can define, refine or at least read the test scenarios as well. Then we could make the tests and test coverage part of a process cockpit or process status as well.</p>
<div id="attachment_1207" class="wp-caption alignleft" style="width: 160px"><a href="http://www.bpm-guide.de/wp-content/uploads/2010/06/process-development-status.jpg"><img class="size-thumbnail wp-image-1207 colorbox-1202" title="Process Development Status Indication" src="http://www.bpm-guide.de/wp-content/uploads/2010/06/process-development-status-150x48.jpg" alt="Process Development Status Indication" width="150" height="48" /></a><p class="wp-caption-text">Process Development Status Indication</p></div>
<p>By the way: Currently we use a printed BPMN diagram to indicate the status if the development, as you can see on the left. We want to link the nodes with <a href="http://www.atlassian.com/software/jira/">JIRA</a>-Issues, so we can create that indication automatically. Even if paper and whiteboards are good tools, that only works if the whole team is in the same room or at least building. Obviously it is nice to stand in front of the whiteboard for discusssions, bit not having it electronically has some disadvantages:</p>
<ul>
<li>Not transportable: We could&#8217;t easily take the status and scenarios with us into meetings.</li>
<li>Changes: If there are process changes, we would have to reprint and redraw all scenarios.</li>
<li>Keep it up-to-date: After the project or in the next project we want to improve the scenarios or change them according to changed processes. The paper from the last project is normally not longer available at that time.</li>
<li>No <a href="http://martinfowler.com/articles/continuousIntegration.html">Continous Integration</a> based on paper <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-1202' /> </li>
<li>Distributed teams: As soon as your not together at the same physical location any more you need electronical help to get that running and the collaboration intact.</li>
</ul>
<p>But this is enough content for an own blog post&#8230;</p>
<p>Okay, but I promised to give you some more technical details, so I present an example test case here (note that the asserts are hidden in the ProcessHelper); </p>
<pre>public void scenario2() throws Exception {
  testDataHelper.setCustomerAddressType(CustomerAddressType.VALID_ADDRESS);
  ... // set some more data for testcase

  long orderId = startOrderProcess();

  // provide a test stub for one service called on the way we wanted to "mock" out
  processHelper.setTestStubResult(CheckAddressAdapter.class, createCheckAddressResultResult());

  processHelper.waitForState("Fraud Check aufrufen");
  // "fake" result of fraud service: Fraud OK
  correlationFacade.callCorrelationService("Fraud", orderId, "0");

  processHelper.waitForState("Bonität prüfen");
  // "fake" result of boni service: Boni yellow
  correlationFacade.callCorrelationService("Boni", orderId, "1");

  // wait for the process to end
  processHelper.waitForState("Ende", 70);
}</pre>
<p>During the execution the ProcessHelper shows the flow of the process, we &#8220;just&#8221; need to add some functionality to validate this audit data aginst our expectation in the scenario:</p>
<pre>
SCENARIO: Storno Boni (yellow); ORDER ID: 4368835; ROOT TOKEN ID: 1495
   - wait for Call Fraud Check
      - status changed to BI: Insert Data
      - status changed to DCN: Insert Data into Duplicate Checker
      - status changed to CCD: Create customer
      ...
      - status changed to Call Fraud Check
   - wait for Check Boni
     ...
      - status changed to Check Boni
   - wait for End
      - status changed to Check Boni
      - ...
      - status changed to End
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2010/06/18/prozesse-mit-szenarien-testen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BPMN 2.0 wird ausführbar – und für jeden verfügbar!</title>
		<link>http://www.bpm-guide.de/2009/12/13/bpmn-2-0-wird-ausfuehrbar-und-fuer-jeden-verfuegbar/</link>
		<comments>http://www.bpm-guide.de/2009/12/13/bpmn-2-0-wird-ausfuehrbar-und-fuer-jeden-verfuegbar/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 11:11:22 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[BPMN]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SaaS]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=313</guid>
		<description><![CDATA[Große Ereignisse werfen ihre Schatten voraus. Nicht nur, dass unser Praxishandbuch BPMN endlich vollbracht ist (siehe Wir haben fertig), daneben hat mein Prototyp einer BPMN 2.0 Engine mit JBoss jBPM (siehe Bauen wir uns eine BPMN 2.0 Engine), den ich im Rahmen des Buches entwickelt habe, tatsächlich einiges angestossen. Somit wird in der kommenden jBPM [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-357 alignleft colorbox-313" title="jbpm_logo" src="http://www.bpm-guide.de/wp-content/uploads/2009/12/jbpm_logo-150x71.png" alt="jbpm logo" width="150" height="71" />Große Ereignisse werfen ihre Schatten voraus. Nicht nur, dass unser Praxishandbuch BPMN endlich vollbracht ist (siehe <a href="http://www.bpm-guide.de/2009/12/07/wir-haben-fertig/">Wir haben fertig</a>), daneben hat mein Prototyp einer BPMN 2.0 Engine mit <a href="http://www.jboss.org/jbossjbpm/">JBoss jBPM</a> (siehe <a href="http://www.bpm-guide.de/2009/08/02/bauen-wir-uns-eine-bpmn-20-engine/">Bauen wir uns eine BPMN 2.0 Engine</a>), den ich im Rahmen des Buches entwickelt habe, tatsächlich einiges angestossen. Somit wird in der kommenden jBPM Version 4.3 pünktlich zum neuen Jahr (am 01.01.2010) eine BPMN 2.0 Process Engine zur Verfügung stehen (siehe auch <a href="http://processdevelopments.blogspot.com/2009/12/first-oss-bpmn-2-process-engine.html">The First OSS BPMN 2 Process Engine</a>).</p>
<p><span id="more-313"></span>Ein erstes lauffähiges (!) Beispiel hat Joram vom jBPM-Team auch bereits online gestellt: <a href="http://www.jorambarrez.be/blog/2009/12/04/jbpm-goes-bpmn/">jBPM goes BPMN</a>. Natürlich werden im ersten Schritt noch nicht alle BPMN 2.0 Features unterstützt, viel mehr wird priorisiert und Elemente werden nach und nach eingebaut, wobei bis Mitte 2010 schon eine recht vollständige Engine zur Verfügung stehen soll. Dies wird vor allem dadurch möglich, dass &#8220;nur&#8221; die Sprachelemente neu entwickelt werden müssen, und die eigentliche Engine (mit Themen wie Persistenz, Skalierbarkeit, Clusterfähigkeit usw.) bereits stabil läuft.</p>
<p>Wir wollen uns aber nicht nur für die Initialzündung auf die Schulter klopfen, sondern werden zukünftig auch weiter aktiv an der Entwicklung mithelfen. Wie sollte man eine Sprache besser lernen und eine Spezifikation genauer verstehen, als wenn man eine Engine selbst mitbaut <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-313' /> </p>
<p>Aus unserer Sicht macht es übrigens gerade im Process Execution Bereich oft Sinn, quelloffene Software einzusetzen. Weniger wegen der Kosten, sondern damit das Unternehmen statt einer Black-Box die maximale Kontrolle bekommt. Sollte die Software nicht funktionieren oder erweitert werden müssen, dann können Sie das tun! Ihre Entwickler (oder auch eingekaufte Berater <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-313' /> ) können sich mit solchen Produkten bis in die Eingeweide auskennen, womit man viele Fehler, Probleme und Anforderungen besser und schneller lösen kann und nicht auf den Support der Hersteller angewiesen ist. Sie wollen Ihre Lösung aber gar nicht so genau kennen? IT muss einfach laufen? Dann ist Open Source sowieso nicht das richtige für Sie, in diesem Fall können Sie doch mal einen Blick auf unsere <a href="http://www.camunda.com/software/software-as-a-service/">SaaS-Plattform für BPM</a> werfen <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-313' /> </p>
<p>Genug des Marketing. Bleibt nur zu sagen, dran bleiben lohnt sich, da wird die nächsten Monate einiges passieren! Wir werden ebenfalls live dabei sein.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/12/13/bpmn-2-0-wird-ausfuehrbar-und-fuer-jeden-verfuegbar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bauen wir uns eine BPMN 2.0 Engine</title>
		<link>http://www.bpm-guide.de/2009/08/02/bauen-wir-uns-eine-bpmn-20-engine/</link>
		<comments>http://www.bpm-guide.de/2009/08/02/bauen-wir-uns-eine-bpmn-20-engine/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 07:31:34 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[BPM-Software]]></category>
		<category><![CDATA[BPMN]]></category>
		<category><![CDATA[jBPM]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=191</guid>
		<description><![CDATA[Die Spatzen pfeifen es schon von den Dächern: Die BPMN 2.0 steht vor der Tür. Die neue Version heißt jetzt &#8220;Business Process Model and Notation&#8221; und bringt einige Neuerungen mit. Eine der wichtigsten ist jedoch das sagenumwobene Metamodell sowie die Ausführungssemantik. Cool. Aber was ist das? Im Rahmen des Praxishandbuch BPMN, das wir gerade schreiben, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-192 colorbox-191" style="float: left; margin-left: 10px; margin-right: 10px;" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/praxishandbuch-bpmn-119x150.jpg" alt="" width="119" height="150" />Die Spatzen pfeifen es schon von den Dächern: Die BPMN 2.0 steht vor der Tür. Die neue Version heißt jetzt &#8220;Business Process Model and Notation&#8221; und bringt einige Neuerungen mit. Eine der wichtigsten ist jedoch das sagenumwobene Metamodell sowie die Ausführungssemantik. Cool. Aber was ist das? Im Rahmen des <a href="http://www.hanser.de/buch.asp?isbn=978-3-446-41768-7">Praxishandbuch BPMN</a>, das wir gerade schreiben, haben wir uns damit natürlich ganz genau auseinandergesetzt. Heute möchte ich einmal zwei kleine Vorgeschmäcker geben: Ein Beispielprozess in BPMN 2.0 Syntax sowie die neusten Infos aus dem Maschinenraum &#8211; zur Entwicklung eines Prototyp einer BPMN 2.0 Process Engine.</p>
<p><span id="more-191"></span></p>
<p><strong>Ein Bild sagt mehr als tausend Worte &#8211; und ein Beispiel mehr als jedes Schema</strong></p>
<p>An dieser Stelle möchte ich eines vorneweg schicken: Mir sind einige graue Haare gewachsen als ich mich durch den BPMN 2.0 Spezifikationsentwurf gekämpft habe. Nun habe ich natürlich kein literarisches Meisterwerk erwartet. Überrascht hat mich dann aber, dass es so gut wie kein Beispiel-XML im gesamten Dokument gibt. Ich hoffe nicht zu lügen, ich meine es war genau ein Mini-Prozess. Vielleicht geht es ja nur mir so, aber ich kann Besipiel-XML-Dateien besser verstehen als weit verstreute XML-Schema-Bruchstücke (XSD). Naja, auch sonst sind Anwendungsbeispiele in der Spec spärlich gesäht. Aber gut, dafür gibt es dann ja auch unser Buch <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-191' /> </p>
<p>Nun gut, also habe ich erst mal behende einen Beispielprozess aufgesetzt. Leider habe auch ich noch nicht alle Einzelheiten der Spec und des XML-Formats verstanden. Ich bin mir auch noch nicht sicher, ob der hier abgebildete Prozess wirklich hundertprozentig richtig ist, daher bitte einfach melden, wenn jemand anderer Meinung ist!</p>
<p>Der Prozess, den ich mir vorgenommen habe, entstammt natürlich unserem Buch, es ist ein kleiner Teilprozess für die Lieferung von Ware. Die Story ist ganz simpel: Die eigentliche Tourenplanung &#8211; welche Ware in welchem LKW zum Kunden geht &#8211; macht ein dafür ausgelegtes System. Wir rufen nur einen Service auf, damit unsere Ware berücksichtigt wird und werden benachrichtigt, wenn die Ware versendet ist. Eventuell benachrichtigen wir dann den Kunden über den Liefertermin, im Beispiel erfolgt dies durch einen Kundenbetreuer. Der Prozess ist hier dargestellt:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/08/bpmn20beispiel.png"><img class="alignnone size-full wp-image-194 colorbox-191" title="bpmn20beispiel" src="http://www.bpm-guide.de/wp-content/uploads/2009/08/bpmn20beispiel.png" alt="" width="500" height="216" /></a></p>
<p>Für die Serialisierung als XML gibt es nun zwei wichtige Aspekte:</p>
<ul>
<li>Semantik: Welcher Service wird aufgerufen, wer kann die Aufgabe bearbeiten, wie wird die Entscheidung getroffen, ob die Lieferterminavisierung notwendig ist, usw.</li>
<li>Layout: Wie sieht das Diagram aus, wie sind die Elemente angeordnet.</li>
</ul>
<ol></ol>
<p>Die beiden Aspekte werden von BPMN 2.0 getrennt behandeln. Heute wollen wir uns für den Anfang nur die Semantik zu Gemüte führen, ein Blogpost zum Layout folgt noch. Die Spezifiaktion definiert ein XML-Schema für die Semantik. Unter der Annahme, dass wir das Tourenplanungssystem über Webservices ansprechen sieht der Beispiel-Prozess in etwa so aus, wobei ehrlicherweise noch ein paar Aspekte fehlen:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;bpmn:definitions id="ShipmentDefinitions"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
  xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0"
  xmlns:sample="http://sample.bpmn.camunda.com/"
  xmlns:xbpmn="http://bpmn.camunda.com/"
  xmlns:tns="http://sample.bpmn.camunda.com/"
  typeLanguage="http://www.w3.org/2001/XMLSchema"
  expressionLanguage="http://www.w3.org/1999/XPath"
  targetNamespace="http://sample.bpmn.camunda.com/"&gt;

  &lt;!-- imports --&gt;
  &lt;bpmn:import namespace="http://sample.bpmn.camunda.com/" l
               ocation="SampleService.xsd"
               importType="http://www.w3.org/2001/XMLSchema"/&gt;
  &lt;bpmn:import namespace="http://sample.bpmn.camunda.com/"
               location="SampleService.wsdl"
               importType="http://schemas.xmlsoap.org/wsdl/soap/"/&gt;
  &lt;bpmn:import namespace="http://sample.bpmn.camunda.com/"
               location="ShipmentProcessService.wsdl"
               importType="http://schemas.xmlsoap.org/wsdl/soap/"/&gt;

  &lt;!-- definition structures for process variables --&gt;
  &lt;bpmn:itemDefinition id="lieferungDef" itemKind="Information"
                       structureRef="sample:shipment"/&gt;

  &lt;!-- definition structures for messages --&gt;
  &lt;bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information"
                       structureRef="sample:startShipmentProces"/&gt;
  &lt;bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information"
                       structureRef="sample:createShipment"/&gt;
  &lt;bpmn:itemDefinition id="KommissioniertDef" itemKind="Information"
                       structureRef="sample:notifyShipmentConsigned"/&gt;

  &lt;!-- messages --&gt;
  &lt;bpmn:message name="ProzessStarten" id="ProzessStartenNachricht"
                structureRef="tns:ProzessStartenDef"/&gt;
  &lt;bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht"
                structureRef="tns:LieferungAnlegenDef"/&gt;
  &lt;bpmn:message name="Kommissioniert" id="KommissioniertNachricht"
                structureRef="tns:KommissioniertDef"/&gt;

  &lt;!-- end points - out of scope for BPMN --&gt;
  &lt;bpmn:endPoint id="ProzessEndpoint"&gt;
    &lt;xbpmn:... /&gt;
  &lt;/bpmn:endPoint&gt;
  &lt;bpmn:endPoint id="LiefersystemEndpoint"&gt;
    &lt;xbpmn:... /&gt;
  &lt;/bpmn:endPoint&gt;

  &lt;!-- interfaces --&gt;
  &lt;bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle"&gt;
    &lt;bpmn:operation name="startShipmentProcess"&gt;
      &lt;bpmn:inMessageRef&gt;tns:ProzessStartenNachricht&lt;/bpmn:inMessageRef&gt;
    &lt;/bpmn:operation&gt;
    &lt;bpmn:operation name="notifyShipmentConsigned"&gt;
      &lt;bpmn:inMessageRef&gt;tns:KommissioniertNachricht&lt;/bpmn:inMessageRef&gt;
    &lt;/bpmn:operation&gt;
  &lt;/bpmn:interface&gt;
  &lt;bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle"&gt;
    &lt;bpmn:operation name="createShiptment"&gt;
      &lt;bpmn:inMessageRef&gt;tns:LieferungAnlegenNachricht&lt;/bpmn:inMessageRef&gt;
    &lt;/bpmn:operation&gt;
  &lt;/bpmn:interface&gt;

  &lt;!-- Resources / Performers --&gt;
  &lt;bpmn:resource id="VertriebResource" name="Vertrieb"/&gt;

  &lt;!-- process definition --&gt;
  &lt;bpmn:process id="Shipment" name="Shipment"&gt;
    &lt;bpmn:documentation id="doc1"&gt;Teilprozess der Lieferung&lt;/bpmn:documentation&gt;

    &lt;!-- process variables --&gt;
    &lt;bpmn:dataObject id="lieferungVariable" name="Lieferung"
                     itemSubjectRef="tns:lieferungDef"/&gt;

    &lt;!-- Start-Event --&gt;
    &lt;bpmn:startEvent id="Start"&gt;
      &lt;bpmn:dataOutput id="ProzessStartOutput"
                       itemSubjectRef="tns:ProzessStartenNachricht"/&gt;
      &lt;bpmn:dataOutputAssociation&gt;
        &lt;bpmn:assignment&gt;
          &lt;bpmn:from xsi:type="bpmn:tFormalExpression"&gt;
             getDataOutput('ProzessStartOutput')/shipment
          &lt;/bpmn:from&gt;
          &lt;bpmn:to xsi:type="bpmn:tFormalExpression"&gt;
             getDataObject('lieferungVariable')
          &lt;/bpmn:to&gt;
        &lt;/bpmn:assignment&gt;
        &lt;bpmn:sourceRef&gt;ProzessStartOutput&lt;/bpmn:sourceRef&gt;
        &lt;bpmn:targetRef&gt;tns:lieferungVariable&lt;/bpmn:targetRef&gt;
      &lt;/bpmn:dataOutputAssociation&gt;
      &lt;bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht"&gt;
        &lt;bpmn:operationRef&gt;tns:startShipmentProcess&lt;/bpmn:operationRef&gt;
      &lt;/bpmn:messageEventDefinition&gt;
    &lt;/bpmn:startEvent&gt;

    &lt;!-- Activity 1: Service Task --&gt;
    &lt;bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen"
                      implementation="WebService" operationRef="createShipment"&gt;
      &lt;xbpmn:url/&gt;
      &lt;bpmn:ioSpecification&gt;
        &lt;bpmn:dataInput id="LieferungBuchenInput" isCollection="false"
                        itemSubjectRef="tns:LieferungAnlegenNachricht"/&gt;
        &lt;bpmn:inputSet&gt;
          &lt;bpmn:dataInputRefs&gt;LieferungBuchenInput&lt;/bpmn:dataInputRefs&gt;
        &lt;/bpmn:inputSet&gt;
        &lt;bpmn:outputSet/&gt;
      &lt;/bpmn:ioSpecification&gt;
      &lt;bpmn:dataInputAssociation&gt;
        &lt;bpmn:assignment&gt;
          &lt;bpmn:from xsi:type="bpmn:tFormalExpression"&gt;
             bpmn:getDataObject('lieferungVariable')
          &lt;/bpmn:from&gt;
          &lt;bpmn:to xsi:type="bpmn:tFormalExpression"&gt;
             bpmn:getDataInput('LieferungBuchenInput'/shipment/
          &lt;/bpmn:to&gt;
        &lt;/bpmn:assignment&gt;
        &lt;bpmn:sourceRef&gt;tns:lieferungVariable&lt;/bpmn:sourceRef&gt;
        &lt;bpmn:targetRef&gt;LieferungBuchenInput&lt;/bpmn:targetRef&gt;
      &lt;/bpmn:dataInputAssociation&gt;
    &lt;/bpmn:serviceTask&gt;

    &lt;!-- Activity 2: Receive Task --&gt;
    &lt;bpmn:receiveTask id="WartenAufLieferung"
                      name="Warten auf Lieferung"
                      instantiate="false"
                      implementation="WebService"
                      operationRef="notifyShipmentConsigned"
                      messageRef="tns:Kommissioniert"&gt;
      &lt;bpmn:ioSpecification&gt;
        &lt;bpmn:dataOutput id="KommissioniertOutput"
                         itemSubjectRef="tns:KommissioniertNachricht"/&gt;
        &lt;bpmn:inputSet/&gt;
        &lt;bpmn:outputSet&gt;
          &lt;bpmn:dataOutputRefs&gt;KommissioniertOutput&lt;/bpmn:dataOutputRefs&gt;
        &lt;/bpmn:outputSet&gt;
      &lt;/bpmn:ioSpecification&gt;

      &lt;bpmn:dataOutputAssociation&gt;
        &lt;bpmn:assignment&gt;
          &lt;bpmn:from xsi:type="bpmn:tFormalExpression"&gt;
            getDataOutput('KommissioniertOutput')/shipment
          &lt;/bpmn:from&gt;
          &lt;bpmn:to xsi:type="bpmn:tFormalExpression"&gt;
            getDataObject('lieferungVariable')
          &lt;/bpmn:to&gt;
        &lt;/bpmn:assignment&gt;
        &lt;bpmn:sourceRef&gt;KommissioniertOutput&lt;/bpmn:sourceRef&gt;
        &lt;bpmn:targetRef&gt;tns:lieferungVariable&lt;/bpmn:targetRef&gt;
      &lt;/bpmn:dataOutputAssociation&gt;
    &lt;/bpmn:receiveTask&gt;

    &lt;!-- Gateway --&gt;
    &lt;bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/&gt;

    &lt;!-- Activity 3: User Task --&gt;
    &lt;bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren"
                   implementation="other"&gt;
      &lt;bpmn:potentialOwner resourceRef="tns:VertriebResource"/&gt;
    &lt;/bpmn:userTask&gt;

    &lt;!-- End Events --&gt;
    &lt;bpmn:endEvent id="End" name="End"/&gt;

    &lt;!-- Sequence Flow --&gt;
    &lt;bpmn:sequenceFlow id="flow1" name="Start-&gt;LieferungBuchen"
                       sourceRef="Start" targetRef="LieferungBuchen" /&gt;
    &lt;bpmn:sequenceFlow id="flow2"
                       sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/&gt;
    &lt;bpmn:sequenceFlow id="flow3"
                       sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/&gt;
    &lt;bpmn:sequenceFlow id="flow4"
                       sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren"&gt;
      &lt;bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"&gt;
        getDataObject('lieferungVariable')/confirmationRequired=true
      &lt;/bpmn:conditionExpression&gt;
    &lt;/bpmn:sequenceFlow&gt;
    &lt;bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End"&gt;
      &lt;bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"&gt;
        not( getDataObject('lieferungVariable')/confirmationRequired=true )
      &lt;/bpmn:conditionExpression&gt;
    &lt;/bpmn:sequenceFlow&gt;
    &lt;bpmn:sequenceFlow id="flow6"
                       sourceRef="LieferterminAvisieren" targetRef="End"/&gt;
  &lt;/bpmn:process&gt;

&lt;/bpmn:definitions&gt;</pre>
<p>Ich möchte das XML fast einmal für sich wirken lassen <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-191' />  Wie gesagt, sollte jemand einen Fehler finden oder sonst gute Hinweise haben, immer her damit!</p>
<p>Einen Aspekt möchte ich hervorheben: Die BPMN 2.0 lässt offen, in welcher Technologie Daten vorliegen, Services angebunden werden und Ausdrücke ausgewertet werden. Somit kann man sich eine Engine vorstellen die sehr BPEL-ähnlich arbeitet, mit XML und Webservice, oder aber auch eine Engine, die an Java oder ähnliches gebunden ist. Das coole daran ist, dass man sich trotzdem im Standard bewegt und auch eher leichtgewichtige Workflow-Engines durchaus BPMN kompatibel sein können (naja, okay, der Standard ist dick, so leichtgewichtig ist die Engine dann auch nicht mehr <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-191' /> ).</p>
<p>Der Nachteil ist natürlich, dass ich einen Prozess nur dann von einer Engine auf die nächste kippen kann, wenn diese die gleiche Technologie unterstützt.</p>
<p>Ein Serviceaufruf könnte bei einer Java-Engine dann evtl. so aussehen:</p>
<pre>...
&lt;import
  namespace="http://sample.bpmn.camunda.com/"
  location="services.jar"
  importType="http://java.sun.com/" /&gt;

  &lt;!-- Datenstruktur --&gt;
  &lt;itemDefinition id="LieferungAnlegenDef" itemKind="Information"
                  structureRef="com.camunda.bpmn.sample.Shipment" /&gt;
  &lt;message name="LieferungAnlegen" id="LieferungAnlegenNachricht"
           structureRef="com.camunda.bpmn.sample.LieferungAnlegen" /&gt;

  &lt;!-- Schnittstelle --&gt;
  &lt;interface id="LiefersystemInterface" name="Liefersystem Schnittstelle"&gt;
    &lt;operation name="createShiptment"&gt;
      &lt;inMessageRef&gt;LieferungAnlegenNachricht&lt;/inMessageRef&gt;
    &lt;/operation&gt;
  &lt;/interface&gt;
  ...
  &lt;process id="Lieferprozess" name="Lieferung"&gt;
    &lt;serviceTask id="LieferungBuchen" name="Lieferung buchen"
                 implementation="other"
                 operationRef="createShipment"&gt;

      &lt;ioSpecification&gt;
        &lt;dataInput id="LieferungBuchenInput" isCollection="false"
                   itemSubjectRef="LieferungAnlegenNachricht" /&gt;
        &lt;inputSet&gt;
          &lt;dataInputRefs&gt;LieferungBuchenInput&lt;/dataInputRefs&gt;
        &lt;/inputSet&gt;
        &lt;outputSet /&gt;
      &lt;/ioSpecification&gt;

      &lt;dataInputAssociation&gt;
        &lt;assignment&gt;
          &lt;from xsi:type="tFormalExpression"&gt;#{lieferungVariable}&lt;/from&gt;
          &lt;to xsi:type="tFormalExpression"&gt;#{LieferungBuchenInput.shipment}&lt;/to&gt;
        &lt;/assignment&gt;
        &lt;sourceRef&gt;lieferungVariable&lt;/sourceRef&gt;
        &lt;targetRef&gt;LieferungBuchenInput&lt;/targetRef&gt;
      &lt;/dataInputAssociation&gt;

    &lt;/serviceTask&gt;
    ...</pre>
<p><strong>Eine Open Source BPMN 2.0 Engine?</strong></p>
<p>Nun möchte ich noch mein zweites Versprechen einlösen und kurz aus dem Nähkästchen plaudern. Ich bin ja eher so der Typ, der Beispiele braucht und gerne etwas ausprobiert. Theorie und Spezifikationen sind schön und wichtig, aber in der IT muß es ja auch irgendwann irgendwie tatsächlich laufen. Also gut, dachte ich mir, baue ich mal nen Prototypen für ne BPMN 2.0 Engine.</p>
<p>Um nicht von Null zu starten habe ich die JBoss jBPM Process Virtual Machine als Grundlage genommen. Dort sind bereits die wesentlichen Konzepte einer Process Engine umgesetzt. In zwei längeren Zugfahrten konnte ich so schon meinen ersten einfachen BPMN 2.0 Prozess ausführen. Also: Es geht! Problematisch werden dann eher die vielen schmutzigen Details, wovon die Spec einige zu bieten hat <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-191' /> </p>
<p>Die Idee und der Prototyp wurde inzwischen aufgegriffen und im jBPM weiterentwickelt. Aktuell eher als Proof of concept und Prototyp. Da er Open Source für jeden verfügbar und einsehbar ist denke ich eine schöne Sache, um BPMN 2.0 den Menschen &#8211; naja, den IT-Menschen &#8211; näher zu bringen!</p>
<p><strong>Fazit BPMN 2.0 Ausführungssemantik</strong></p>
<p>Mein aktuelles Fazit zur Ausführungssemantik ist: Sehr mächtig, aber auch komplex. Im Prinzip ist es BPEL ähnlicher geworden, die Mächtigkeit ist vergleichbar, die Komplexität dann eben auch. Witzig in diesem Zusammenhang übrigens auch folgendes Zitat, dessen Urheber ich anstandsweise nicht nennen möchte: &#8220;It would be a mistake to conclude there was some OMG deep thinking behind these fine points in the spec.  More often it was one guy thinking about how his own company&#8217;s BPEL engine (now being converted to BPMN 2.0 engine) behaves, and no one else paying attention.&#8221;</p>
<p>Doch BPMN hat aus meiner Sicht Vorteile gegenüber BPEL, dies sind vor allem:</p>
<ul>
<li>Kontrollfluß als Graph: Man kann also tatsächlich fachlich modellieren und das direkt ausführen. Natürlich bringt das Probleme für Process Engine Hersteller mit sich (es hat ja seine Gründe, warum es BPEL gab), ich finde jedoch, sollen sich lieber Hersteller damit rumschlagen als der Nutzer der Werkzeuge!</li>
<li>Grafische Notation entspricht den fachlichen Modellen: Mit BPMN hat man in der technischen die gleiche Notation wie in der fachlichen Modellierun. Ich will damit nicht sagen, dass man das gleiche Modell verwendet (daran glauben wir nicht so richtig, auch das begründen wir ausführlich im Buch). Aber die Modelle sind sich ähnlich und Business und IT sprechen die gleiche Sprache (BPMN).</li>
<li>Keine feste Bindung an Webservices und XML: Auch wenn es die Standardeinstellungen sind, BPMN kann jede Technoligie ausführen. Damit können BPMN Engines auch in Szenarien und Architekturen zum Einsatz kommen, wo BPEL bisher ungeeignet war.</li>
</ul>
<p><strong>BPMN 2.0 &#8211; ist das was für mich? Sollte ich auf BPEL setzen oder abwarten?</strong></p>
<p>Mit diesen Fragen sind wir zur Zeit häufig konfrontiert. Und dies ist verständlich. Das Investment in eine Process Engine ist groß, das Tool wird einen lange Jhre begleiten und nicht selten die gesamte Unternehmens-IT-Infrastruktur mit prägen. BPEL galt als führender Standard hat in Projekten aber oft enttäuscht. Proprietäre Ansätze sind zwar häufig sehr gut, können oder wollen aber politisch nicht durchgesetzt werden.</p>
<p>Und jetzt kommt da BPMN 2.0. Wird jetzt alles besser? Sollte man eventuell auf eine BPMN 2.0 Engine warten? Oder noch BPEL kaufen? Oder was ganz anderes machen? Oder oder oder?</p>
<p>Zu diesem Thema entwickeln wir gerade einen Webcast. Sind Sie interessiert an diesem Thema? Würden Sie daran gerne teilnehmen? Dann sprechen Sie uns an! Teilen Sie uns mit welche Fragen Sie beschätigen. Wir versuchen eine Antwort zu finden&#8230; Denn den Kopf in den Sand stecken nützt ja nichts <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-191' /> </p>
<p><strong>Und das Buch?</strong></p>
<p>Ach ja, das Buch. Wie bei Büchern so üblich sind wir leider etwas hinter dem Zeitplan. Irgendwie muss man dann ja doch auch noch etwas arbeiten, so nebenbei. Wir sind jedoch zuversichtlich, dass Manuskript bald &#8211; endlich &#8211; abgeben zu können. Abonnieren Sie doch unseren Newsletter, dann bekommen Sie den Erscheinungstermin auf jeden Fall mit!</p>
<p>Sollten Sie Feedback zu diesem Artikel, der Ausführungssemanik oder meinen Beispielen haben noch einmal der Aufruf: Melden Sie sich einfach! Sie können vielleicht noch das Buch beeinflussen <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-191' />  Gerne als Kommentar oder per Email: bernd.ruecker@camunda.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/08/02/bauen-wir-uns-eine-bpmn-20-engine/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ein kleiner jBPM 4 Showcase</title>
		<link>http://www.bpm-guide.de/2009/07/08/ein-kleiner-jbpm-4-showcase/</link>
		<comments>http://www.bpm-guide.de/2009/07/08/ein-kleiner-jbpm-4-showcase/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 13:43:17 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[jBPM]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=136</guid>
		<description><![CDATA[Wie versprochen möchte ich pünktlich zum Release der Version 4 der Open Source Process Engine JBoss jBPM am Freitag, den 10.07.2009, gleich einen kleinen Showcase berschreiben. Diesen Showcase habe ich auch bei meinem Vortrag auf dem Java Forum Stuttgart gezeigt und er wird auch nochmals genauer in einem bald erscheinenden JavaMagazin-Artikel erläutert. Gebaut habe ich [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/istock_000004620129small.jpg"><img class="alignleft size-thumbnail wp-image-137 colorbox-136" style="margin: 5px; float: left;" title="Crazy Bag" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/istock_000004620129small-150x129.jpg" alt="" width="150" height="129" /></a>Wie versprochen möchte ich pünktlich zum Release der Version 4 der Open Source Process Engine JBoss jBPM am Freitag, den 10.07.2009, gleich einen kleinen Showcase berschreiben. Diesen Showcase habe ich auch bei meinem <a href="http://www.bpm-guide.de/2009/07/05/presentation-zen-auf-dem-jfs/">Vortrag auf dem Java Forum Stuttgart</a> gezeigt und er wird auch nochmals genauer in einem bald erscheinenden <a href="http://it-republik.de/jaxenter/java-magazin/" target="_blank">JavaMagazin</a>-Artikel erläutert. Gebaut habe ich ihn mal zwischendruch mit dem so genannten Candidate Relase.</p>
<p>Konkret geht es um einen kleinen Shop, der Designertaschen herstellt. Der Prozess dahinter soll nun mit jBPM automtatisiert werden.</p>
<p><span id="more-136"></span></p>
<p>An dieser Stelle möchte ich mich kurz fassen und lediglich  Showcase und Quellcode dazu vorstellen. Eine detailliertere Beschreibung folgt wie gesagt im JavaMagazin.</p>
<p>Also steigen wir sofort ein, folgender Prozess wurde ausgetüftelt:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/beispielprozess.png"><img class="alignnone size-full wp-image-138 colorbox-136" title="jbpm4-beispielprozess" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/beispielprozess.png" alt="" width="500" height="204" /></a></p>
<p>Es ist zu sehen, dass jBPM 4 nun auch mit den BPMN-Shapes arbeitet. Auch kann man bereits einige Activity-Typen (=Knotentypen)  erkennen, wie zum Beispiel menschliche Interaktion, Wartezustände oder auch &#8220;Serviceaufrufe&#8221; als Referenz auf Java-Methoden.</p>
<p>Dahinter liegt natürlich ein Prozess als XML-Datei:</p>
<pre>&lt;process name="Bestellung" xmlns="http://jbpm.org/4.0/jpdl"&gt;
   &lt;start g="118,152,48,48" name="start1"&gt;
      &lt;transition to="Bestellung_pruefen"/&gt;
   &lt;/start&gt;
   &lt;task candidate-groups="Lager" g="191,149,109,52" name="Bestellung_pruefen"&gt;
      &lt;transition g="267,103:-3,27" name="Problem aufgetreten" to="Alternativvorschlag_erarbeiten" /&gt;
      &lt;transition g="268,236:0,-25" name="Auftrag OK" to="Bestellung_buchen"/&gt;
   &lt;/task&gt;
   &lt;task candidate-groups="Designer" g="289,77,174,52" name="Alternativvorschlag_erarbeiten"&gt;
      &lt;transition to="Kunden_informieren"/&gt;
   &lt;/task&gt;
   &lt;java class="com.camunda.training.jbpm.service.MockService" g="482,79,119,52" method="informCustomer" name="Kunden_informieren"&gt;
		&lt;arg&gt;&lt;object expr="#{order.customer}"/&gt;&lt;/arg&gt;
		&lt;arg&gt;&lt;object expr="#{problem}"/&gt;&lt;/arg&gt;
		&lt;arg&gt;&lt;object expr="#{message}"/&gt;&lt;/arg&gt;
		&lt;arg&gt;&lt;object expr="#{order.orderedItem}"/&gt;&lt;/arg&gt;
		&lt;arg&gt;&lt;object expr="#{execution.id}"/&gt;&lt;/arg&gt;
      &lt;transition to="Auf_Entscheidung_warten"/&gt;
   &lt;/java&gt;
   &lt;state g="625,80,150,52" name="Auf_Entscheidung_warten"&gt;
      &lt;transition to="Stornierung?"/&gt;
   &lt;/state&gt;
   &lt;decision g="804,84,48,48" name="Stornierung?"&gt;
      &lt;transition g="828,43;245,43:247,-19" name="Alternativvorschlag bestellen" to="Bestellung_pruefen"&gt;
          &lt;condition expr="#{orderChanged}"/&gt;
      &lt;/transition&gt;
      &lt;transition g="-26,-18" name="Stornierung" to="cancel"/&gt;
   &lt;/decision&gt;
   &lt;java class="com.camunda.training.jbpm.service.MockService" g="329,210,122,52" method="bookOrder" name="Bestellung_buchen"&gt;
   		&lt;arg&gt;&lt;object expr="#{order}"/&gt;&lt;/arg&gt;
      &lt;transition to="Ware_produzieren"/&gt;
   &lt;/java&gt;
   &lt;task candidate-groups="Arbeiter" g="486,212,113,52" name="Ware_produzieren"&gt;
      &lt;transition to="Warten_auf_Versand"/&gt;
   &lt;/task&gt;
   &lt;state g="640,213,121,52" name="Warten_auf_Versand"&gt;
      &lt;transition to="end"/&gt;
   &lt;/state&gt;
   &lt;end g="886,216,48,48" name="end"/&gt;
   &lt;end-cancel g="884,85,48,48" name="cancel"/&gt;
&lt;/process&gt;</pre>
<p><strong>Die Beispielanwendung</strong><br />
<a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-1.png"><img class="alignnone size-full wp-image-139 colorbox-136" title="jbpm4-showcase-1" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-1.png" alt="" width="500" height="530" /></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-1.png"><br />
</a></p>
<p>Um eine Betsellung aufzugeben, also eine Prozessinstanz zu starten, wurde ein kleiner PHP-Shop implementiert. Dabei habe ich <a href="http://www.caucho.com/resin-3.0/quercus/">Quercus</a> verwendet, so dass ich PGP-Seiten direkt auf dem JBoss deployen kann und in PHP auch Java-Code einbetten kann. Warum? Einfach weil es sich cool anhörteund ich es auch mal kurz ausprobieren wollte <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-136' /> . Obenist die resultierende Bestellseite abgebildet, die mir unser Studi Christian dankenswerter Weise fix mal aufgehübscht hat.</p>
<p>Klickt man auf den Bestellbutton wird dabei folgender Code ausfgeführt, zugegeben eine etwas unschöne Mischung aus Java und PHP, aber für einen schnellen Prototypen denke ich ganz nett. Quercus beherrscht es nämlich, Java-Code direkt einzubetten, eigentlich wird sogar der gesammte PHP-Code in Java-Bytecode übersetzt.</p>
<pre>import org.jbpm.api.Configuration;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessEngine;
import java.util.HashMap;
import com.camunda.training.jbpm.domain.Customer;
import com.camunda.training.jbpm.domain.Order;

$conf = new Configuration();

$processEngine = $conf-&gt;buildProcessEngine();
$executionService = $processEngine-&gt;getExecutionService();

$order = new Order();
$order-&gt;setOrderedItem( $_GET['orderedItem'] );
$order-&gt;setPrice(99.95);
$order-&gt;setCustomer(new Customer());
$order-&gt;getCustomer()-&gt;setName( $_GET['customer_name'] );
$order-&gt;getCustomer()-&gt;setEmail( $_GET['customer_email'] );
$order-&gt;getCustomer()-&gt;setAddress( $_GET['customer_address'] );

$variables = new HashMap();
$variables-&gt;put("order", $order);

// start process instance
$pi = $executionService-&gt;startProcessInstanceByKey("Bestellung", $variables);</pre>
<p>Mehr ist nicht notwendig. Man kann auch sehen, dass in diesem Fall die Bestellung als Java-Objekt als Prozessvariablen übergeben wird. Die entstandene Prozessinstanz kann man sich über die in jBPM 4 mitgelieferte Webcoonsole (Google WebToolkit) auch gleich anschauen, sogat grafisch mit Markierung, wo im Prozessablauf sich die Instanz aktuell befindet:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-2.png"><img class="alignnone size-full wp-image-140 colorbox-136" title="jbpm4-showcase-2" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-2.png" alt="" width="500" height="341" /></a></p>
<p>Die aktive Aufgabe &#8220;Bestellung_pruefen&#8221; ist in diesem Fall ein Human Task, also wird eine Aufgabe in der so genannten Task Liste erstellt. Im Showcase wird sie zuerst der Gruppe &#8220;Lager&#8221; zugerodnet (siehe candidate-group Attribut im XML) und erscheint auf der Gruppen Task Liste. Von dort muss sich dier User die Aufgabe zuerst &#8220;ziehen&#8221; (claim). To claim heißt in diesem Fall, dass ich mir die Aufgabe hole. Damit verschwindet sie von der Gruppenliste und wandert in meine persönliche Task Liste.</p>
<p>Dort kann dann auch ein Formular geöffnet werden um die Aufgabe zu bearbeiten. Aktuell ist das Formular in der Webconsole ein <a href="http://freemarker.org/">Freemarker</a>-Template, wobei der Dateiname dem Activtiy-Namen entsprechen muss. Dies ist übrigens der Grund, warum im Showcase die Aktivitätsnamen mit Unterstrichen und ohne Umlaute arbeiten <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-136' />  Dies soll allerdings in Zukunft verbessert werden, so dass für eine Aktivität konfiguriert werden kann, welches Formular verwendet wird. Dies ermöglicht es dann auch, das gleiche Formular für verschiedene Aufgaben zu verwenden. Der folgende Screenshot verdeutlicht dies:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-3.png"><img class="alignnone size-full wp-image-141 colorbox-136" title="jbpm4-showcase-3" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-3.png" alt="" width="500" height="360" /></a></p>
<p>Nehmen wir den einfachen Fall an, benötigte Rohwaren sind im Lager und die Tasche kann folglich produziert werden, dann würde der Lager-Sachbearbeiter hier auf &#8220;Auftrag OK&#8221; klicken. Damit wird der Prozess den &#8220;unteren&#8221; Weg weiter laufen und in &#8220;Ware_produzieren&#8221; ankommen. Dort würde nun der Designer die Aufgabe in seine Workliste bekommen. Dies habe ich mir als Screenshot an dieser Stelle gespart.</p>
<p>Ist die Ware produziert, muss sie versendet werden. Mit vielen Kunden hatten wir schon die Diskussion, ob dies ein Task oder ein einfacher Wartezustand ist. Ich denke, es kommt darauf an, wie man arbeitet. Soll tatsächlich ein Mitarbeiter auf Grund der fertig gestellten Tasche aktiv loslaufen, diese abholen und verschicken, dann wäre es eine astreine Aufgabe. denn wir müssen dies dem Mitarbeiter ja über seine Aufgabenliste mitteilen.</p>
<p>Wird aber hingegen die Tasche auf eine Palette gelegt und der Versand verschickt diese gesammelt am Nachmittag, dann finde ich ist es aus Sicht des Prozesses ein Wartezustand. Denn wir warten auf das externe Ereignis, dass der erfolgreiche Versand gemeldet wird. Um den Versand zurück zu melden haben wir also nicht die Task Liste als Oberfläche sondern einen eigenen Mechanismus. Im Idealfall würde die Software des Logistikers (DHL o.ä.) diese Rückmeldung automatisch ausgeben und wir könnten es elektronisch importieren. Im Showcase habe ich aber einfach eine simple Oberfläche gebastelt, die alle Prozesse im Zustand &#8220;Warten_auf_Versand&#8221; ausgibt, so dass versendete Pakete einfach quittiert werden können:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-4.png"><img class="alignnone size-full wp-image-142 colorbox-136" title="jbpm4-showcase-4" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase-4.png" alt="" width="500" height="336" /></a></p>
<p>Die ausgewählten Prozessinstanzen werden dann weiter getriggert und in unserem Fall wird der Bestellprozess beendet.</p>
<p><strong>Historische Prozessinstanzen</strong></p>
<p>Vor allem für die Umsteiger von jBPM 3 sei an dieser Stelle erwähnt, dass die neue Version anders tickt. Wird eine Prozessinstanz beendet so wird sie aus der Tabelle der aktiven Instanzen gelöscht und komplett in History-Tabellen verschoben. Dies löst das alte Problem, dass die jBPM-tabellen rasant voll werden, wenn viele Prozesse gestartet werden. Das würde bei unserem Taschen-Designer sicher kein Problem (sonst wäre er glaube ich sehr reich <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-136' /> ), kann aber in großen Umgebungen durchaus spannend werden.</p>
<p><strong>Fazit &amp; Download</strong></p>
<p>Der Blog-Post hat jetzt nicht die Hintergründe und Neuerungen in jBPM 4 erläutert. Dafür bitte ich, sich bis zum Erscheinen des JavaMagazin-Artikels zu gedulden. Ziel war es, einen einfachen Showcase kurz darzustellen. Ich hoffe, dass ich dies erreichen konnte.</p>
<p>jBPM 4 selbst ist eine sehr interessante Weiterentwicklung der bekannten Open Source Process Engine, die sich in einigen Punkten bedeutend weiter entwickelt hat (Stichworte: Process Virtual Machine (PVM), API, BPMN). Allerdings muss man auch anmerken, dass aktuell noch nicht alle Features der 3er Version unterstützt werden. Auch muss sich die Stabilität in größeren Umgebungen noch bewären, da die Engine eben ganz frisch ist und nunmal eine Neuentwicklung darstellt (Code aus jBPM 3 wurde kaum wieder verwendet da die interne Architektur stark umgebaut wurde). Man sollte der neuen Version also noch ein paar Monate Zeit geben alle Features nachzuziehen und Kinderkrankheiten zu beseitigen.</p>
<p>Nichtsdestotrotz ist die Dokumentation jetzt schon sehr gut und auch die Test-Suite sehr umfangreich. Erstmals sind beispielsweise auch gute Tests zu Concurrency-Problemen und ähnliches enthalten. Die neue Version ist also auf jeden Fall cool und wird ganz sicher noch spannend! An Feedback und Meinungen sind wir natürlich dabei auch immer interessiert.</p>
<p>Der Showcase zum Runterladen findet sich hier:<a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase.zip">jbpm4-showcase.</a> Es muss lediglich die <strong>build.xml mit dem richtigen JBoss-Pfad angepasst</strong> werden. Auch muss natürlich quercus installiert werden, damit die PHP-Seiten funktionieren. Okay, das ist vielleicht ein bisschen uncool an der Lösung, sorry! Trotzdem viel Spaß beim ausprobieren.<a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jbpm4-showcase.zip"><br />
</a></p>
<p>Und sollte ich irgendwann keine Lust mehr haben auf die Informatik hab ich somit auch gleich schon mal ein Ausweichgeschäft <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-136' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/07/08/ein-kleiner-jbpm-4-showcase/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Presentation Zen auf dem JFS</title>
		<link>http://www.bpm-guide.de/2009/07/05/presentation-zen-auf-dem-jfs/</link>
		<comments>http://www.bpm-guide.de/2009/07/05/presentation-zen-auf-dem-jfs/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 08:44:32 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Vorträge]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[Vortrag]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=132</guid>
		<description><![CDATA[Auf dem Java Forum Stuttgart 2009 hatte ich das Vergnügen die Open Source Process Engine JBoss jBPM 4 vorstellen zu dürfen. Erstmalig habe ich mich dabei vom Presentation Zen inspirieren lassen und den Bulletpoints den Kampf angesagt. Das Ergebnis lässt sich hier bewundern: Folien bei Slideshare. Prinzipiell muss ich sagen, dass mir die Arbeit mit [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/07/jfs2009.jpg"><img class="alignleft size-full wp-image-134 colorbox-132" title="Java Forum Stuttgart 2009" src="http://www.bpm-guide.de/wp-content/uploads/2009/07/jfs2009.jpg" alt="" width="125" height="125" /></a>Auf dem<a title="Java Forum Stuttgart" href="http://www.java-forum-stuttgart.de/" target="_blank"> Java Forum Stuttgart 2009</a> hatte ich das Vergnügen die Open Source Process Engine <a href="http://www.jboss.org/jbossjbpm/">JBoss jBPM 4</a> vorstellen zu dürfen. Erstmalig habe ich mich dabei vom <a href="http://www.presentationzen.com">Presentation Zen</a> inspirieren lassen und den Bulletpoints den Kampf angesagt. Das Ergebnis lässt sich hier bewundern: <a href="http://www.slideshare.net/camunda/jboss-jbpm-4">Folien bei Slideshare</a>.</p>
<p>Prinzipiell muss ich sagen, dass mir die Arbeit mit dieser Art Folien sehr viel Spaß gemacht hat. Auch den ca. 130 Teilnehmern im Saal hat es wohl gut gefallen, ich habe sehr viel positives Feedback bekommen. Und das trotz der morgendlichen Stunde.<span id="more-132"></span></p>
<p>Nachteilig (vorsicht Ironie) ist nun beim Presentation Zen nur, dass man mit seinen Folien eine gute Story aufbauen sollte und wissen muss, was man erzählen will. Also: Man muss was zu sagen haben <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-132' /> </p>
<p>Wer nicht live dabei sein konnte dem bleibt die Möglichkeit, die überarbeitete Version 2 des Vortrags auf dem <a href="http://www.herbstcampus.de/">Herbstcampus der Mathema</a> zu hören oder aber auch die vermutlich etwas umfangreichere Version mit mehr Diskussionsmöglichkeiten am 23.09.2009 bei der <a href="http://www.jughh.org/">Java User Group Hamburg</a>.</p>
<p>Mir bleibt zu sagen, dass ich den Showcase aus dem Vortrag in den nächsten 3 Wochen entsprechend noch hier posten werde, versprochen. Ich muss da sowieso noch so einen Artikel fürs <a href="http://www.javamagazin.de" target="_blank">JavaMagazin </a>schreiben&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/07/05/presentation-zen-auf-dem-jfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JBoss jBPM &amp; Drools bei der Java User Group Berlin</title>
		<link>http://www.bpm-guide.de/2009/02/14/jboss-jbpm-drools-bei-der-java-user-group-berlin/</link>
		<comments>http://www.bpm-guide.de/2009/02/14/jboss-jbpm-drools-bei-der-java-user-group-berlin/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 10:32:22 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[Vorträge]]></category>
		<category><![CDATA[BPM und Business Rules]]></category>
		<category><![CDATA[camunda live]]></category>
		<category><![CDATA[Drools]]></category>
		<category><![CDATA[jBPM]]></category>
		<category><![CDATA[Rule Engine]]></category>
		<category><![CDATA[Vortrag]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=86</guid>
		<description><![CDATA[Am 04. Februar 2008 habe ich in Berlin bei der Java User Group Berlin Brandenburg (JUG-BB) einen Vortrag über BPM und Business Rules mit den Open Source Frameworks JBoss jBPM und JBoss Drools gehalten. Trotz dem ich gesundheitlich etwas angeschlagen war, haben wir das Ganze noch ganz gut geschaukelt. Mit ca. 60 Leuten war die [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/02/20090204_001.jpg"><img class="alignleft size-medium wp-image-87 colorbox-86" style="margin: 5px; float: left;" title="Bernd Rücker bei der JUG-BB" src="http://www.bpm-guide.de/wp-content/uploads/2009/02/20090204_001-300x200.jpg" alt="" width="300" height="200" /></a>Am 04. Februar 2008 habe ich in Berlin bei der J<a href="http://www.jug-bb.de/">ava User Group Berlin Brandenburg (JUG-BB)</a> einen Vortrag über BPM und Business Rules mit den Open Source Frameworks JBoss jBPM und JBoss Drools gehalten.</p>
<p>Trotz dem ich gesundheitlich etwas angeschlagen war, haben wir das Ganze noch ganz gut geschaukelt. Mit ca. 60 Leuten war die Kapazität des Vortragsraumes auch ausgelastet, Gerüchten zufolge wären auch gerne noch mehr gekommen.</p>
<p><span id="more-86"></span></p>
<p>Ich habe mich sehr gefreut, dass das Thema entsprechend Interesse anzieht und durfte auf ein interessiertes Publikum mit vielen Fragen treffen, die oft auch durch einen kleinen Exkurs in den Quellcode beantwortet werden konnten. Somit hat es mir auf jeden Fall viel Spaß gemacht!</p>
<p>Ein paar Bilder finden sich auf der &#8220;offiziellen&#8221; Nachlese von Ralph Bergmann, der die JUG-BB organisiert: <a href="http://www.jug-bb.de/2009/02/nachlese-jboss-jbpm-und-drools/">http://www.jug-bb.de/2009/02/nachlese-jboss-jbpm-und-drools/</a>.</p>
<p>Wie versprochen sind hier nun auch die Folien zum Vortrag:</p>
<div id="__ss_1027087" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="JBoss jBPM und Drools - Geschäftsprozesse und Regeln mit Open Source Java" href="http://www.slideshare.net/camunda/jboss-jbpm-und-drools-geschftsprozesse-und-regeln-mit-open-source-java?type=presentation">JBoss jBPM und Drools &#8211; Geschäftsprozesse und Regeln mit Open Source Java</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=20090204-jbpm-und-drools-jugs-bb-1234607086690459-1&amp;stripped_title=jboss-jbpm-und-drools-geschftsprozesse-und-regeln-mit-open-source-java" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=20090204-jbpm-und-drools-jugs-bb-1234607086690459-1&amp;stripped_title=jboss-jbpm-und-drools-geschftsprozesse-und-regeln-mit-open-source-java" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/camunda">camunda</a>. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/jbpm">jbpm</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/drools">drools</a>)</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/02/14/jboss-jbpm-drools-bei-der-java-user-group-berlin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ein erster Blick auf jBPM 4</title>
		<link>http://www.bpm-guide.de/2009/01/26/ein-erster-blick-auf-jbpm-4/</link>
		<comments>http://www.bpm-guide.de/2009/01/26/ein-erster-blick-auf-jbpm-4/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 20:22:16 +0000</pubDate>
		<dc:creator>Bernd Rücker</dc:creator>
				<category><![CDATA[jBPM]]></category>

		<guid isPermaLink="false">http://www.bpm-guide.de/?p=70</guid>
		<description><![CDATA[Lange hat es gedauert und teilweise gespannt wurde es erwartet: Die Version 4 der bekannten Open Source Business Process Engine jBPM aus dem Hause JBoss. Jetzt wurde die erste alpha Version veröffentlicht. Daher habe ich gleich mal einen Beispielprozess mit jBPM 4 umgesetzt und die Version etwas genauer unter die Lupe genommen. Die Prozessbeschreibungssprache jPDL [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-ticket-bpd.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket-state-choice.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-end.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-state-choice.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide2.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide1.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-end.png"></a><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-end.png"></a><img class="alignleft colorbox-70" src="http://www.jboss.org/file-access/default/members/jbossjbpm/images/jbpm_logo.png" alt="jbpm logo" width="241" height="115" />Lange hat es gedauert und teilweise gespannt wurde es erwartet: Die Version 4 der bekannten Open Source Business Process Engine jBPM aus dem Hause JBoss. Jetzt wurde die erste alpha Version veröffentlicht.</p>
<p>Daher habe ich gleich mal einen Beispielprozess mit jBPM 4 umgesetzt und die Version etwas genauer unter die Lupe genommen.</p>
<p><span id="more-70"></span></p>
<p>Die Prozessbeschreibungssprache jPDL (jBPM Process Definition Language) sowie die technische Grundlage der Prozessmaschine hat sich in Version 4 stark verändert. Dies ist einigen Neuerungen geschuldet: Der Einführung der <a href="http://www.jboss.org/jbossjbpm/pvm/" target="_blank">Process Virtual Machine (PVM)</a>, die Anlehnung an die <a href="http://www.bpmn.info/" target="_blank">Business Process Modelling Notation (BPMN)</a>, die Einführung einer möglichst generischen API für Process Engines als natürlich auch zahlreiche Verbesserungen auf Grund der Erfahrungen mit jBPM 3.</p>
<p><strong>Beispielprozess</strong></p>
<p>Doch eins nach dem anderen, zu erst einmal möchte ich ein Beispielprozess aus <a href="https://www.camunda.com/seminare/ca002.html">einem unserer Trainings</a>, einen einfachen Ticketprozess, kurz vorstellen. Dazu einmal der Prozess als BPD (BPMN-Diagramm):</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-ticket-bpd.png"><img class="alignnone size-medium wp-image-71 colorbox-70" title="Ticketprozess als BPD" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-ticket-bpd-300x102.png" alt="Ticketprozess als BPD" width="300" height="102" /></a></p>
<p>Ein Kunde kann für ein Problem ein Ticket aufmachen. Ist für den Kunden noch kein Betreuer festgelegt wird dies nachgeholt. Dann bekommt der Betreuer die Aufgabe zugewiesen. Hat er sie abgeschlossen bekommt der Kunde eine E-Mail und muss bestätigen, dass sein Problem gelöst wurde. Andernfalls bekommt der Betreuer die Aufgabe erneut auf den Tisch.</p>
<p><strong>Installation</strong></p>
<p>Also frisch ans Werk mit jbpm 4. Die Installation beschränkt sich aktuell eigentlich auf die Integration in Eclipse, da Deployments für JBoss AS oder Tomcat noch nicht zur Verfügung stehen. Daher beschränkt sich auch das Testen noch auf JUnit&#8230; Dank mitgelieferter guter Doku ging die Installation trotz Eclipse (sorry, es ist einfach nicht mein Lieblingstool <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-70' /> ) gut von der Hand.</p>
<p><strong>Der neuen Designer und BPMN</strong></p>
<p>Der neue grafische Prozessdesigner (GPD) überrascht sofort mit einer grafisch ansprechenden BPMN-Darstellung der Prozesse. Allerdings sind in der aktuellen Version auch nur ein Bruchteil der existierenden BPMN-Elemente umgesetzt und manche sogar falsch verwendet, doch dazu später mehr. Viele fehlende Kleinigkeiten, wie beispielsweise die XML-Ansicht oder eine Möglichkeit Properties einzugeben, kennzeichnen den Designer noch deutlich als unfertig, aber das ist in einer alpha Version schließlich ok.</p>
<p>Ein erster Wurf des Ticketprozesses führt zu folgendem Ergebnis:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket.png"><img class="alignnone size-medium wp-image-81 colorbox-70" title="Ticketprozess im jBPM 4" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket-300x142.png" alt="Ticketprozess im jBPM 4" width="300" height="142" /></a></p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket.png"></a></p>
<p>Das ist ja auch schon sehr ansehlich <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-70' />  Auch wenn einige Kleinigkeiten noch nicht perfekt sind, so z.B.:</p>
<ul>
<li>An den Gateways (Verzweigungen) wird keine Beschriftung angezeigt, auch die ausgehenden Kanten können aktuell nicht beschriftet werden,</li>
<li>Zeilenumbruche in den Aktivitäten sind nicht möglich, was ein Modellieren von links nach rechts, wie in BPDs oft üblich, erschwert wird,</li>
<li>Pools und Lanes sind nicht möglich.</li>
</ul>
<p>Hier bleibt abzuwarten, was bis zum Release noch alles verbessert wird und wie die entgültige Version aussieht.</p>
<p>Schlimmer finde ich einige Verletzungen der BPMN-Spezifikation die in jBPM 4 versteckt sind. Leider ist es heute wohl etwas hip die grafischen BPMN-Symbole (BPMN-Shapes) zu verwenden es aber mit der Spezifikation nicht ganz so genau zu nehmen, da ist jBPM übrigens in guter Gesellschaft vieler andere Tools. Aus meiner Sicht ist dieses Vorgehen jedoch mehr als unschön, denn der Zweck der Spezifikation ist ja genau die exakte Definition hinter den Symbolen. Hier bin ich aktuell auch noch in der Diskussion mit dem jBPM-Team, auch hier werden wir sehen, wie es in der finalen Version aussieht.</p>
<p>Aber was habe ich denn eigentlich zu meckern. Ich möchte drei konkrete Beispiele anführen:</p>
<p>Ausgehende Sequenzflüsse (Flows, Transitionen) in Activities. Die jBPM-Dokumentation sagt hier:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-state-choice.png"><img class="alignnone size-medium wp-image-73 colorbox-70" title="jBPM 4 \" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-state-choice-300x136.png" alt="jBPM 4 \" width="300" height="136" /></a></p>
<p>Dies bedeutet, dass jBPM sich zwischen den zwei ausgehenden Flows für genau einen entscheidet, also eine so genannte XOR-Semantik. Die BPMN-Spezifikation definiert allerdings eine AND-Sematik, also alle ausgehenden Flows werden feuern, außer sie enthalten Bedingungen die nicht erfüllt sind. Was jBPM umsetzt müsste eigentlich korrekterweise als Activity mit folgendem XOR modelliert werden, so wie es in meinem Beispiel oben gezeigt ist. Wird nach der jBPM-Empfehlung gearbeitet aber ohne Gateway nach &#8220;Problem bearbeiten&#8221; auskommen:</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide2.png"><img class="alignnone size-medium wp-image-80 colorbox-70" title="jbpm4 vs. BPMN - Kritik 2" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide2-300x227.png" alt="jbpm4 vs. BPMN - Kritik 2" width="300" height="227" /></a></p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jpdl4-ticket-state-choice.png"></a></p>
<p>Letzteres ist ganz in bekannter jBPM-Manier und eigentlich sowohl intuitiv als auch in der jBPM-Gemeinde bekannt. Aber es entspricht eben nicht wirklich genau der Spec und ist damit schnell mißverständlich.</p>
<p>Ein weiteres, wenn auch nicht ganz so relevantes Problem, ist in folgender Abbildung visualisiert: jBPM kennt kein zusammenführendes exklusives Gateway (also quasi ein &#8220;OR-Join&#8221; <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-70' /> ). Bei einem exklusiven Gateway wird immer eine Entscheidung erwartet, welcher ausgehende Flow durchlaufen werden soll. Was logisch ist, wenn man weiß, dass dieses Gateway in jBPM die dort bisher so genannte Decision abgelöst hat. Es im Sinne der BPMN zu verwenden erfordert zumindest einen Workaround.</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide1.png"><img class="alignnone size-medium wp-image-79 colorbox-70" title="jbpm4 vs. BPMN - Kritik" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-bpmn-kritik-slide1-300x227.png" alt="jbpm4 vs. BPMN - Kritik" width="300" height="227" /></a></p>
<p>Ein dritter Kritikpunkt ist, dass das terminierende Ende-Ereignis (Der Endknoten mit dem ausgefüllten Punkt) sowohl eine gesammte Prozessinstanz terminieren kann (korrekt!) als auch einen einzelnen Ausführungspfad, beispielsweise in einem Fork (nicht korrekt! Dafür gibt es das &#8220;normale&#8221; Ende-Ereignis).</p>
<p><a href="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-end.png"><img class="alignnone size-medium wp-image-74 colorbox-70" title="jbpm 4 end events" src="http://www.bpm-guide.de/wp-content/uploads/2009/01/jbpm4-kritik-end-300x181.png" alt="jbpm 4 end events" width="150" /></a></p>
<p>Insgesamt noch kein Weltuntergang, aber trotzdem hoffe ich, dass sich hier noch eine korrektere Abbildung der Spezifikation durchsetzt, ich werde es auf jeden Fall anregen. Und schließlich ist bis zur finalen Version auch noch ein bisschen Zeit.</p>
<p><strong>jPDL &#8211; Neuerungen</strong></p>
<p>Der modellierte Prozess wird im Hintergrund direkt als jPDL im XML-Format abgespeichert. Das XML ist prinzipiell noch mit dem aus jBPM 3 bekannten Format vergleichbar, jedoch gibt es einige Unterschiede:</p>
<ul>
<li>Veränderte Namensgebung, an der BPMN orientiert: Transitionen heißen jetzt &#8220;flow&#8221;, &#8220;decision&#8221; wird zu &#8220;gateway&#8221; usw&#8230;</li>
<li>Die grafischen Layoutinformationen, in jBPM 3 im gpd.xml abgespeichert, sind jetzt direkt im gleichen XML zu finden,</li>
<li>Es gibt speziell definierte Aktivitäten beispielsweise für die Ausführung von Java-Code. Ementsprechend gibt es dann ein &#8220;java&#8221;-Element.</li>
</ul>
<p>Am einfachsten zeige ich hier den oben modellierten Prozess einmal als Quellcode, ein Beispiel sagt schließlich mehr als hundert Worte. Der Prozess ist dabei nur äußert rudimentär ausmodelliert (ich sollte dazusagen, dass ich gerade im Hotel sitze und der Pool ruft), aber bereits lauffähig (Test-Code folgt unten). Auch ist dort mein Workaround für das schließende exklusive Gateway eingebaut.</p>
<pre>&lt;process xmlns="http://jbpm.org/4/jpdl" name="TicketProcess"&gt;
   &lt;start name="Start" g="15,146,48,48"&gt;
      &lt;flow to="Kundenbetreuer bekannt?"/&gt;
   &lt;/start&gt;
   &lt;exclusive name="Kundenbetreuer bekannt?" g="84,144,48,48"&gt;
      &lt;flow to="Kundenbetreuer festlegen" g="108,24"&gt;
      	&lt;condition expr="#{false}"/&gt;
      &lt;/flow&gt;
      &lt;flow to="join"&gt;
      	&lt;condition expr="#{true}"/&gt;
      &lt;/flow&gt;
   &lt;/exclusive&gt;
   &lt;task name="Kundenbetreuer festlegen" g="168,0,153,51"
         assignee="bernd"&gt;
      &lt;flow to="CRM aktualisieren"/&gt;
   &lt;/task&gt;
   &lt;java name="CRM aktualisieren" g="168,72,157,52"
         class="com.camunda.ca002.jbpm.TicketService"
         method="updateCustomer"&gt;
      &lt;flow to="join" g="347,97"/&gt;
   &lt;/java&gt;
   &lt;exclusive name="join" g="324,144,48,48"&gt;
      &lt;flow to="Problem bearbeiten"&gt;
      	&lt;condition expr="#{true}"/&gt;
      &lt;/flow&gt;
   &lt;/exclusive&gt;
   &lt;task name="Problem bearbeiten" g="408,144,133,52"
         assignee="bernd"&gt;
      &lt;flow to="Kunden informieren"/&gt;
   &lt;/task&gt;
   &lt;java name="Kunden informieren" g="564,144,145,52"
         class="com.camunda.ca002.jbpm.TicketService"
         method="notifyCustomer"&gt;
      &lt;flow to="Warten auf Feedback"/&gt;
   &lt;/java&gt;
   &lt;state name="Warten auf Feedback" g="564,216,145,52"&gt;
      &lt;flow to="Problem geloest"/&gt;
   &lt;/state&gt;
   &lt;exclusive name="Problem geloest" g="612,300,48,48"&gt;
      &lt;flow to="join" g="347,324"&gt;
      	&lt;condition expr="#{false}"/&gt;
      &lt;/flow&gt;
      &lt;flow name="yes" to="end"&gt;
      	&lt;condition expr="#{true}"/&gt;
      &lt;/flow&gt;
   &lt;/exclusive&gt;
   &lt;end name="end" g="696,300,48,48"/&gt;
&lt;/process&gt;</pre>
<p>Was hat sich an jPDL verändert: Einiges, aber doch ist auch viel gleich geblieben. Die Entscheidungen, früher &#8220;decision&#8221;, jetzt &#8220;exclusive&#8221; sind eigentlich unverändert. Die bisher bekannten ActionHandler um Java-Code an beliebige Events anzuhängen gibt es in der Form nicht mehr oder sie sind in der Alpha-Version noch nicht verfügbar. Dafür gibt es die &#8220;java&#8221; Aktivität, bei der eine Methode einer Klasse aufgerufen wird, wobei auch Injection, Parameterübergabe und die Verwertung des Rückgabewertes möglich sind. Auf jeden Fall nett, ersetzt aber die ActionHandler meiner Meinung nach noch nicht.</p>
<p><strong>API</strong></p>
<p>Die API hat sich sehr stark verändert. Die Motivation dahinter war nun aber nicht, den Entwicklern das Leben schwer zu machen, sondern die API möglichst unabhängig von der jBPM jPDL Version zu machen. Im Idealfall entsteht dabei eine API, die von der Implementierung der Engine dahinter unabhängig ist. Zugegeben ein heeres Ziel und auch nicht einfach, aber auch ein guter Ansatz. Übrigens ist diese API zu großen Teilen Schuld, dass jBPM 4 sich etwas mehr Zeit gelassen hat, so eine API aufstellen zu wollen und auszudiskutieren kostet einfach seine Zeit.</p>
<p>Prinzipiell gibt es in jBPM nun die &#8220;ProcessEngine&#8221; als zentrale Instanz, von der ich mir Services holen kann, wobei folgende eine zentrale Rolle spielen:</p>
<ul>
<li>ProcessService: Zugriff auf das Prozess-Repository (Prozessdefinitionen)</li>
<li>ExecutionService: Laden, Signalisieren oder verändern von laufenden Prozessinstanzen</li>
<li>TaskService: Zugriff auf Human Tasks</li>
<li>ManagementService: Überwachung und Übersicht über den Status zum Monitoring und Betrieb</li>
<li>(CommandService:) Mit diesem kann ich beliebige Kommandos an jBPM schicken, diese Commands können auch selbst implementiert werden und bieten einen flexiblen Erweiterungspunkt (wie auch bereits in jBPM 3).</li>
</ul>
<p>Wen das ganze übrigens an das <a href="http://www.wfmc.org/reference-model.html" target="_blank">Referenzmodell der WfMC</a> erinnert, das ist kein purer Zufall <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley colorbox-70' /> </p>
<p>Nun aber auch der versprochene JUnit-Test um den Prozess zu testen:</p>
<pre>public void testTicket() {
  deployJpdlResource("TicketProcess.jpdl.xml");

  Execution execution = executionService.startExecutionByKey("TicketProcess");
  String executionId = execution.getId();

  execution = executionService.findExecution(executionId);
  assertEquals("Problem bearbeiten", execution.getNodeName());

  List&lt;Task&gt; taskList = taskService.getPersonalTaskList("bernd", 0, 10);
  assertEquals(1, taskList.size());
  Task task = taskList.get(0);
  assertEquals("Problem bearbeiten", task.getName());
  assertEquals("bernd", task.getAssignee());

  taskService.submitTask(task.getId());

  execution = executionService.findExecution(executionId);
  assertEquals("Warten auf Feedback", execution.getNodeName());

  execution = executionService.signalExecutionById(executionId);

  assertEquals("end", execution.getNodeName());
  assertTrue(execution.isEnded());
  assertFalse(execution.isActive());
}</pre>
<p><strong>Deployment</strong></p>
<p>Die aktuellen Deployment-Optionen sind schnell beschrieben: Es gibt sie noch nicht <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-70' />  Wobei das auch nicht die Intension der alpha-Version war. Natürlich wird jBPM 4 auch wieder auf bekannten Tomcats oder JBossen laufen werden&#8230;</p>
<p><strong>PVM</strong></p>
<p>Last but not least möchte ich zumindest noch auf die unsichtbare, aber sehr wichtige, Änderung hinweisen: Die Einführung der Process Virtual Machine, oder kurz PVM. jBPM hat eingesehen, dass es nicht die eine perfekte Sprache zur Automatisierung von Geschäftsprozessen gibt, sondern für jedes Problem eigene Lösungen bereit stehen. Daher ist Grundlage von jBPM jetzt die PVM, welche nur die notwendigen Kernabstraktionen für einen Zustandsautomaten implementiert. Die jBPM Process Definition Language (jPDL), welche man meist meint, wenn man über jBPM spricht, baut dann auf der PVM auf und implementiert nur die Besonderheiten der Sprache. Man kann es sich so vorstellen, dass die PVM den abstrakten Zustandsautomat beschreibt und jPDL dann die Knotentypen. Infos dazu sind auch in meinem <a href="http://www.camunda.com/content/publikationen/ruecker_process_execution_languages.pdf">JavaSpektrum-Artikel</a> zu finden. Interessant hierbei auch, dass die <a href="http://wiki.bonita.objectweb.org/xwiki/bin/view/Main/Nova" target="_blank">OSS-XPDL-Process Engine von Bull (&#8220;Nova Bonita&#8221;)</a> in der neusten Version auch bereits auf der jBPM PVM basiert.</p>
<p><strong>Fazit</strong></p>
<p>Ich könnte gerade noch viel, viel mehr schreiben, wenn nicht der Tag bald vorbei wäre und der Pool bald zumachte. Auch in Sachen Web-Console, Reporting und BAM tut sich einiges. Viele Innereien im neuen jBPM sind sehr durchdacht und auf jeden Fall mehr als eine Weiterentwicklung. Der Editor macht bereits jetzt einen netten Eindruck und die Unterstützung der BPMN ist prinzipiell begrüßenswert.</p>
<p>Dennoch gibt es auch Wehrmutstropfen: Die Verletzungen der BPMN-Spec oder auch, dass jBPM 4 noch Zeit brauchen wird, bis die Reife und der Funktionsumfang von jBPM 3 erreicht sein wird. Die ApiDoc ist wesentlich besser als in der alten Version, aber auch immer noch lückenhaft. Einige Exceptions beim Herumspielen mit der alpha Version waren nicht unbedingt sofort selbsterklärend. Durch die vielen Änderungen an Klassennamen oder API&#8217;s müssen auch jBPM 3 Cracks auf jeden Fall einiges neu lernen.</p>
<p>Aber ich denke es lohnt sich auf jeden Fall, man muss eben noch ein bisschen Geduld haben. Und das sage ich jetzt nicht nur als Liebhaber und Committer des jBPM-Projektes <img src='http://www.bpm-guide.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley colorbox-70' /> </p>
<p>Über Feedback &amp; Anregungen bin ich sehr dankbar, gerne hier im Blog, per <a href="mailto:bernd.ruecker@camunda.com">Email</a> oder auch im jBPM-Forum. Noch kann Einfluss an jBPM 4 genommen werden!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bpm-guide.de/2009/01/26/ein-erster-blick-auf-jbpm-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

