jPDL xml schema

The jPDL schema is the schema used in the file processdefinition.xml in the process archive.

Validation

When parsing a jPDL XML document, jBPM will validate your document against the jPDL schema when two conditions are met: first, the schema has to be referenced in the XML document like this

<process-definition xmlns="urn:jbpm.org:jpdl-3.2">
  ...
</process-definition>

And second, the xerces parser has to be on the classpath.

The jPDL schema can be found in ${jbpm.home}/src/java.jbpm/org/jbpm/jpdl/xml/jpdl-3.2.xsd or at http://jbpm.org/jpdl-3.2.xsd.

process-definition

Table 17.1. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the process
swimlaneelement[0..*]the swimlanes used in this process. The swimlanes represent process roles and they are used for task assignments.
start-stateelement[0..1]the start state of the process. Note that a process without a start-state is valid, but cannot be executed.
{end-state|state|node|task-node|process-state|super-state|fork|join|decision}element[0..*]the nodes of the process definition. Note that a process without nodes is valid, but cannot be executed.
eventelement[0..*]the process events that serve as a container for actions
{action|script|create-timer|cancel-timer}element[0..*]global defined actions that can be referenced from events and transitions. Note that these actions must specify a name in order to be referenced.
taskelement[0..*]global defined tasks that can be used in e.g. actions.
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process definition.

node

Table 17.2. 

NameTypeMultiplicityDescription
{action|script|create-timer|cancel-timer}element1a custom action that represents the behaviour for this node
common node elements  See common node elements

common node elements

Table 17.3. 

NameTypeMultiplicityDescription
nameattributerequiredthe name of the node
asyncattribute{ true | false }, false is the defaultIf set to true, this node will be executed asynchronously. See also Chapter 13, Asynchronous continuations
transitionelement[0..*]the leaving transitions. Each transition leaving a node *must* have a distinct name. A maximum of one of the leaving transitions is allowed to have no name. The first transition that is specifed is called the default transition. The default transition is taken when the node is left without specifying a transition.
eventelement[0..*]supported event types: {node-enter|node-leave}
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process node.
timerelement[0..*]specifies a timer that monitors the duration of an execution in this node.

start-state

Table 17.4. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the node
taskelement[0..1]the task to start a new instance for this process or to capture the process initiator. See the section called “Swimlane in start task”
eventelement[0..*]supported event types: {node-leave}
transitionelement[0..*]the leaving transitions. Each transition leaving a node *must* have a distinct name.
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process node.

end-state

Table 17.5. 

NameTypeMultiplicityDescription
nameattributerequiredthe name of the end-state
end-complete-processattributeoptionalBy default end-complete-process is false which means that only the token ending this end-state is ended. If this token was the last child to end, the parent token is ended recursively. If you set this property to true, then the full process instance is ended.
eventelement[0..*]supported event types: {node-enter}
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process node.

state

Table 17.6. 

NameTypeMultiplicityDescription
common node elements  See common node elements

task-node

Table 17.7. 

NameTypeMultiplicityDescription
signalattributeoptional{unsynchronized|never|first|first-wait|last|last-wait}, default is last. signal specifies the effect of task completion on the process execution continuation.
create-tasksattributeoptional{yes|no|true|false}, default is true. can be set to false when a runtime calculation has to determine which of the tasks have to be created. in that case, add an action on node-enter, create the tasks in the action and set create-tasks to false.
end-tasksattributeoptional{yes|no|true|false}, default is false. In case remove-tasks is set to true, on node-leave, all the tasks that are still open are ended.
taskelement[0..*]the tasks that should be created when execution arrives in this task node.
common node elements  See common node elements

process-state

Table 17.8. 

NameTypeMultiplicityDescription
bindingattributeoptionalDefines the moment a subprocess is resolved. {late|*} defaults to resolving deploytime
sub-processelement1the sub process that is associated with this node
variableelement[0..*]specifies how data should be copied from the super process to the sub process at the start and from the sub process to the super process upon completion of the sub process.
common node elements  See common node elements

super-state

Table 17.9. 

