<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: (j)BPM: where does it fit architecturally?</title>
	<atom:link href="http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/</link>
	<description>Small steps with big feet</description>
	<lastBuildDate>Thu, 09 Sep 2010 15:17:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Joram Barrez</title>
		<link>http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/comment-page-1/#comment-3870</link>
		<dc:creator>Joram Barrez</dc:creator>
		<pubDate>Tue, 15 Sep 2009 20:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.jorambarrez.be/blog/?p=196#comment-3870</guid>
		<description>@Yuri: The PAO approach is something that I&#039;ve used in the past on several jBPM projects. The services should indeed always be stateless. As described in your example, a start could leas to a the creation of a task (=stateless). The completion of that task is again stateless. You&#039;ll notice that in fact BPM operations are a lot like CRUD operation, which means you can treat them like that.

Imo, also the logic gets more natural. Saving an entity (eg an order), will practically always mean starting a new order-process. By putting the save-entity and start-process instance operation together, you get something that is very natural to develop and maintain. I&#039;m speaking out of real-life experience here.

Regarding the business object state problem. This is something I have encountered many, many times. In fact, it is my opinion that every BPM project get to this questions at a certain point in time. So, I have a very clear answer for you:

The state of a business object should always be maintained in the business object itself. There is no need to duplicate this in the workflow (duplicate data is never good). Every process revolves around a certain object. And every object always has a unique ID:

* An order process revolves around an order (orderId)
* A jira-like workflow revolves around a project (projectId)
* ...

In jBPM there is the concept of a &#039;business key&#039;. This key is a process-global unique value and every process instance can (and should!) have a business key. This means that process instances can uniquely be found once you know the business key.

* Give me the process instance for order 15987
* Give me all the tasks open for project 54
* Give me all the tasks from orders that are in the state &#039;submitted&#039; -&gt; select first the ids of the orders, than the processes.

Altough, there is not much literature around this concept, all the jBPM team members agree that using a business key:

1) simplifies your development a lot
2) It gives you great performance (put an index on the business key column and that&#039;s it)
3) Is a simply a BEST PRACTICE when using jBPM

Trust me, I&#039;ve used jBPM before the business key concept was introduced and once you get a lot of processes writing queries was just hell.

Mmmm, while writing this answer I realized that I better should blog about this in the close future. Many people could benefit from this knowlegde. Thanks for triggering me, Yuri !</description>
		<content:encoded><![CDATA[<p>@Yuri: The PAO approach is something that I&#8217;ve used in the past on several jBPM projects. The services should indeed always be stateless. As described in your example, a start could leas to a the creation of a task (=stateless). The completion of that task is again stateless. You&#8217;ll notice that in fact BPM operations are a lot like CRUD operation, which means you can treat them like that.</p>
<p>Imo, also the logic gets more natural. Saving an entity (eg an order), will practically always mean starting a new order-process. By putting the save-entity and start-process instance operation together, you get something that is very natural to develop and maintain. I&#8217;m speaking out of real-life experience here.</p>
<p>Regarding the business object state problem. This is something I have encountered many, many times. In fact, it is my opinion that every BPM project get to this questions at a certain point in time. So, I have a very clear answer for you:</p>
<p>The state of a business object should always be maintained in the business object itself. There is no need to duplicate this in the workflow (duplicate data is never good). Every process revolves around a certain object. And every object always has a unique ID:</p>
<p>* An order process revolves around an order (orderId)<br />
* A jira-like workflow revolves around a project (projectId)<br />
* &#8230;</p>
<p>In jBPM there is the concept of a &#8216;business key&#8217;. This key is a process-global unique value and every process instance can (and should!) have a business key. This means that process instances can uniquely be found once you know the business key.</p>
<p>* Give me the process instance for order 15987<br />
* Give me all the tasks open for project 54<br />
* Give me all the tasks from orders that are in the state &#8216;submitted&#8217; -> select first the ids of the orders, than the processes.</p>
<p>Altough, there is not much literature around this concept, all the jBPM team members agree that using a business key:</p>
<p>1) simplifies your development a lot<br />
2) It gives you great performance (put an index on the business key column and that&#8217;s it)<br />
3) Is a simply a BEST PRACTICE when using jBPM</p>
<p>Trust me, I&#8217;ve used jBPM before the business key concept was introduced and once you get a lot of processes writing queries was just hell.</p>
<p>Mmmm, while writing this answer I realized that I better should blog about this in the close future. Many people could benefit from this knowlegde. Thanks for triggering me, Yuri !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/comment-page-1/#comment-3869</link>
		<dc:creator>Yuri</dc:creator>
		<pubDate>Tue, 15 Sep 2009 19:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.jorambarrez.be/blog/?p=196#comment-3869</guid>
		<description>@Joram, thanks for sharing your thoughts. Interestingly we came to conclusion that it&#039;s not a crime to call the workflow engine from a service.

