Java developers can use jBPM to analyze, improve, and maintain their business processes. This book steers you through each point of the jBPM framework and its implementation to model your business processes. The book starts by explaining the key concepts in a Business Process Management framework. It will help you to learn and practice all of the conceptual and theoretical terms used in the Business Process Management field. Then you will master jPDL, the preferred process language for jBMP, which will let you specify exactly how your processes must be defined and implemented.
|Published (Last):||27 March 2012|
|PDF File Size:||15.71 Mb|
|ePub File Size:||5.72 Mb|
|Price:||Free* [*Free Regsitration Required]|
This developers guide is intended for experienced developers that want to get the full flexibility out of jBPM. The features described in this developers guide are currently not supported. Use at your own risk. Do note that incubation features are not yet considered stable ie. You can use jBPM with the libraries that ship in the distribution. The jbpm. So the single jbpm. We didn't yet clean up the dependency description in the maven pom files. So we can't yet give the exact minimal set of libraries from the lib directory that you need to include in your application See Jira issue JBPM and vote for it if you want to let us know that this issue has priority for you.
The versions of the libraries that are in the lib directory are the ones that we tested with. So we recommend you to use those very versions of the libs. To help you on your way, here's the current maven dependency list for jPDL:. The jboss idm dependencies in sections org.
This section documents some of the more advanced activities and features of jPDL that are still in incubation. These features and activities are not supported yet, but they are available for you to try and use. There are no stability guarantees on these activities and features; use them at your own risk.
Timers will be changed before they are moved to the user guide. See JBPM A timer can be specified in the transition element in wait state activities such as state s, task s, sub-process es and group s. When such a timer fires, that transition is taken. A timer can also be specified in custom events in wait state activities such as state s, task s, sub-process es and group s.
The timer element should then be the first element in the on element representing the event. In that case the event fires upon the duedate of the timer. Timers are created when the activity is entered. The timer can fire when the execution remains in the activity until the duedate. When the execution leaves the activity, the timer is cancelled. Where Base Date is specified as EL and where quantity is a positive integer.
And adding the optional indication business means that only business hours should be taken into account for this duration. Without the indication business, the duration will be interpreted as an absolute time period.
Referencing variables of other object types, even a String in a date format like '', will throw a JbpmException. NOTE: This baseDate is supported on the duedate and repeat attributes of all places where timers can be used, but also on the reminder of a task.
Remember, the following example, a subtraction in combination with 'business', is not supported and will throw an exception, as will resulting due dates that will be in the past. The default configuration will contain a reference to the file jbpm.
That contains a configuration of business hours in the following format:. If the default business calendar implementation is sufficient for you, you can simply adjust the timings in the xml configuration as shown above.
If the default implementation doesn't cover your use cases, you can easily write your own implementation by implementing the org. BusinessCalendar interface. To configure the jBPM engine to use this custom business calendar, just add the following line to your jbpm. Take a look at the org. CustomBusinessCalendarImplTest for more information.
The example org. TimerTransitionTest shows how to put a timer on a transition. When an process instance for this process is started, it arrives immediately in the guardedWait state. At that time, a timer is created that will fire after 10 minutes. With the following query, we can query for the timers related to the newly created processInstance.
We know that there should be exactly one such timer. In a unit test, we won't use the JobExecutor to execute the timer. Instead, we execute timers directly in the thread of the unit test. That way it is easy to simulate one scenario though an execution. So as the next step, we assume that the timer will fire.
We simulate this by executing the timer programmatically:. After that the process instance will have taken the timeout transition and moved to the escalation state. The second scenario in TimerTransitionTest shows that the timer is cancelled in case the signal go on is given before the timer fires.
In that case the execution ends up in the next step. In this case, if the execution is not signalled within 10 minutes after the activity is started, the event timeout is fired and the event listener org. Escalate will be notified. Again, if the guardedWait activity is ended within 10 minutes, then the timer is cancelled and the Escalate event listener will not be notified. Suppose that a new TimerBusinessTime process instance is started at am on a tuesday.
The default configured business calendar specifies working hours between and So 9 business hours later results in an actual duedate for the timer of wednesday 1pm.
Since we do not know when the TimerBusinessTimeTest will be ran, we only assert in the test that the actual duedate of the scheduled timer at least 24 hours ahead.
Example TimerRepeatTest shows how to put a timer with a repeat. The attribute repeat on a timer will cause the timer to be rescheduled automatically after it is executed. When a new process is started, a timer is created and the duedate will be 20 minutes ahead. When the timer fires, a new timer will be created with a duedate of 10 seconds ahead. When that timer fires, a new timer will be created again 10 seconds ahead. And so on. New timers will be created each time the timer fires until the guardedWait state activity is ended with a signal.
When the guardedWait state activity is ended, the existing timer will be cancelled. Groups a set of activities in a process together. Contained groups must be nested hierarchically. A group corresponds to a BPMN expanded sub process. The next code snippet shows a test scenario that rejects a document when it comes in the collect feedback first time round.
Then it goes through update document , distribute document and back to collect feedback. The second time, it will be approved.
All activities involved are wait state s. The next code snippet shows a test scenario in which the timer will fire before the group activity evaluate document completes. This scenario shows how a group can be used to create concurrent paths of execution. When an execution arrives in a group, each activity that doesn't have incoming transitions is started. So the first activities don't have to be start activities.
The group takes the default transition out when all contained work is done. The following scenario will show a scenario in which all wait state acitivities are signalled in some random order till all work is done:. Groups also support that you create transitions over group boundaries. So it's possible to have a tranition from an activity outside the group directly to an activity inside the group without modelling a start activity on the border of the group.
Similarly with transitions from activities inside the group to activities outside the group. But shhhhhhhhh! Don't tell anyone cause this is not BPMN compliant.
Activity foreach allows multiple paths of execution to be started over a single branch of the process. Its attributes are described in the table below.
In the example that follows, there is a need to collect reports from different departments. The same task is to be performed by different groups. This situation is easily modeled with foreach. Process variable departments provides the group names, whereas quota indicates how many tasks must be completed before execution leaves the join activity. When using foreach, the corresponding join must have the multiplicity attribute set. Without it, join continues execution based on its incoming transitions.
In the preceding example, join has a single incoming transition. If multiplicity is not specified, the first execution that reaches the join activity will cause the parent execution to leave the join. The purpose of the java activity in general is to invoke a Java method as explained in the User Guide. This section in the Developer Guide is specifically about how to use the java activity to invoke a method of an ejb session bean.
jBPM Developer Guide