NameTypeMultiplicityDescription
{end-state|state|node|task-node|process-state|super-state|fork|join|decision}element[0..*]the nodes of the superstate. superstates can be nested.
common node elements  See common node elements

fork

Table 17.10. 

NameTypeMultiplicityDescription
common node elements  See common node elements

join

Table 17.11. 

NameTypeMultiplicityDescription
common node elements  See common node elements

decision

Table 17.12. 

NameTypeMultiplicityDescription
handlerelementeither a 'handler' element or conditions on the transitions should be specifiedthe name of a org.jbpm.jpdl.Def.DecisionHandler implementation
transition conditionsattribute or element text on the transitions leaving a decision the leaving transitions. Each leaving transitions of a node can have a condition. The decision will use these conditions to look for the first transition for which the condition evaluates to true. The first transition represents the otherwise branch. So first, all transitions with a condition are evaluated. If one of those evaluate to true, that transition is taken. If no transition with a condition resolves to true, the default transition (=the first one) is taken. See the condition element
common node elements  See common node elements

event

Table 17.13. 

NameTypeMultiplicityDescription
typeattributerequiredthe event type that is expressed relative to the element on which the event is placed
{action|script|create-timer|cancel-timer}element[0..*]the list of actions that should be executed on this event

transition

Table 17.14. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the transition. Note that each transition leaving a node *must* have a distinct name.
toattributerequiredthe hierarchical name of the destination node. For more information about hierarchical names, see the section called “Hierarchical names”
conditionattribute or element textoptionala guard condition expression. These condition attributes (or child elements) can be used in decision nodes, or to calculate the available transitions on a token at runtime.
{action|script|create-timer|cancel-timer}element[0..*]the actions to be executed upon taking this transition. Note that the actions of a transition do not need to be put in an event (because there is only one)
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process node.

action

Table 17.15. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.
classattibuteeither, a ref-name or an expressionthe fully qualified class name of the class that implements the org.jbpm.graph.def.ActionHandler interface.
ref-nameattibuteeither this or classthe name of the referenced action. The content of this action is not processed further if a referenced action is specified.
expressionattibuteeither this, a class or a ref-nameA jPDL expression that resolves to a method. See also the section called “Expressions”
accept-propagated-eventsattributeoptional{yes|no|true|false}. Default is yes|true. If set to false, the action will only be executed on events that were fired on this action's element. for more information, see the section called “Event propagation”
config-typeattributeoptional{field|bean|constructor|configuration-property}. Specifies how the action-object should be constructed and how the content of this element should be used as configuration information for that action-object.
asyncattibute{true|false}Default is false, which means that the action is executed in the thread of the execution. If set to true, a message will be sent to the command executor and that component will execute the action asynchonously in a separate transaction.
 {content}optionalthe content of the action can be used as configuration information for your custom action implementations. This allows the creation of reusable delegation classes. For more about delegation configuration, see the section called “Configuration of delegations”.

script

Table 17.16. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the script-action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.
accept-propagated-eventsattributeoptional [0..*]{yes|no|true|false}. Default is yes|true. If set to false, the action will only be executed on events that were fired on this action's element. for more information, see the section called “Event propagation”
expressionelement[0..1]the beanshell script. If you don't specify variable elements, you can write the expression as the content of the script element (omitting the expression element tag).
variableelement[0..*]in variable for the script. If no in variables are specified, all the variables of the current token will be loaded into the script evaluation. Use the in variables if you want to limit the number of variables loaded into the script evaluation.

expression

Table 17.17. 

NameTypeMultiplicityDescription
 {content} a bean shell script.

variable

Table 17.18. 

NameTypeMultiplicityDescription
nameattributerequiredthe process variable name
accessattributeoptionaldefault is read,write. It is a comma separated list of access specifiers. The only access specifiers used so far are read, write and required.
mapped-nameattributeoptionalthis defaults to the variable name. it specifies a name to which the variable name is mapped. the meaning of the mapped-name is dependent on the context in which this element is used. for a script, this will be the script-variable-name. for a task controller, this will be the label of the task form parameter and for a process-state, this will be the variable name used in the sub-process.