The &quot;PAO&quot; pattern is not a bad idea of a term to call this approach. Aervices should be stateless by thier nature and when they interact with workflows, they communicate with the outside world.
Example: the save() method of a service starts a new process instance which in turn has a verificaton task. As soon as this proc.instance reaches that task, a new task item appears in the work list of an employee who completes that task (i.e. client app calls service method verify(), which again signals the process to go on) and the workflow runs on to the next node.

Thus the complete state management is independant from the service.


Another interesting point to hear your opinion on would be, is it a good practice to save the state of the object (for example pending-submitted-accepted-removed) not only in the workflow but in an attribute of the business objet itself. If your business object is completely unaware of the workflow it is used in, it is very hard if not impossible to make queries against such objects in order to, say, find all objects in the archived state. If the object itself has no idea of its state, you have to query the associated process instance each time you want to get its state, which means pretty bad performance. Have you had similar requirements in your projects?</description>
		<content:encoded><![CDATA[<p>@Joram, thanks for sharing your thoughts. Interestingly we came to conclusion that it&#8217;s not a crime to call the workflow engine from a service.</p>
<p>The &#8220;PAO&#8221; pattern is not a bad idea of a term to call this approach. Aervices should be stateless by thier nature and when they interact with workflows, they communicate with the outside world.<br />
Example: the save() method of a service starts a new process instance which in turn has a verificaton task. As soon as this proc.instance reaches that task, a new task item appears in the work list of an employee who completes that task (i.e. client app calls service method verify(), which again signals the process to go on) and the workflow runs on to the next node.</p>
<p>Thus the complete state management is independant from the service.</p>
<p>Another interesting point to hear your opinion on would be, is it a good practice to save the state of the object (for example pending-submitted-accepted-removed) not only in the workflow but in an attribute of the business objet itself. If your business object is completely unaware of the workflow it is used in, it is very hard if not impossible to make queries against such objects in order to, say, find all objects in the archived state. If the object itself has no idea of its state, you have to query the associated process instance each time you want to get its state, which means pretty bad performance. Have you had similar requirements in your projects?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joram Barrez</title>
		<link>http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/comment-page-1/#comment-3867</link>
		<dc:creator>Joram Barrez</dc:creator>
		<pubDate>Mon, 14 Sep 2009 07:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jorambarrez.be/blog/?p=196#comment-3867</guid>
		<description>@Yuri:

Both are certainly valid approaches. The &#039;BPM layer&#039; approach is indeed a more classical way of looking at the problem. I wouldn&#039;t necessarily see this layer &#039;on top&#039; of the existing service layer, but as a integral part of it. Eg as you&#039;ll see in one of the next articles, my &#039;TicketService&#039; is conceptually on the same layer as the rest of the services. This ticketServices then gives you CRUD like operations, but then for workflows (ie start, stop, etc.).

The second approach you mention can mean a boost in productivity, if you choose the granularity of the subactivitities of the workflow fine enough. Imo, it is completely valid to eg start a new workflow when you do a save operation of some entity in some service. 

This way, workflow is not used as a separate component in your design, but as a integral part of your logic, what is a more natural design imo.

Regards

Joram</description>
		<content:encoded><![CDATA[<p>@Yuri:</p>
<p>Both are certainly valid approaches. The &#8216;BPM layer&#8217; approach is indeed a more classical way of looking at the problem. I wouldn&#8217;t necessarily see this layer &#8216;on top&#8217; of the existing service layer, but as a integral part of it. Eg as you&#8217;ll see in one of the next articles, my &#8216;TicketService&#8217; is conceptually on the same layer as the rest of the services. This ticketServices then gives you CRUD like operations, but then for workflows (ie start, stop, etc.).</p>
<p>The second approach you mention can mean a boost in productivity, if you choose the granularity of the subactivitities of the workflow fine enough. Imo, it is completely valid to eg start a new workflow when you do a save operation of some entity in some service. </p>
<p>This way, workflow is not used as a separate component in your design, but as a integral part of your logic, what is a more natural design imo.</p>
<p>Regards</p>
<p>Joram</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://www.jorambarrez.be/blog/2009/09/13/jbpm_architectural/comment-page-1/#comment-3866</link>
		<dc:creator>Yuri</dc:creator>
		<pubDate>Sun, 13 Sep 2009 17:36:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.jorambarrez.be/blog/?p=196#comment-3866</guid>
		<description>That&#039;s an interesting post.
Currently we are thinking whether we should put our BPM (jBPM) Layer over the our service layer which is probably the classical way.
Or should we rather allow services to use the workflow too for managing states.
And then in turn these services are orchestrated in some kind of master business worklow.
The second option might no be the ideal SOA design, but it gives you a hell of opportunities.
What do you think?</description>
		<content:encoded><![CDATA[<p>That&#8217;s an interesting post.<br />
Currently we are thinking whether we should put our BPM (jBPM) Layer over the our service layer which is probably the classical way.<br />
Or should we rather allow services to use the workflow too for managing states.<br />
And then in turn these services are orchestrated in some kind of master business worklow.<br />
The second option might no be the ideal SOA design, but it gives you a hell of opportunities.<br />
What do you think?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.484 seconds -->