handler

Table 17.19. 

NameTypeMultiplicityDescription
expressionattibuteeither this or a classA jPDL expression. The returned result is transformed to a string with the toString() method. The resulting string should match one of the leaving transitions. See also the section called “Expressions”.
classattibuteeither this or ref-namethe fully qualified class name of the class that implements the org.jbpm.graph.node.DecisionHandler interface.
config-typeattributeoptional{field|bean|constructor|configuration-property}. Specifies how the action-object should be constructed and how the content of this element should be used as configuration information for that action-object.
 {content}optionalthe content of the handler can be used as configuration information for your custom handler implementations. This allows the creation of reusable delegation classes. For more about delegation configuration, see the section called “Configuration of delegations”.

timer

Table 17.20. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the timer. If no name is specified, the name of the enclosing node is taken. Note that every timer should have a unique name.
duedateattributerequiredthe duration (optionally expressed in business hours) that specifies the time period between the creation of the timer and the execution of the timer. See the section called “Duration” for the syntax.
repeatattributeoptional{duration | 'yes' | 'true'}after a timer has been executed on the duedate, 'repeat' optionally specifies duration between repeating timer executions until the node is left. If yes or true is specified, the same duration as for the due date is taken for the repeat. See the section called “Duration” for the syntax.
transitionattributeoptionala transition-name to be taken when the timer executes, after firing the timer event and executing the action (if any).
cancel-eventattributeoptionalthis attribute is only to be used in timers of tasks. it specifies the event on which the timer should be cancelled. by default, this is the task-end event, but it can be set to e.g. task-assign or task-start. The cancel-event types can be combined by specifying them in a comma separated list in the attribute.
{action|script|create-timer|cancel-timer}element[0..1]an action that should be executed when this timer fires

create-timer

Table 17.21. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the timer. The name can be used for cancelling the timer with a cancel-timer action.
duedateattributerequiredthe duration (optionally expressed in business hours) that specifies the the time period between the creation of the timer and the execution of the timer. See the section called “Duration” for the syntax.
repeatattributeoptional{duration | 'yes' | 'true'}after a timer has been executed on the duedate, 'repeat' optionally specifies duration between repeating timer executions until the node is left. If yes of true is specified, the same duration as for the due date is taken for the repeat. See the section called “Duration” for the syntax.
transitionattributeoptionala transition-name to be taken when the timer executes, after firing the the timer event and executing the action (if any).

cancel-timer

Table 17.22. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the timer to be cancelled.

task

Table 17.23. 

NameTypeMultiplicityDescription
nameattributeoptionalthe name of the task. Named tasks can be referenced and looked up via the TaskMgmtDefinition
blockingattributeoptional{yes|no|true|false}, default is false. If blocking is set to true, the node cannot be left when the task is not finished. If set to false (default) a signal on the token is allowed to continue execution and leave the node. The default is set to false, because blocking is normally forced by the user interface.
signallingattributeoptional{yes|no|true|false}, default is true. If signalling is set to false, this task will never have the capability of trigering the continuation of the token.
duedateattributeoptionalis a duration expressed in absolute or business hours as explained in Chapter 14, Business calendar
swimlaneattributeoptionalreference to a swimlane. If a swimlane is specified on a task, the assignment is ignored.
priorityattributeoptionalone of {highest, high, normal, low, lowest}. alternatively, any integer number can be specified for the priority. FYI: (highest=1, lowest=5)
assignmentelementoptionaldescribes a delegation that will assign the task to an actor when the task is created.
eventelement[0..*]supported event types: {task-create|task-start|task-assign|task-end}. Especially for the task-assign we have added a non-persisted property previousActorId to the TaskInstance
exception-handlerelement[0..*]a list of exception handlers that applies to all exceptions thrown by delegation classes thrown in this process node.
timerelement[0..*]specifies a timer that monitors the duration of an execution in this task. special for task timers, the cancel-event can be specified. by default the cancel-event is task-end, but it can be customized to e.g. task-assign or task-start.
controllerelement[0..1]specifies how the process variables are transformed into task form parameters. the task form paramaters are used by the user interface to render a task form to the user.

swimlane

Table 17.24. 

NameTypeMultiplicityDescription
nameattributerequiredthe name of the swimlane. Swimlanes can be referenced and looked up via the TaskMgmtDefinition
assignmentelement[1..1]specifies a the assignment of this swimlane. the assignment will be performed when the first task instance is created in this swimlane.

assignment

Table 17.25. 

NameTypeMultiplicityDescription
expressionattributeoptionalFor historical reasons, this attribute expression does not refer to the jPDL expression, but instead, it is an assignment expression for the jBPM identity component. For more information on how to write jBPM identity component expressions, see the section called “Assignment expressions”. Note that this implementation has a dependency on the jbpm identity component.
actor-idattributeoptionalAn actorId. Can be used in conjunction with pooled-actors. The actor-id is resolved as an expression. So you can refer to a fixed actorId like this actor-id="bobthebuilder". Or you can refer to a property or method that returns a String like this: actor-id="myVar.actorId", which will invoke the getActorId method on the task instance variable "myVar".
pooled-actorsattributeoptionalA comma separated list of actorIds. Can be used in conjunction with actor-id. A fixed set of pooled actors can be specified like this: pooled-actors="chicagobulls, pointersisters". The pooled-actors will be resolved as an expression. So you can also refer to a property or method that has to return, a String[], a Collection or a comma separated list of pooled actors.
classattributeoptionalthe fully qualified classname of an implementation of org.jbpm.taskmgmt.def.AssignmentHandler
config-typeattributeoptional{field|bean|constructor|configuration-property}. Specifies how the assignment-handler-object should be constructed and how the content of this element should be used as configuration information for that assignment-handler-object.
 {content}optionalthe content of the assignment-element can be used as configuration information for your AssignmentHandler implementations. This allows the creation of reusable delegation classes. for more about delegation configuration, see the section called “Configuration of delegations”.

controller

Table 17.26. 

NameTypeMultiplicityDescription
classattributeoptionalthe fully qualified classname of an implementation of org.jbpm.taskmgmt.def.TaskControllerHandler
config-typeattributeoptional{field|bean|constructor|configuration-property}. Specifies how the assignment-handler-object should be constructed and how the content of this element should be used as configuration information for that assignment-handler-object.
 {content} either the content of the controller is the configuration of the specified task controller handler (if the class attribute is specified. if no task controller handler is specified, the content must be a list of variable elements.
variableelement[0..*]in case no task controller handler is specified by the class attribute, the content of the controller element must be a list of variables.

sub-process

Table 17.27. 

NameTypeMultiplicityDescription
nameattributerequiredthe name of the sub process. Can be an EL expression, as long as it resolves to a String. Powerful especially with late binding in the process-state. To know how you can test subprocesses, see the section called “Testing sub processes”
versionattributeoptionalthe version of the sub process. If no version is specified, the latest version of the given process as known while deploying the parent process-state will be taken.
bindingattributeoptionalindicates if the version of the sub process should be determined when deploying the parent process-state (default behavior), or when actually invoking the sub process (binding="late"). When both version and binding="late" are given then jBPM will use the version as requested, but will not yet try to find the sub process when the parent process-state is deployed.

condition

Table 17.28. 

NameTypeMultiplicityDescription
 {content} For backwards compatibility, the condition can also be entered with the 'expression' attribute, but that attribute is deprecated since 3.2requiredThe contents of the condition element is a jPDL expression that should evaluate to a boolean. A decision takes the first transition (as ordered in the processdefinition.xml) for which the expression resolves to true. If none of the conditions resolve to true, the default leaving transition (== the first one) will be taken.

exception-handler

Table 17.29. 

NameTypeMultiplicityDescription
exception-classattributeoptionalspecifies the fully qualified name of the java throwable class that should match this exception handler. If this attribute is not specified, it matches all exceptions (java.lang.Throwable).
actionelement[1..*]a list of actions to be executed when an exception is being handled by this exception handler.