[jbpm-commits] JBoss JBPM SVN: r6477 - in jbpm4/trunk/modules: bpmn/src/main/java/org/jbpm/bpmn/flownodes and 11 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Jul 10 04:20:42 EDT 2010
Author: alex.guizar at jboss.com
Date: 2010-07-10 04:20:41 -0400 (Sat, 10 Jul 2010)
New Revision: 6477
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnBinding.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3Converter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/assign/AssignTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/foreach/ForEachTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/HistoryVariableTest.java
Log:
JBPM-2715: remove sequence restrictions in jpdl schema
take out unneeded sax objects from parser, simplify initialization
revert to http://jbpm.org/4.4/jpdl namespace
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd 2010-07-10 08:20:41 UTC (rev 6477)
@@ -1,60 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://jbpm.org/4.4/jpdl"
- xmlns:tns="http://jbpm.org/4.4/jpdl"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
-
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://jbpm.org/4.4/jpdl"
+ xmlns:tns="http://jbpm.org/4.4/jpdl" elementFormDefault="qualified">
<annotation>
<documentation>Schema for jPDL 4 process descriptions;
- the top level element is process.
- </documentation>
+ the top level element is process.</documentation>
</annotation>
<!-- ### PROCESS DEFINITION ############################################# -->
<element name="process">
- <annotation><documentation>jPDL process definition.
- This is the top level element in a jPDL process file.</documentation></annotation>
+ <annotation>
+ <documentation>jBPM Process Definition Language definition.
+ This is the top level element in a process definition file.</documentation>
+ </annotation>
<complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
+ <sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:swimlane" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
- <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:migrate-instances" minOccurs="0" maxOccurs="1" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:swimlane" />
+ <element ref="tns:on" />
+ <element ref="tns:timer" />
+ <group ref="tns:activityGroup" />
+ </choice>
+ <element ref="tns:migrate-instances" minOccurs="0" />
</sequence>
<attribute name="name" use="required" type="string">
<annotation>
- <documentation>
- The process name. Multiple processes can be deployed with the same name,
- as long as they have a different version.
- </documentation>
+ <documentation>The process name. Multiple processes can be deployed with the same
+ name, as long as they have a different version.</documentation>
</annotation>
</attribute>
<attribute name="key" type="string">
<annotation>
- <documentation>
- The key can be used to provide a short acronym that replaces the name as
- the basis for the generated process definition id.
- </documentation>
+ <documentation>The key can be used to provide a short acronym that replaces the name
+ as the basis for the generated process definition id.</documentation>
</annotation>
</attribute>
<attribute name="version" type="int">
<annotation>
- <documentation>
- Indicates the version number of this process definition among its homonyms.
- By specifying a version, automatic deployment can tell whether this process
- is already deployed.
- </documentation>
+ <documentation>Indicates the version number of this process definition among its
+ homonyms. By specifying a version, automatic deployment can tell whether this
+ process is already deployed.</documentation>
</annotation>
</attribute>
- <anyAttribute processContents="skip">
- <annotation><documentation>for extensibility
- </documentation></annotation>
- </anyAttribute>
</complexType>
</element>
@@ -64,60 +53,68 @@
<choice>
<!-- ~~~ START ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="start">
- <annotation><documentation>Start event
- </documentation></annotation>
+ <annotation>
+ <documentation>Start event.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="form" type="string">
- <annotation><documentation>the resource name of the form in the
- deployment.</documentation></annotation>
+ <annotation>
+ <documentation>Resource name of the form in the deployment.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<!-- ~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="end">
- <annotation><documentation>End event.
- </documentation></annotation>
+ <annotation>
+ <documentation>End event.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="ends" default="process-instance">
<simpleType>
<restriction base="string">
- <enumeration value="execution"/>
- <enumeration value="process-instance"/>
+ <enumeration value="execution" />
+ <enumeration value="process-instance" />
</restriction>
</simpleType>
</attribute>
<attribute name="state" default="ended" type="string">
- <annotation><documentation>sets the state of the execution explicitely</documentation></annotation>
+ <annotation>
+ <documentation>Set the end state of the execution explicitly.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="end-cancel">
- <annotation><documentation>End cancel event.
- </documentation></annotation>
+ <annotation>
+ <documentation>End cancel event.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="ends" default="process-instance">
<simpleType>
<restriction base="string">
- <enumeration value="execution"/>
- <enumeration value="process-instance"/>
+ <enumeration value="execution" />
+ <enumeration value="process-instance" />
</restriction>
</simpleType>
</attribute>
@@ -125,19 +122,20 @@
</element>
<element name="end-error">
- <annotation><documentation>End cancel event.
- </documentation></annotation>
+ <annotation>
+ <documentation>End cancel event.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="ends" default="process-instance">
<simpleType>
<restriction base="string">
- <enumeration value="execution"/>
- <enumeration value="process-instance"/>
+ <enumeration value="execution" />
+ <enumeration value="process-instance" />
</restriction>
</simpleType>
</attribute>
@@ -146,25 +144,28 @@
<!-- ~~~ STATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="state">
- <annotation><documentation>A wait state. When an execution arrives in this
- activity, the execution will wait until an external trigger is received
- with execution.signal() or execution.getActivityInstance().signal()
- </documentation></annotation>
+ <annotation>
+ <documentation>Wait state. When an execution arrives in this activity,
+ the execution stops until an external trigger is delivered through
+ execution.signal() or execution.getActivityInstance().signal()</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <extension base="tns:transitionType">
- <sequence>
- <element ref="tns:timer" minOccurs="0" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element name="transition">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element ref="tns:timer" minOccurs="0" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
@@ -172,80 +173,91 @@
<!-- ~~~ DECISION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="decision">
- <annotation><documentation>Decision gateway: selects one path out of many alternatives.
- When an execution comes in, exactly one outgoing transition is taken.
- </documentation></annotation>
+ <annotation>
+ <documentation>Decision gateway: selects one path out of many alternatives.
+ When an execution arrives, it takes exactly one outgoing transition.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
<element name="handler" minOccurs="0" type="tns:wireObjectType" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <extension base="tns:transitionType">
- <sequence>
- <element name="condition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="handler" minOccurs="0" type="tns:wireObjectType" />
- </sequence>
- <attribute name="expr" type="string">
- <annotation><documentation>The script text that will be evaluated.
- </documentation></annotation>
- </attribute>
- <attribute name="lang" type="string">
- <annotation><documentation>Identification of the scripting language
- to use.</documentation></annotation>
- </attribute>
- </complexType>
- </element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded" />
+ <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element name="condition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="expr" type="string">
+ <annotation>
+ <documentation>Expression to evaluate.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation>
+ <documentation>Scripting language to interpret.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="expr" type="string">
- <annotation><documentation>The script that will be evaluated and resolve to
- the name of the outgoing transition.
- </documentation></annotation>
+ <annotation>
+ <documentation>The script that will be evaluated and resolve to
+ the name of the outgoing transition.</documentation>
+ </annotation>
</attribute>
<attribute name="lang" type="string">
- <annotation><documentation>Identification of the scripting language
- to use for the expr attribute.</documentation></annotation>
+ <annotation>
+ <documentation>Identification of the scripting language
+ to use for the expr attribute.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<!-- ~~~ FOREACH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="foreach">
- <annotation><documentation>Spawns concurrent paths of execution
- over each element of a collection.
- </documentation></annotation>
+ <annotation>
+ <documentation>Spawns concurrent paths of execution
+ over each element of a collection.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
- <attribute name="var" type="string" use="required"/>
- <attribute name="in" type="string" use="required"/>
+ <attribute name="var" type="string" use="required" />
+ <attribute name="in" type="string" use="required" />
</complexType>
</element>
<!-- ~~~ FORK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="fork">
- <annotation><documentation>Spawns multiple concurrent paths of
- execution.
- </documentation></annotation>
+ <annotation>
+ <documentation>Spawns multiple concurrent paths of
+ execution.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
@@ -253,25 +265,28 @@
<!-- ~~~ JOIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="join">
- <annotation><documentation>Spawns multiple concurrent paths of
- execution.
- </documentation></annotation>
+ <annotation>
+ <documentation>Spawns multiple concurrent paths of
+ execution.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
<attribute name="multiplicity" type="string" />
<attribute name="lockmode" default="upgrade">
<simpleType>
<restriction base="string">
- <enumeration value="none"/>
- <enumeration value="read"/>
- <enumeration value="upgrade"/>
- <enumeration value="upgrade_nowait"/>
- <enumeration value="write"/>
+ <enumeration value="none" />
+ <enumeration value="read" />
+ <enumeration value="upgrade" />
+ <enumeration value="upgrade_nowait" />
+ <enumeration value="write" />
</restriction>
</simpleType>
</attribute>
@@ -280,15 +295,16 @@
<!-- ~~~ SCRIPT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="script">
- <annotation><documentation>Evaluates a piece of text as a script
- </documentation></annotation>
+ <annotation>
+ <documentation>Evaluates a piece of text as a script.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:scriptType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -297,15 +313,16 @@
<!-- ~~~ HQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="hql">
- <annotation><documentation>Performs a hibernate query
- </documentation></annotation>
+ <annotation>
+ <documentation>Performs a Hibernate query.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:qlType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -314,15 +331,16 @@
<!-- ~~~ SQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="sql">
- <annotation><documentation>Performs a hibernate SQL query
- </documentation></annotation>
+ <annotation>
+ <documentation>Performs a Hibernate SQL query.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:qlType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -331,15 +349,16 @@
<!-- ~~~ MAIL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="mail">
- <annotation><documentation>Sends an email
- </documentation></annotation>
+ <annotation>
+ <documentation>Sends an email.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:mailType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -348,15 +367,16 @@
<!-- ~~~ JMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="jms">
- <annotation><documentation>Sends an email
- </documentation></annotation>
+ <annotation>
+ <documentation>Sends an email.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:jmsType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -365,18 +385,20 @@
<!-- ~~~ JAVA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="java">
- <annotation><documentation>Invokes a method on a java object.
- Either the java class is instantiated with reflection, or the
- java object is fetched from the environment. Then values from the
- environment are injected into the fields and a method is executed.
- </documentation></annotation>
+ <annotation>
+ <documentation>Invokes a method on a java object.
+ Either the java class is instantiated with reflection,
+ or the java object is fetched from the environment.
+ Values are then injected into the fields and.
+ Finally a method is invoked.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:javaType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -385,15 +407,16 @@
<!-- ~~~ ASSIGN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="assign">
- <annotation><documentation>Assigns a source value to a target location
- </documentation></annotation>
+ <annotation>
+ <documentation>Assigns a source value to a target location.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:assignType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:transition" />
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -402,15 +425,16 @@
<!-- ~~~ CUSTOM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="custom">
- <annotation><documentation>Uses a user defined, custom implementation of
- ActivityBehaviour
- </documentation></annotation>
+ <annotation>
+ <documentation>Calls a user defined, custom implementation of
+ ActivityBehaviour.</documentation>
+ </annotation>
<complexType>
<complexContent>
<extension base="tns:wireObjectType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element name="transition">
<complexType>
<complexContent>
<extension base="tns:transitionType">
@@ -421,7 +445,7 @@
</complexContent>
</complexType>
</element>
- </sequence>
+ </choice>
<attributeGroup ref="tns:activityAttributes" />
</extension>
</complexContent>
@@ -430,13 +454,13 @@
<!-- ~~~ TASK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="task">
- <annotation><documentation>Creates a task in the task component.
- </documentation></annotation>
+ <annotation>
+ <documentation>Creates a task in the task component.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
<element name="notification" minOccurs="0">
<complexType>
<attribute name="continue" type="tns:continueType" default="sync" />
@@ -448,35 +472,40 @@
<attribute name="duedate" type="string" />
<attribute name="repeat" type="string" />
<attribute name="continue" type="tns:continueType" default="sync" />
- <attribute name="template" type="tns:templateType" use="optional"/>
+ <attribute name="template" type="tns:templateType" use="optional" />
</complexType>
</element>
- <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <extension base="tns:transitionType">
- <sequence>
- <element ref="tns:timer" minOccurs="0" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:on" />
+ <element ref="tns:timer" />
+ <element name="transition">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element ref="tns:timer" minOccurs="0" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
- <attributeGroup ref="tns:assignmentAttributes"/>
+ <attributeGroup ref="tns:assignmentAttributes" />
<attribute name="swimlane" type="string" />
<attribute name="form" type="string">
- <annotation><documentation>the resource name of the form in the
- deployment.</documentation></annotation>
+ <annotation>
+ <documentation>the resource name of the form in the
+ deployment.</documentation>
+ </annotation>
</attribute>
- <attribute name="duedate" type="string" />
+ <attribute name="duedate" type="string" />
<attribute name="on-transition" default="cancel">
<simpleType>
<restriction base="string">
- <enumeration value="keep"/>
- <enumeration value="cancel"/>
+ <enumeration value="keep" />
+ <enumeration value="cancel" />
</restriction>
</simpleType>
</attribute>
@@ -486,55 +515,65 @@
<!-- ~~~ SUB-PROCESS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="sub-process">
- <annotation><documentation>Waits while a sub process instance is
- being executed and continues when the sub process instance ends.
- </documentation></annotation>
+ <annotation>
+ <documentation>Waits while a sub process instance is
+ being executed and continues when
+ the sub process instance ends.</documentation>
+ </annotation>
<complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
+ <sequence>
<element name="description" minOccurs="0" type="string" />
- <element name="parameter-in" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
- <element name="parameter-out" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
- </element>
- <element name="swimlane-mapping" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <attribute name="swimlane" type="string" use="required" />
- <attribute name="sub-swimlane" type="string" use="required" />
- </complexType>
- </element>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <extension base="tns:transitionType">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <element name="outcome-value">
- <complexType>
- <group ref="tns:wireObjectGroup" />
- </complexType>
- </element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="parameter-in" type="tns:parameterType" />
+ <element name="parameter-out" type="tns:parameterType" />
+ <element ref="tns:timer" />
+ <element ref="tns:on">
+ <annotation>
+ <documentation>Events on which listeners can be registered.</documentation>
+ </annotation>
+ </element>
+ <element name="swimlane-mapping">
+ <complexType>
+ <attribute name="swimlane" type="string" use="required" />
+ <attribute name="sub-swimlane" type="string" use="required" />
+ </complexType>
+ </element>
+ <element name="transition">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element name="outcome-value" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </choice>
</sequence>
<attribute name="sub-process-id" type="string">
- <annotation><documentation>Identifies the sub process by the id. This means that a specific
- version of a process definition is referenced
- </documentation></annotation>
+ <annotation>
+ <documentation>References a sub-process by id. This means that a specific
+ version of a process definition is referenced.</documentation>
+ </annotation>
</attribute>
<attribute name="sub-process-key" type="string">
- <annotation><documentation>Identifies the sub process by the key. This means that the latest
- version of the process definition with the given key is referenced. The latest version
- of the process is looked up each time the activity executes.
- </documentation></annotation>
+ <annotation>
+ <documentation>References a sub-process by key. Therefore, the latest
+ version of the process definition with the given key is referenced.
+ The latest version is resolved each time the activity executes.
+ </documentation>
+ </annotation>
</attribute>
<attribute name="outcome" type="string">
- <annotation><documentation>Expression that is evaluated when the sub process
- instance ends. The value is then used for outcome transition mapping.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression that is evaluated when the sub process instance ends.
+ The value is then used for outcome transition mapping.</documentation>
+ </annotation>
</attribute>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
@@ -542,17 +581,23 @@
<!-- ~~~ GROUP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="group">
- <annotation><documentation>Scope enclosing a number of activities.
- </documentation></annotation>
+ <annotation>
+ <documentation>Scope enclosing a number of activities.
+ </documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
- </element>
- <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <group ref="tns:activityGroup" />
+ <element ref="tns:transition" />
+ <element ref="tns:on">
+ <annotation>
+ <documentation>Events on which listeners can be registered.</documentation>
+ </annotation>
+ </element>
+ <element ref="tns:timer" />
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
@@ -560,15 +605,21 @@
<!-- ~~~ RULES DECISION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="rules-decision">
- <annotation><documentation>Selects one outgoing transition based on evaluation of rules.
- </documentation></annotation>
+ <annotation>
+ <documentation>Selects one outgoing transition based on evaluation
+ of rules.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="tns:transition" />
+ <element ref="tns:on">
+ <annotation>
+ <documentation>Events on which listeners can be registered.</documentation>
+ </annotation>
+ </element>
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
@@ -576,50 +627,57 @@
<!-- ~~~ RULES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="rules">
- <annotation><documentation>Evaluates rules after feeding in some facts in a stateful knowledge session.
- </documentation></annotation>
+ <annotation>
+ <documentation>Evaluates rules after feeding in some facts in a stateful knowledge
+ session.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
- <element name="fact" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <attribute name="var" type="string" />
- <attribute name="expr" type="string" />
- </complexType>
- </element>
- <element name="transition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <complexContent>
- <extension base="tns:transitionType">
- <sequence>
- <element name="condition" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="handler" minOccurs="0" type="tns:wireObjectType" />
- </sequence>
- <attribute name="expr" type="string">
- <annotation><documentation>The script text that will be evaluated.
- </documentation></annotation>
- </attribute>
- <attribute name="lang" type="string">
- <annotation><documentation>Identification of the scripting language
- to use.</documentation></annotation>
- </attribute>
- </complexType>
- </element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
- </element>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="fact">
+ <complexType>
+ <attribute name="var" type="string" />
+ <attribute name="expr" type="string" />
+ </complexType>
+ </element>
+ <element name="transition">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element name="condition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="handler" minOccurs="0" type="tns:wireObjectType" />
+ </sequence>
+ <attribute name="expr" type="string">
+ <annotation>
+ <documentation>Expression to evaluate.</documentation>
+ </annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation>
+ <documentation>Script language to interpret.</documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ <element ref="tns:on">
+ <annotation>
+ <documentation>Events on which listeners can be registered.</documentation>
+ </annotation>
+ </element>
+ </choice>
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
</element>
-
</choice>
</group>
@@ -628,24 +686,31 @@
<!-- SPECIAL OBJECTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="null">
- <annotation><documentation>the null value
- </documentation></annotation>
+ <annotation>
+ <documentation>The null value.</documentation>
+ </annotation>
</element>
<element name="ref">
- <annotation><documentation>A reference to an object in the current environment</documentation></annotation>
+ <annotation>
+ <documentation>Reference to an object in the current environment.</documentation>
+ </annotation>
<complexType>
<attribute name="object" type="string" use="required">
- <annotation><documentation>The name of the referred object</documentation></annotation>
+ <annotation>
+ <documentation>The name of the referred object.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="env-ref">
- <annotation><documentation>The current environment.
- </documentation></annotation>
+ <annotation>
+ <documentation>The current environment.</documentation>
+ </annotation>
</element>
<element name="jndi">
- <annotation><documentation>A lookup from JNDI through the InitialContext
- </documentation></annotation>
+ <annotation>
+ <documentation>JNDI lookup based off the initial context.</documentation>
+ </annotation>
<complexType>
<attribute name="jndi-name" type="string" use="required" />
</complexType>
@@ -653,49 +718,69 @@
<!-- COLLECTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="list">
- <annotation><documentation>A java.util.List</documentation></annotation>
+ <annotation>
+ <documentation>java.util.List instance.</documentation>
+ </annotation>
<complexType>
<choice minOccurs="0" maxOccurs="unbounded">
<group ref="tns:wireObjectGroup" />
</choice>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
+ </attribute>
<attribute name="class" type="string" default="java.util.ArrayList">
- <annotation><documentation>Implementation class for this list.
- </documentation></annotation>
+ <annotation>
+ <documentation>List implementation class.</documentation>
+ </annotation>
</attribute>
<attribute name="synchronized" type="tns:booleanValueType" default="false">
- <annotation><documentation>Indicates if this collection should be synchronized
- with Collections.synchronizedList(List)</documentation></annotation>
+ <annotation>
+ <documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedList()</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
- <element name="map" type="tns:mapType"/>
+ <element name="map" type="tns:mapType" />
<element name="set">
- <annotation><documentation>A java.util.Set
- </documentation></annotation>
+ <annotation>
+ <documentation>java.util.Set instance.</documentation>
+ </annotation>
<complexType>
<choice minOccurs="0" maxOccurs="unbounded">
<group ref="tns:wireObjectGroup" />
</choice>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
<attribute name="class" type="string" default="java.util.HashList">
- <annotation><documentation>Implementation class for this set.
- </documentation></annotation>
+ <annotation>
+ <documentation>Set implementation class.</documentation>
+ </annotation>
</attribute>
<attribute name="synchronized" type="tns:booleanValueType" default="false">
- <annotation><documentation>Indicates if this collection should be synchronized
- with Collections.synchronizedSet(Set)</documentation></annotation>
+ <annotation>
+ <documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedSet()</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="properties">
- <annotation><documentation>A java.util.Properties</documentation></annotation>
+ <annotation>
+ <documentation>java.util.Properties instance.</documentation>
+ </annotation>
<complexType>
<choice minOccurs="0" maxOccurs="unbounded">
<element name="property">
@@ -705,20 +790,35 @@
</complexType>
</element>
</choice>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
+ </attribute>
<attribute name="file" type="string">
- <annotation><documentation>A file on the file system</documentation></annotation>
+ <annotation>
+ <documentation>File in the file system.</documentation>
+ </annotation>
</attribute>
<attribute name="resource" type="string">
- <annotation><documentation>A file as a resource in the classpath</documentation></annotation>
+ <annotation>
+ <documentation>Resource in the classpath.</documentation>
+ </annotation>
</attribute>
<attribute name="url" type="string">
- <annotation><documentation>the contents is fetched by loading a url</documentation></annotation>
+ <annotation>
+ <documentation>Resource in the web.</documentation>
+ </annotation>
</attribute>
<attribute name="is-xml" type="tns:booleanValueType">
- <annotation><documentation>optionally indicates if the content of referenced file in attributes
- 'file', 'resource' or 'url' is XML. The default is the
- plain properties format with a space or the equals character (=) separating key and value on
- each line.</documentation></annotation>
+ <annotation>
+ <documentation>tells whether the resource referenced by
+ attributes 'file', 'resource' or 'url' is XML. The default is the
+ plain properties format, where a space or '=' separates the key
+ from the value in each line.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
@@ -729,33 +829,43 @@
<!-- BASIC TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="string">
<complexType>
- <attribute name="name">
- <annotation><documentation>the name of the string object</documentation></annotation>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
- <attribute name="value">
- <annotation><documentation>the actual string value</documentation></annotation>
- </attribute>
+ <attribute name="value" />
</complexType>
</element>
<element name="byte">
- <annotation><documentation>A java.lang.Byte</documentation></annotation>
+ <annotation>
+ <documentation>8-bit signed integer.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
<attribute name="value" type="byte" use="required" />
</complexType>
</element>
<element name="char">
- <annotation><documentation>A java.lang.Character</documentation></annotation>
+ <annotation>
+ <documentation>16-bit Unicode character.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
<attribute name="value" use="required">
<simpleType>
@@ -767,135 +877,154 @@
</complexType>
</element>
<element name="double">
- <annotation><documentation>A java.lang.Double</documentation></annotation>
+ <annotation>
+ <documentation>64-bit floating point number.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
<attribute name="value" type="double" use="required" />
</complexType>
</element>
<element name="false">
- <annotation><documentation>java.lang.Boolean.FALSE
- </documentation></annotation>
+ <annotation>
+ <documentation>Boolean false value</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="float">
- <annotation><documentation>A java.lang.Float
- </documentation></annotation>
+ <annotation>
+ <documentation>32-bit floating point number.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
<attribute name="value" type="float" use="required" />
</complexType>
</element>
<element name="int">
- <annotation><documentation>A java.lang.Integer
- </documentation></annotation>
+ <annotation>
+ <documentation>32-bit signed integer.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
- <attribute name="value" type="int" use="required"/>
+ <attribute name="value" type="int" use="required" />
</complexType>
</element>
<element name="long">
- <annotation><documentation>A java.lang.Long</documentation></annotation>
+ <annotation>
+ <documentation>64-bit signed integer.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
- <attribute name="value" type="long" use="required"/>
+ <attribute name="value" type="long" use="required" />
</complexType>
</element>
<element name="short">
- <annotation><documentation>a java.lang.Short
- </documentation></annotation>
+ <annotation>
+ <documentation>16-bit signed integer.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
- <attribute name="value" type="short" use="required"/>
+ <attribute name="value" type="short" use="required" />
</complexType>
</element>
<element name="true">
- <annotation><documentation>java.lang.Boolean.TRUE
- </documentation></annotation>
+ <annotation>
+ <documentation>Boolean true value.</documentation>
+ </annotation>
<complexType>
<attribute name="name" type="string">
- <annotation><documentation>The name of the object. It's optional and serves
- as an id to refer to this object from other object declarations. This name can
- also be used lookup the object programmatically.</documentation></annotation>
+ <annotation>
+ <documentation>The name of the object. Optional, serves as an identifier
+ to refer to this object from other object descriptions.
+ Also used to fetch the object programmatically.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
-
-
</choice>
</group>
<complexType name="wireObjectType">
- <annotation><documentation>Any java object that will be created by reflection. .
- <p>There are three main ways to create an object: by constructor or by a factory
- object or a static factory method.</p>
- <p><b>Using the constructor</b>: Then the <code>class</code> attribute must provide the
- fully qualified class name. In case another constructor then the default is
- targetted, a <code>constructor</code> child element can be provided.
- The <code>factory</code> attribute should not be provided for using a constructor.
- </p>
- <p><b>Using a factory</b>: Then the <code>factory</code> attribute or one
- <code>factory</code> element must be provided along with the attribute
- <code>method</code>.
- </p>
- <p><b>Using a static factory method</b>: Then the <code>class</code> and
- <code>method</code> attributes should be specified. There should be no
- reference to a <code>factory</code> attribute of element.
- </p>
- <p><b>Construction and initialization</b>: all objects (constructor and factory)
- are build in two phases: construction and initialisation phase. During construction
- all is done until a pointer is obtained to the object. In initialisation, operations
- are applied to the object until it is ready to be used. The separation between
- construction and initialisation is made to allow for bidirectional references. In
- that case, at least one of both ends can not be fully initialised before it is injected
- into the other end.
- </p>
- <p><b>Operations</b>: after construction, various operations can be applied to objects
- like e.g. direct field injection, injection through setters, method invocation,
- enlist with the standard transaction, subscribe the object as a listener to an observable
- </p>
- <p><b>Arguments</b>: There are two different places for arguments. The <code>arg</code>
- elements for the factory method invocation should be placed as child elements under the
- <code>object</code> element. The <code>arg</code> elements for the constructor should be
- placed as child elements under the <code>constructor</code> element.
- </p>
- </documentation></annotation>
+ <annotation>
+ <documentation>Any java object that will be created by reflection.
+ <p>There are three main ways to create an object: by constructor or by a factory
+ object or a static factory method.</p>
+ <p><b>Using the constructor</b>: the <code>class</code> attribute must provide
+ the fully qualified class name. In case a constructor other than the default
+ should be invoked, a <code>constructor</code> child element can be provided.
+ The <code>factory</code> attribute should be absent when using a constructor.</p>
+ <p><b>Using a factory</b>: the <code>factory</code> attribute or one
+ <code>factory</code> element must be provided along with the attribute
+ <code>method</code>.</p>
+ <p><b>Using a static factory method</b>: the <code>class</code> and <code>method</code>
+ attributes should be specified. There should not be a <code>factory</code>
+ attribute or element.</p>
+ <p><b>Construction and initialization</b>: all objects (constructor and factory)
+ are build in two phases: construction and initialisation phase. During construction
+ all is done until a pointer is obtained to the object. In initialisation, operations
+ are applied to the object until it is ready to be used. The separation between
+ construction and initialisation is made to allow for bidirectional references.</p>
+ <p><b>Operations</b>: after construction, various operations can be applied to objects
+ like e.g. direct field injection, injection through setters, method invocation,
+ enlist with the standard transaction, subscribe the object to an observable.</p>
+ <p><b>Arguments</b>: there are two different places for arguments. The <code>arg</code>
+ elements for the factory method invocation should be placed as child elements under
+ the <code>object</code> element. The <code>arg</code> elements for the constructor
+ should be placed as child elements of the <code>constructor</code> element.</p>
+ </documentation>
+ </annotation>
<choice minOccurs="0" maxOccurs="unbounded">
<element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
<element name="factory">
- <annotation><documentation>Contains one element that describes the factory object.</documentation></annotation>
+ <annotation>
+ <documentation>Contains one element that describes the factory object.</documentation>
+ </annotation>
<complexType>
<group ref="tns:wireObjectGroup" />
</complexType>
</element>
<element name="constructor">
- <annotation><documentation>Specifies the arguments to use for a non-default constructor.</documentation></annotation>
+ <annotation>
+ <documentation>Specifies the arguments for a non-default constructor.</documentation>
+ </annotation>
<complexType>
<choice maxOccurs="unbounded">
<element name="arg" type="tns:argType" />
@@ -903,90 +1032,116 @@
</complexType>
</element>
<element name="arg" type="tns:argType">
- <annotation><documentation>The factory method arguments.</documentation></annotation>
+ <annotation>
+ <documentation>The factory method arguments.</documentation>
+ </annotation>
</element>
<element name="field">
- <annotation><documentation>Injects a value into a member field of this object.
- Exactly one child element must specify the value.
- </documentation></annotation>
+ <annotation>
+ <documentation>Injects a value into a member field of this object.
+ Exactly one child element must specify the value.</documentation>
+ </annotation>
<complexType>
<group ref="tns:wireObjectGroup" />
<attribute name="name">
- <annotation><documentation>The member field name</documentation></annotation>
+ <annotation>
+ <documentation>Member field name.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="property">
- <annotation><documentation>Injects a value through a setter method.
- Exactly one child element must specify the value.
- </documentation></annotation>
+ <annotation>
+ <documentation>Injects a value through a setter method.
+ Exactly one child element must specify the value.</documentation>
+ </annotation>
<complexType>
<group ref="tns:wireObjectGroup" />
<attribute name="name">
- <annotation><documentation>The name of the property (without the 'set' prefix)</documentation></annotation>
+ <annotation>
+ <documentation>Name of the property (without the 'set' prefix).</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
<element name="invoke">
- <annotation><documentation>Invokes a method</documentation></annotation>
+ <annotation>
+ <documentation>Invokes a method.</documentation>
+ </annotation>
<complexType>
<choice minOccurs="0" maxOccurs="unbounded">
<element name="arg" type="tns:argType" />
</choice>
<attribute name="method" type="string" use="required">
- <annotation><documentation>the method name</documentation></annotation>
+ <annotation>
+ <documentation>Method name.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
</choice>
<attribute name="class" type="string">
- <annotation><documentation>The fully qualified class name</documentation></annotation>
+ <annotation>
+ <documentation>Fully qualified class name</documentation>
+ </annotation>
</attribute>
<attribute name="expr" type="string">
- <annotation><documentation>The class to instantiate.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression that provides the object.</documentation>
+ </annotation>
</attribute>
<attribute name="lang" type="string">
- <annotation><documentation>The class to instantiate.
- </documentation></annotation>
+ <annotation>
+ <documentation>Script language to interpret.</documentation>
+ </annotation>
</attribute>
<attribute name="factory" type="string">
- <annotation><documentation>The name of the factory object</documentation></annotation>
+ <annotation>
+ <documentation>Name of the factory object.</documentation>
+ </annotation>
</attribute>
<attribute name="method" type="string">
- <annotation><documentation>The factory method name</documentation></annotation>
+ <annotation>
+ <documentation>Factory method name</documentation>
+ </annotation>
</attribute>
<attribute name="auto-wire" type="string">
- <annotation><documentation>Indicates if the member fields and setter properties
- should be automatically wired based on matching the property names and types with the
- object names and types</documentation></annotation>
+ <annotation>
+ <documentation>Indicates if the member fields and setter properties
+ should be wired automatically based on matching the property names and types
+ with the object names and types.</documentation>
+ </annotation>
</attribute>
<attribute name="cache" type="tns:booleanValueType">
- <annotation><documentation>Indicates if the user code should be cached
- </documentation></annotation>
+ <annotation>
+ <documentation>Indicates if the user code should be cached.</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="argType">
- <annotation><documentation>The method arguments.
- Each 'arg' element should have exactly one child element
- that represents the value of the argument.
- </documentation></annotation>
- <group ref="tns:wireObjectGroup"/>
+ <annotation>
+ <documentation>The method arguments.
+ Each 'arg' element should have exactly one child
+ element that represents the value of the argument.</documentation>
+ </annotation>
+ <group ref="tns:wireObjectGroup" />
<attribute name="type" type="string">
- <annotation><documentation>The java class name representing
- the type of the method. This is optional and can be used to
- indicate the appropriate method in case of method overloading.
- </documentation></annotation>
+ <annotation>
+ <documentation>Class name representing the method type.
+ Optional, helps resolve the appropriate method in case of overloading.</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="mapType">
- <annotation><documentation>A java.util.Map</documentation></annotation>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="entry">
+ <annotation>
+ <documentation>java.util.Map instance.</documentation>
+ </annotation>
+ <sequence>
+ <element name="entry" minOccurs="0" maxOccurs="unbounded">
<complexType>
- <sequence minOccurs="0">
+ <sequence>
<element name="key" minOccurs="0">
<complexType>
<group ref="tns:wireObjectGroup" />
@@ -1000,86 +1155,105 @@
</sequence>
</complexType>
</element>
- </choice>
+ </sequence>
<attribute name="class" type="string" default="java.util.HashMap">
- <annotation><documentation>Implementation class for this map.
- </documentation></annotation>
+ <annotation>
+ <documentation>Map implementation class.</documentation>
+ </annotation>
</attribute>
<attribute name="synchronized" type="tns:booleanValueType" default="false">
- <annotation><documentation>Indicates if this collection should be synchronized
- with Collections.synchronizedList(List)</documentation></annotation>
+ <annotation>
+ <documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedCollection()</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="javaType">
<sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
- <element name="field" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Field injections from the environment
- invocation.</documentation></annotation>
- </element>
- <element name="arg" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Method arguments.</documentation></annotation>
- </element>
+ <element name="description" minOccurs="0" type="string" />
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="field">
+ <annotation>
+ <documentation>Field injections from the environment invocation.</documentation>
+ </annotation>
+ </element>
+ <element name="arg">
+ <annotation>
+ <documentation>Method arguments.</documentation>
+ </annotation>
+ </element>
+ </choice>
</sequence>
<attribute name="method" type="string" use="required">
- <annotation><documentation>The name of the method to invoke.
- </documentation></annotation>
+ <annotation>
+ <documentation>The name of the method to invoke.</documentation>
+ </annotation>
</attribute>
<attribute name="ejb-jndi-name" type="string">
- <annotation><documentation>The jndi name of the ejb that needs to be invoked.
- </documentation></annotation>
+ <annotation>
+ <documentation>The jndi name of the ejb that needs to be invoked.</documentation>
+ </annotation>
</attribute>
<attribute name="class" type="string">
- <annotation><documentation>The class to instantiate.
- </documentation></annotation>
+ <annotation>
+ <documentation>The class to instantiate.</documentation>
+ </annotation>
</attribute>
<attribute name="expr" type="string">
- <annotation><documentation>Expression that resolves to the target object
- on which the method should be invoked.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression that resolves to the target object
+ on which the method should be invoked.</documentation>
+ </annotation>
</attribute>
<attribute name="lang" type="string">
- <annotation><documentation>The language in which attribute 'expr' is to be
- resolved.
- </documentation></annotation>
+ <annotation>
+ <documentation>The language in which attribute 'expr' is to be
+ resolved.</documentation>
+ </annotation>
</attribute>
<attribute name="var" type="string">
- <annotation><documentation>The variable name to store the return value
- </documentation></annotation>
+ <annotation>
+ <documentation>The variable name to store the return value.</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="scriptType">
<sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
+ <element name="description" minOccurs="0" type="string" />
<element name="text" type="string" minOccurs="0">
- <annotation><documentation>The content of this expression element
- is the script text that will be evaluated. This is mutually
- exclusive with the expression attribute.</documentation></annotation>
+ <annotation>
+ <documentation>The text content of this element is the script to evaluate.
+ This element and the expression attribute are mutually exclusive.</documentation>
+ </annotation>
</element>
</sequence>
<attribute name="expr" type="string">
- <annotation><documentation>The script text that will be evaluated. This
- is mutually exclusive with the expression element.
- </documentation></annotation>
+ <annotation>
+ <documentation>The value of this attribute is the script to evaluate.
+ This attribute and the text element are mutually exclusive.</documentation>
+ </annotation>
</attribute>
<attribute name="lang" type="string">
- <annotation><documentation>Identification of the scripting language
- to use.</documentation></annotation>
+ <annotation>
+ <documentation>Identifies the scripting language in use.</documentation>
+ </annotation>
</attribute>
<attribute name="var" type="string">
- <annotation><documentation>Name of the variable in which the result
- of the script evaluation will be stored</documentation></annotation>
+ <annotation>
+ <documentation>Name of the variable in which the result
+ of the script evaluation will be stored.</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="assignType">
<sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
+ <element name="description" minOccurs="0" type="string" />
<element name="from" minOccurs="0">
<annotation>
- <documentation>Descriptor that constructs the source value</documentation>
+ <documentation>Descriptor that constructs the source value.</documentation>
</annotation>
<complexType>
<group ref="tns:wireObjectGroup" />
@@ -1088,39 +1262,43 @@
</sequence>
<attribute name="from-expr" type="string">
<annotation>
- <documentation>Expression that resolves the source value</documentation>
+ <documentation>Expression that resolves the source value.</documentation>
</annotation>
</attribute>
<attribute name="lang" type="string">
<annotation>
- <documentation>Language in which from-expr is written</documentation>
+ <documentation>Language in which from-expr is written.</documentation>
</annotation>
</attribute>
<attribute name="from-var" type="string">
<annotation>
- <documentation>Variable that provides the source value</documentation>
+ <documentation>Variable that provides the source value.</documentation>
</annotation>
</attribute>
<attribute name="to-expr" type="string">
<annotation>
- <documentation>Expression that resolves the target location</documentation>
+ <documentation>Expression that resolves the target location.</documentation>
</annotation>
</attribute>
<attribute name="to-var" type="string">
<annotation>
- <documentation>Variable that provides the target location</documentation>
+ <documentation>Variable that provides the target location.</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="qlType">
<sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
+ <element name="description" minOccurs="0" type="string" />
<element name="query" type="string">
- <annotation><documentation>The query text.</documentation></annotation>
+ <annotation>
+ <documentation>Query text.</documentation>
+ </annotation>
</element>
<element name="parameters" minOccurs="0">
- <annotation><documentation>Query parameters.</documentation></annotation>
+ <annotation>
+ <documentation>Query parameters.</documentation>
+ </annotation>
<complexType>
<sequence>
<group ref="tns:wireObjectGroup" maxOccurs="unbounded" />
@@ -1129,28 +1307,34 @@
</element>
</sequence>
<attribute name="var" type="string">
- <annotation><documentation>Name of the variable in which the result
- of the script evaluation will be stored</documentation></annotation>
+ <annotation>
+ <documentation>Name of the variable in which the result
+ of the script evaluation will be stored.</documentation>
+ </annotation>
</attribute>
<attribute name="unique" type="string">
- <annotation><documentation>Does this query return a unique result or a list
- </documentation></annotation>
+ <annotation>
+ <documentation>Tells whether the query returns a unique result.</documentation>
+ </annotation>
</attribute>
</complexType>
<attributeGroup name="activityAttributes">
<attribute name="name" type="string">
- <annotation><documentation>The id of this activity. The name should be unique
- in the complete scope of the process.</documentation></annotation>
+ <annotation>
+ <documentation>Name of this activity. The name should be unique
+ in the complete scope of the process.</documentation>
+ </annotation>
</attribute>
<attribute name="g" type="string">
- <annotation><documentation>Graphical information used by process designer tool.
- </documentation></annotation>
+ <annotation>
+ <documentation>Graphical information used by process designer tool.</documentation>
+ </annotation>
</attribute>
<attribute name="continue" default="sync" type="tns:continueType">
- <annotation><documentation>To specify async continuations.
- sync is the default.
- </documentation></annotation>
+ <annotation>
+ <documentation>Specifies async continuation.</documentation>
+ </annotation>
</attribute>
</attributeGroup>
@@ -1162,42 +1346,55 @@
</restriction>
</simpleType>
-
<attributeGroup name="assignmentAttributes">
- <annotation><documentation>the assignment attributes will be used in
- tasks and swimlanes to specify to whom these respectively are assigned.
- </documentation></annotation>
+ <annotation>
+ <documentation>The assignment attributes are used in
+ tasks and swimlanes to specify who is the assignee.
+ </documentation>
+ </annotation>
<attribute name="assignee" type="string">
- <annotation><documentation>Expression that resolves to a userId referencing
- the person to which the task or swimlane will be assigned.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression that resolves to a userId referencing
+ the person to whom the task or swimlane will be assigned.</documentation>
+ </annotation>
</attribute>
<attribute name="assignee-lang" type="string">
- <annotation><documentation>Expression language for the assignee attribute.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression language for the assignee attribute.</documentation>
+ </annotation>
</attribute>
<attribute name="candidate-users" type="string">
- <annotation><documentation>Expression that resolves to a comma separated
- list of userId's. All the referred people will be candidates for
- take the task or swimlane.</documentation></annotation>
+ <annotation>
+ <documentation>Expression that resolves to a comma separated
+ list of userIds. All the referred people will be candidates for
+ take the task or swimlane.</documentation>
+ </annotation>
</attribute>
<attribute name="candidate-users-lang" type="string">
- <annotation><documentation>Expression language for the
- candidate-users attribute.</documentation></annotation>
+ <annotation>
+ <documentation>Expression language for the
+ candidate-users attribute.</documentation>
+ </annotation>
</attribute>
<attribute name="candidate-groups" type="string">
- <annotation><documentation>Resolves to a comma separated list of groupId's.
- All the referred people will be candidates to
- take the task or swimlane.</documentation></annotation>
+ <annotation>
+ <documentation>Resolves to a comma separated list of groupIds.
+ All the referred people will be candidates to
+ take the task or swimlane.</documentation>
+ </annotation>
</attribute>
<attribute name="candidate-groups-lang" type="string">
- <annotation><documentation>Expression language for the
- candidate-groups attribute.</documentation></annotation>
+ <annotation>
+ <documentation>Expression language for the
+ candidate-groups attribute.</documentation>
+ </annotation>
</attribute>
</attributeGroup>
<element name="swimlane">
- <annotation><documentation>A process role.</documentation></annotation>
+ <annotation>
+ <documentation>Process role.</documentation>
+ </annotation>
<complexType>
<sequence>
<element name="description" minOccurs="0" type="string" />
@@ -1208,28 +1405,35 @@
</element>
<complexType name="transitionType">
- <annotation><documentation>The outgoing transitions. The first in the list
- will be the default outgoing transition.
- </documentation></annotation>
+ <annotation>
+ <documentation>The outgoing transitions. The first in the list
+ will be the default outgoing transition.</documentation>
+ </annotation>
<sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
+ <element name="description" minOccurs="0" type="string" />
<group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attribute name="name" type="string">
- <annotation><documentation>Name of this outgoing transition</documentation></annotation>
+ <annotation>
+ <documentation>Name of this outgoing transition</documentation>
+ </annotation>
</attribute>
<attribute name="to" type="string">
- <annotation><documentation>Name of the destination activity of this transition.
- </documentation></annotation>
+ <annotation>
+ <documentation>Name of the destination activity of this transition.</documentation>
+ </annotation>
</attribute>
<attribute name="g" type="string">
- <annotation><documentation>Graphical information used by process designer tool.
- </documentation></annotation>
+ <annotation>
+ <documentation>Graphical information used by process designer tool.</documentation>
+ </annotation>
</attribute>
</complexType>
<element name="transition" type="tns:transitionType">
- <annotation><documentation>A transition from one activity to another.</documentation></annotation>
+ <annotation>
+ <documentation>Link from one activity to another.</documentation>
+ </annotation>
</element>
<element name="on">
@@ -1237,14 +1441,17 @@
<sequence>
<element ref="tns:timer" minOccurs="0" />
<group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>A list of event listeners that will
- be notified when the event is fired</documentation></annotation>
+ <annotation>
+ <documentation>List of event listeners that will
+ be notified when the event is fired</documentation>
+ </annotation>
</group>
</sequence>
<attribute name="event" type="string">
- <annotation><documentation>The event identification. start, end, take or
- any other custom event.
- </documentation></annotation>
+ <annotation>
+ <documentation>Event identification. start, end, take or
+ any other custom event.</documentation>
+ </annotation>
</attribute>
<attribute name="continue" type="tns:continueType" default="sync" />
</complexType>
@@ -1252,50 +1459,57 @@
<complexType name="parameterType">
<attribute name="subvar" type="string">
- <annotation><documentation>The name of the sub process variable.
- </documentation></annotation>
+ <annotation>
+ <documentation>Name of the sub process variable.</documentation>
+ </annotation>
</attribute>
<attribute name="expr" type="string">
- <annotation><documentation>An expression for which the resulting
- value will be used as value.
- </documentation></annotation>
+ <annotation>
+ <documentation>Expression that provides the variable value.</documentation>
+ </annotation>
</attribute>
<attribute name="lang" type="string">
- <annotation><documentation>Language of the expression.
- </documentation></annotation>
+ <annotation>
+ <documentation>Language of the expression.</documentation>
+ </annotation>
</attribute>
<attribute name="var" type="string">
- <annotation><documentation>Name of the process variable
- in the super process execution..
- </documentation></annotation>
+ <annotation>
+ <documentation>Name of the process variable
+ in the super process.</documentation>
+ </annotation>
</attribute>
</complexType>
-
<element name="timer">
<complexType>
<sequence>
- <annotation><documentation>A list of event listeners that will
- be notified when the timer fires</documentation></annotation>
+ <annotation>
+ <documentation>List of event listeners that will
+ be notified when the timer fires.</documentation>
+ </annotation>
<element name="description" minOccurs="0" type="string" />
- <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
- </group>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attribute name="duedate" type="string">
- <annotation><documentation>Timer duedate expression that defines the duedate of this
- timer relative to the creation time of the timer. E.g. '2 hours' or '4 business days'
- </documentation></annotation>
+ <annotation>
+ <documentation>Timer duedate expression that defines the duedate of this
+ timer relative to the creation time of the timer.
+ E.g. '2 hours' or '4 business days'.</documentation>
+ </annotation>
</attribute>
<attribute name="repeat" type="string">
- <annotation><documentation>Timer duedate expression that defines repeated scheduling
- relative to the last timer fire event. E.g. '2 hours' or '4 business days'
- </documentation></annotation>
+ <annotation>
+ <documentation>Timer duedate expression that defines repeated scheduling
+ relative to the last timer fire event.
+ E.g. '2 hours' or '4 business days'</documentation>
+ </annotation>
</attribute>
<attribute name="duedatetime" type="string">
- <annotation><documentation>Absolute time in format <code>HH:mm dd/MM/yyyy</code>
- (see SimpleDateFormat). The format for the absolute time can be customized in the
- jbpm configuration.
- </documentation></annotation>
+ <annotation>
+ <documentation>Absolute time in the format <code>HH:mm dd/MM/yyyy</code>.
+ The format can be customized in the configuration.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
@@ -1379,19 +1593,25 @@
<element name="subject" type="string" minOccurs="0" />
<element name="text" type="string" minOccurs="0" />
<element name="html" type="string" minOccurs="0" />
- <element name="attachments" minOccurs="0" >
+ <element name="attachments" minOccurs="0">
<complexType>
<sequence>
<element name="attachment" maxOccurs="unbounded">
<complexType>
<attribute name="url" type="string">
- <annotation><documentation>URL reference to the attachment</documentation></annotation>
+ <annotation>
+ <documentation>Resource in the web.</documentation>
+ </annotation>
</attribute>
<attribute name="resource" type="string">
- <annotation><documentation>Name of the attachment resource on the classpath</documentation></annotation>
+ <annotation>
+ <documentation>Resource in the classpath.</documentation>
+ </annotation>
</attribute>
<attribute name="file" type="string">
- <annotation><documentation>File reference to the attachment</documentation></annotation>
+ <annotation>
+ <documentation>Path in the file system.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
@@ -1406,35 +1626,52 @@
<complexType name="jmsType">
<choice minOccurs="1" maxOccurs="1">
- <element name="object" type="tns:wireObjectType"/>
- <element name="text" type="string"/>
- <element name="map" type="tns:mapType"/>
+ <element name="object" type="tns:wireObjectType" />
+ <element name="text" type="string" />
+ <element name="map" type="tns:mapType" />
</choice>
<attribute name="connection-factory" type="string">
- <annotation><documentation>jndi name of the jms connection factory</documentation></annotation>
+ <annotation>
+ <documentation>JNDI name of the connection factory.</documentation>
+ </annotation>
</attribute>
<attribute name="destination" type="string">
- <annotation><documentation>jndi name of the destination to send the message to</documentation></annotation>
+ <annotation>
+ <documentation>JNDI name of the destination.</documentation>
+ </annotation>
</attribute>
<attribute name="transacted" type="tns:booleanValueType" default="false">
- <annotation><documentation>indicates whether the message should be sent in a transactional way</documentation></annotation>
+ <annotation>
+ <documentation>Tells whether the message should be sent in a transaction.</documentation>
+ </annotation>
</attribute>
<attribute name="acknowledge" type="tns:acknowledgeType" default="auto">
- <annotation><documentation>indicates the acknowledgment mode</documentation></annotation>
+ <annotation>
+ <documentation>Indicates the acknowledgment mode.</documentation>
+ </annotation>
</attribute>
</complexType>
<complexType name="mailRecipientType">
<attribute name="addresses" type="string">
- <annotation><documentation>list of email address separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ <annotation>
+ <documentation>List of email addresses separated by ',' (comma)
+ or whitespace.</documentation>
+ </annotation>
</attribute>
<attribute name="users" type="string">
- <annotation><documentation>list of user ids that are resolved to the email address against configured identity component.
- user ids should be separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ <annotation>
+ <documentation>List of users, resolved to email addresses thought
+ the configured identity component. Users are separated by ',' (comma)
+ ';' (semicolon) or whitespace.</documentation>
+ </annotation>
</attribute>
<attribute name="groups" type="string">
- <annotation><documentation>list of group ids that are resolved to the email address against configured identity component.
- group ids should be separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ <annotation>
+ <documentation>List of groups, that are resolved to the email address against
+ configured identity component. Groups are separated by ',' (comma)
+ ';' (semicolon) or whitespace</documentation>
+ </annotation>
</attribute>
</complexType>
@@ -1457,37 +1694,51 @@
</restriction>
</simpleType>
-
<simpleType name="templateType">
- <annotation><documentation>Reference to the email template</documentation></annotation>
- <restriction base="string"></restriction>
+ <annotation>
+ <documentation>Reference to the email template.</documentation>
+ </annotation>
+ <restriction base="string" />
</simpleType>
<element name="migrate-instances">
- <annotation><documentation>Information to migrate instances of previously deployed process definitions
- to the new one</documentation></annotation>
+ <annotation>
+ <documentation>Information to migrate instances of previously deployed
+ process definitions to the new version.</documentation>
+ </annotation>
<complexType>
- <sequence>
- <element name="migration-handler" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>The migration handler specifies the name of a class to be executed while migrating the process instance.</documentation></annotation>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="migration-handler">
+ <annotation>
+ <documentation>The migration handler specifies the name of a class to be executed
+ while migrating the process instance.</documentation>
+ </annotation>
<complexType>
- <attribute name="class"/>
+ <attribute name="class" />
</complexType>
</element>
- <element name="activity-mapping" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>One activity mapping will be present for each activity of which the name changed.</documentation></annotation>
+ <element name="activity-mapping">
+ <annotation>
+ <documentation>One activity mapping will be present for each activity of which the
+ name changed.</documentation>
+ </annotation>
<complexType>
<attribute name="old-name" type="string" use="required">
- <annotation><documentation>The name of the activity in the previously deployed process definition.</documentation></annotation>
+ <annotation>
+ <documentation>Name of the activity in the previously deployed
+ process definition.</documentation>
+ </annotation>
</attribute>
<attribute name="new-name" type="string" use="required">
- <annotation><documentation>The name of the activity in the newly deployed process definition</documentation></annotation>
+ <annotation>
+ <documentation>Name of the activity in the newly deployed
+ process definition.</documentation>
+ </annotation>
</attribute>
</complexType>
</element>
- </sequence>
- <attribute name="action" type="tns:migrationActionType" default="migrate">
- </attribute>
+ </choice>
+ <attribute name="action" type="tns:migrationActionType" default="migrate" />
</complexType>
</element>
@@ -1497,5 +1748,4 @@
<enumeration value="migrate" />
</restriction>
</simpleType>
-
</schema>
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnBinding.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnBinding.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -30,7 +30,7 @@
public abstract class BpmnBinding extends TagBinding {
- protected static final WireParser wireParser = BpmnParser.wireParser;
+ protected static final WireParser wireParser = WireParser.getInstance();
protected String default_;
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -27,23 +27,17 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.bpmn.common.Resource;
import org.jbpm.bpmn.common.ResourceParameter;
import org.jbpm.bpmn.flownodes.BpmnActivity;
-import org.jbpm.bpmn.flownodes.BpmnBinding;
-import org.jbpm.bpmn.flownodes.BpmnEvent;
-import org.jbpm.bpmn.flownodes.NoneStartEventActivity;
-import org.jbpm.bpmn.flownodes.SubProcessActivity;
import org.jbpm.bpmn.model.BpmnProcessDefinition;
import org.jbpm.bpmn.model.SequenceflowCondition;
import org.jbpm.internal.log.Log;
@@ -58,14 +52,12 @@
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
+import org.jbpm.pvm.internal.util.CollectionUtil;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
/**
* @author Tom Baeyens
@@ -77,27 +69,18 @@
private static final Log log = Log.getLog(BpmnParser.class.getName());
- static ObjectBinding objectBinding = new ObjectBinding();
- public static final WireParser wireParser = WireParser.getInstance();
+ private static final String[] DEFAULT_ACTIVITIES_RESOURCES = { "jbpm.bpmn.flownodes.xml" };
+ private static final String CATEGORY_ACTIVITY = "activity";
+ private static final String[] SCHEMA_RESOURCES = { "BPMN20.xsd", "DiagramDefinition.xsd",
+ "DiagramInterchange.xsd", "BpmnDi.xsd" };
- static final String[] DEFAULT_ACTIVITIES_RESOURCES = { "jbpm.bpmn.flownodes.xml" };
- static final String CATEGORY_ACTIVITY = "activity";
-
static BindingsParser bindingsParser = new BindingsParser();
public BpmnParser() {
-
- initialize(); // initialises underlying SAX parser
- parseBindings(); // initialises bindings
-
+ // initialises bindings
+ parseBindings();
// Setting BPMN2 xsd schema
- List<String> schemaResources = new ArrayList<String>();
- schemaResources.add("BPMN20.xsd");
- schemaResources.add("DiagramDefinition.xsd");
- schemaResources.add("DiagramInterchange.xsd");
- schemaResources.add("BpmnDi.xsd");
- setSchemaResources(schemaResources);
-
+ setSchemaResources(SCHEMA_RESOURCES);
}
public Object parseDocumentElement(Element documentElement, Parse parse) {
@@ -173,10 +156,13 @@
while (resourceUrls.hasMoreElements()) {
URL resourceUrl = resourceUrls.nextElement();
log.trace("loading bpmn activities from resource: " + resourceUrl);
- List<BpmnBinding> activityBindings = (List<BpmnBinding>) bindingsParser.createParse().setUrl(resourceUrl).execute().checkErrors(
- "bpmn activities from " + resourceUrl.toString()).getDocumentObject();
+ List<?> activityBindings = (List<?>) bindingsParser.createParse()
+ .setUrl(resourceUrl)
+ .execute()
+ .checkErrors("bpmn activities from " + resourceUrl.toString())
+ .getDocumentObject();
- for (TagBinding binding : activityBindings) {
+ for (TagBinding binding: CollectionUtil.checkList(activityBindings, TagBinding.class)) {
binding.setCategory(CATEGORY_ACTIVITY);
bindings.addBinding(binding);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -25,13 +25,14 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
+import org.w3c.dom.Element;
+
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.listener.EventListener;
@@ -73,7 +74,6 @@
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.jbpm.pvm.internal.xml.ProblemImpl;
-import org.w3c.dom.Element;
/**
* @author Tom Baeyens
@@ -88,18 +88,18 @@
public static final String NAMESPACE_JPDL_44 = "http://jbpm.org/4.4/jpdl";
public static final String CURRENT_VERSION_JBPM = "4.4";
- public static final String CURRENT_VERSION_NAMESPACE = "http://jbpm.org/" + CURRENT_VERSION_JBPM + "/jpdl";
- public static final String CURRENT_VERSION_PROCESS_LANGUAGE_ID = "jpdl-" + CURRENT_VERSION_JBPM;
+ public static final String CURRENT_VERSION_NAMESPACE =
+ "http://jbpm.org/" + CURRENT_VERSION_JBPM + "/jpdl";
+ public static final String CURRENT_VERSION_PROCESS_LANGUAGE_ID =
+ "jpdl-" + CURRENT_VERSION_JBPM;
- private static final List<String> SCHEMA_RESOURCES = Arrays.asList("jpdl-4.0.xsd",
- "jpdl-4.2.xsd", "jpdl-4.3.xsd", "jpdl-4.4.xsd");
+ private static final String[] SCHEMA_RESOURCES =
+ { "jpdl-4.0.xsd", "jpdl-4.2.xsd", "jpdl-4.3.xsd", "jpdl-4.4.xsd" };
// array elements are mutable, even when final
// never make a static array public
- private static final String[] DEFAULT_BINDING_RESOURCES = {
- "jbpm.jpdl.bindings.xml",
- "jbpm.user.bindings.xml"
- };
+ private static final String[] DEFAULT_BINDING_RESOURCES =
+ { "jbpm.jpdl.bindings.xml", "jbpm.user.bindings.xml" };
private static JpdlBindingsParser jpdlBindingsParser = new JpdlBindingsParser();
@@ -107,7 +107,6 @@
public static final String CATEGORY_EVENT_LISTENER = "eventlistener";
public JpdlParser() {
- initialize();
parseBindings();
setSchemaResources(SCHEMA_RESOURCES);
}
@@ -115,21 +114,22 @@
protected void parseBindings() {
this.bindings = new Bindings();
- for (String activityResource: DEFAULT_BINDING_RESOURCES) {
+ for (String activityResource : DEFAULT_BINDING_RESOURCES) {
Enumeration<URL> resourceUrls = getResources(activityResource);
if (resourceUrls.hasMoreElements()) {
while (resourceUrls.hasMoreElements()) {
URL resourceUrl = resourceUrls.nextElement();
- log.trace("loading jpdl bindings from resource: "+resourceUrl);
+ log.trace("loading jpdl bindings from resource: " + resourceUrl);
jpdlBindingsParser.createParse()
.setUrl(resourceUrl)
.contextMapPut(Parse.CONTEXT_KEY_BINDINGS, bindings)
.execute()
- .checkErrors("jpdl bindings from "+resourceUrl.toString());
+ .checkErrors("jpdl bindings from " + resourceUrl.toString());
}
- } else {
- log.trace("skipping unavailable jpdl activities resource: "+activityResource);
}
+ else {
+ log.trace("skipping unavailable jpdl activities resource: " + activityResource);
+ }
}
}
@@ -142,20 +142,19 @@
if (!resourceUrls.hasMoreElements()) {
resourceUrls = JpdlParser.class.getClassLoader().getResources(resourceName);
}
- } catch (Exception e) {
- throw new JbpmException("couldn't get resource urls for "+resourceName, e);
}
+ catch (Exception e) {
+ throw new JbpmException("couldn't get resource urls for " + resourceName, e);
+ }
return resourceUrls;
}
public Object parseDocumentElement(Element documentElement, Parse parse) {
- List<ProcessDefinitionImpl> processDefinitions = new ArrayList<ProcessDefinitionImpl>();
-
JpdlProcessDefinition processDefinition = instantiateNewJpdlProcessDefinition();
+ parse.contextStackPush(processDefinition);
+ List<ProcessDefinitionImpl> processDefinitions = new ArrayList<ProcessDefinitionImpl>();
processDefinitions.add(processDefinition);
-
- parse.contextStackPush(processDefinition);
try {
// process attribues
String name = XmlUtil.attribute(documentElement, "name", parse);
@@ -165,33 +164,34 @@
// to allow for specific parsing behaviour per version
// first check if the langid is available as a deployment property
- DeploymentImpl deployment = (DeploymentImpl) parse.contextMapGet(Parse.CONTEXT_KEY_DEPLOYMENT);
- if (deployment!=null) {
+ DeploymentImpl deployment =
+ (DeploymentImpl) parse.contextMapGet(Parse.CONTEXT_KEY_DEPLOYMENT);
+ if (deployment != null) {
String processLanguageId = deployment.getProcessLanguageId(name);
- if (processLanguageId==null) {
+ if (processLanguageId == null) {
// if it is not available as a deployment property, check if the
// jpdlparser attribute specifies a specific jpdl version.
// this is the case for certain compatibility tests in our test suite
String jpdlParser = XmlUtil.attribute(documentElement, "jpdlparser");
- if (jpdlParser!=null) {
+ if (jpdlParser != null) {
processLanguageId = "jpdl-" + jpdlParser;
-
- } else {
+ }
+ else {
// if none of the above, check if this is a parser test run for a specific verion
// specify the jpdltestversion with "mvn -Djpdlparser=jpdl-4.4 clean install"
// that way, the whole test suite will be use the specified parser
jpdlParser = System.getProperty("jpdlparser");
- if (jpdlParser!=null) {
+ if (jpdlParser != null) {
processLanguageId = "jpdl-" + jpdlParser;
-
- } else {
+ }
+ else {
// if this process has a namespace, then use the namespace
// to see what jpdl parser version should be used
String namespaceUri = documentElement.getNamespaceURI();
- if (namespaceUri!=null) {
+ if (namespaceUri != null) {
processLanguageId = "jpdl-" + namespaceUri.substring(16, 19);
-
- } else {
+ }
+ else {
// if none of the above, just deploy it as the current library version
processLanguageId = CURRENT_VERSION_PROCESS_LANGUAGE_ID;
}
@@ -209,17 +209,17 @@
processDefinition.setPackageName(packageName);
Integer version = XmlUtil.attributeInteger(documentElement, "version", parse);
- if (version!=null) {
+ if (version != null) {
processDefinition.setVersion(version);
}
String key = XmlUtil.attribute(documentElement, "key");
- if (key!=null) {
+ if (key != null) {
processDefinition.setKey(key);
}
Element descriptionElement = XmlUtil.element(documentElement, "description");
- if (descriptionElement!=null) {
+ if (descriptionElement != null) {
String description = XmlUtil.getContentText(descriptionElement);
processDefinition.setDescription(description);
}
@@ -229,11 +229,11 @@
// swimlanes
List<Element> swimlaneElements = XmlUtil.elements(documentElement, "swimlane");
- for (Element swimlaneElement: swimlaneElements) {
+ for (Element swimlaneElement : swimlaneElements) {
String swimlaneName = XmlUtil.attribute(swimlaneElement, "name", parse);
- if (swimlaneName!=null) {
+ if (swimlaneName != null) {
SwimlaneDefinitionImpl swimlaneDefinition =
- processDefinition.createSwimlaneDefinition(swimlaneName);
+ processDefinition.createSwimlaneDefinition(swimlaneName);
parseAssignmentAttributes(swimlaneElement, swimlaneDefinition, parse);
}
}
@@ -255,12 +255,12 @@
if (migrationElement != null) {
MigrationHelper.parseMigrationDescriptor(migrationElement, parse, processDefinition);
}
-
- } finally {
+ }
+ finally {
parse.contextStackPop();
}
- if (processDefinition.getInitial()==null) {
+ if (processDefinition.getInitial() == null) {
parse.addProblem("no start activity in process", documentElement);
}
@@ -271,21 +271,21 @@
return new JpdlProcessDefinition();
}
- protected void resolveTransitionDestinations(Parse parse, JpdlProcessDefinition processDefinition, UnresolvedTransitions unresolvedTransitions) {
- for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
+ protected void resolveTransitionDestinations(Parse parse,
+ JpdlProcessDefinition processDefinition, UnresolvedTransitions unresolvedTransitions) {
+ for (UnresolvedTransition unresolvedTransition : unresolvedTransitions.list) {
unresolvedTransition.resolve(processDefinition, parse);
}
}
- public void parseActivities(Element documentElement, Parse parse, CompositeElementImpl compositeElement) {
+ public void parseActivities(Element documentElement, Parse parse,
+ CompositeElementImpl compositeElement) {
List<Element> elements = XmlUtil.elements(documentElement);
for (Element nestedElement : elements) {
String tagName = nestedElement.getLocalName();
- if ("on".equals(tagName)
- || "timer".equals(tagName)
- || "swimlane".equals(tagName)
- || "migrate-instances".equals(tagName)
- || "description".equals(tagName)) continue;
+ if ("on".equals(tagName) || "timer".equals(tagName) || "swimlane".equals(tagName)
+ || "migrate-instances".equals(tagName) || "description".equals(tagName))
+ continue;
JpdlBinding activityBinding = (JpdlBinding) getBinding(nestedElement, CATEGORY_ACTIVITY);
if (activityBinding == null) {
@@ -302,16 +302,17 @@
parseVariableDefinitions(nestedElement, parse, activity);
Element descriptionElement = XmlUtil.element(nestedElement, "description");
- if (descriptionElement!=null) {
+ if (descriptionElement != null) {
String description = XmlUtil.getContentText(descriptionElement);
activity.setDescription(description);
}
String continuationText = XmlUtil.attribute(nestedElement, "continue");
- if (continuationText!=null) {
+ if (continuationText != null) {
if ("async".equals(continuationText)) {
activity.setContinuation(Continuation.ASYNCHRONOUS);
- } else if ("exclusive".equals(continuationText)) {
+ }
+ else if ("exclusive".equals(continuationText)) {
activity.setContinuation(Continuation.EXCLUSIVE);
}
}
@@ -320,7 +321,8 @@
if (parseResult instanceof ActivityBehaviour) {
ActivityBehaviour activityBehaviour = (ActivityBehaviour) parseResult;
activity.setActivityBehaviour(activityBehaviour);
- } else {
+ }
+ else {
Descriptor activityBehaviourDescriptor = (Descriptor) parseResult;
activity.setActivityBehaviourDescriptor(activityBehaviourDescriptor);
}
@@ -328,7 +330,8 @@
parseOnEvents(nestedElement, parse, activity);
String g = XmlUtil.attribute(nestedElement, "g");
- if (g == null) continue;
+ if (g == null)
+ continue;
StringTokenizer stringTokenizer = new StringTokenizer(g, ",");
ActivityCoordinatesImpl coordinates = null;
@@ -339,43 +342,50 @@
int width = Integer.parseInt(stringTokenizer.nextToken());
int height = Integer.parseInt(stringTokenizer.nextToken());
coordinates = new ActivityCoordinatesImpl(x, y, width, height);
- } catch (NumberFormatException e) {
+ }
+ catch (NumberFormatException e) {
coordinates = null;
}
}
if (coordinates != null) {
activity.setCoordinates(coordinates);
- } else {
+ }
+ else {
parse.addProblem("invalid coordinates g=\"" + g + "\" in " + activity, nestedElement);
}
- } finally {
+ }
+ finally {
parse.contextStackPop();
}
}
}
- public TimerDefinitionImpl parseTimerDefinition(Element timerElement, Parse parse, ScopeElementImpl scopeElement) {
+ public TimerDefinitionImpl parseTimerDefinition(Element timerElement, Parse parse,
+ ScopeElementImpl scopeElement) {
TimerDefinitionImpl timerDefinition = scopeElement.createTimerDefinition();
String duedate = XmlUtil.attribute(timerElement, "duedate");
String duedatetime = XmlUtil.attribute(timerElement, "duedatetime");
- if (duedate!=null) {
+ if (duedate != null) {
timerDefinition.setDueDateDescription(duedate);
-
- } else if (duedatetime!=null) {
- String dueDateTimeFormatText = (String) EnvironmentImpl.getFromCurrent("jbpm.duedatetime.format", false);
- if (dueDateTimeFormatText==null) {
+ }
+ else if (duedatetime != null) {
+ String dueDateTimeFormatText =
+ (String) EnvironmentImpl.getFromCurrent("jbpm.duedatetime.format", false);
+ if (dueDateTimeFormatText == null) {
dueDateTimeFormatText = "HH:mm dd/MM/yyyy";
}
SimpleDateFormat dateFormat = new SimpleDateFormat(dueDateTimeFormatText);
try {
Date duedatetimeDate = dateFormat.parse(duedatetime);
timerDefinition.setDueDate(duedatetimeDate);
- } catch (ParseException e) {
- parse.addProblem("couldn't parse duedatetime "+duedatetime, e);
}
- } else {
+ catch (ParseException e) {
+ parse.addProblem("couldn't parse duedatetime " + duedatetime, e);
+ }
+ }
+ else {
parse.addProblem("either duedate or duedatetime is required in timer", timerElement);
}
@@ -388,80 +398,84 @@
public void parseOnEvents(Element element, Parse parse, ScopeElementImpl scopeElement) {
// event listeners
List<Element> onElements = XmlUtil.elements(element, "on");
- for (Element onElement: onElements) {
+ for (Element onElement : onElements) {
String eventName = XmlUtil.attribute(onElement, "event", parse);
parseOnEvent(onElement, parse, scopeElement, eventName);
Element timerElement = XmlUtil.element(onElement, "timer");
- if (timerElement!=null) {
- TimerDefinitionImpl timerDefinitionImpl = parseTimerDefinition(timerElement, parse, scopeElement);
+ if (timerElement != null) {
+ TimerDefinitionImpl timerDefinitionImpl =
+ parseTimerDefinition(timerElement, parse, scopeElement);
timerDefinitionImpl.setEventName(eventName);
}
}
}
- public void parseOnEvent(Element element, Parse parse, ObservableElementImpl observableElement, String eventName) {
- if (eventName!=null) {
+ public void parseOnEvent(Element element, Parse parse,
+ ObservableElementImpl observableElement, String eventName) {
+ if (eventName != null) {
EventImpl event = observableElement.getEvent(eventName);
- if (event==null) {
+ if (event == null) {
event = observableElement.createEvent(eventName);
}
String continuationText = XmlUtil.attribute(element, "continue");
- if (continuationText!=null) {
+ if (continuationText != null) {
if ("async".equals(continuationText)) {
event.setContinuation(Continuation.ASYNCHRONOUS);
- } else if ("exclusive".equals(continuationText)) {
+ }
+ else if ("exclusive".equals(continuationText)) {
event.setContinuation(Continuation.EXCLUSIVE);
}
}
- for (Element eventListenerElement: XmlUtil.elements(element)) {
- JpdlBinding eventBinding = (JpdlBinding) getBinding(eventListenerElement, CATEGORY_EVENT_LISTENER);
- if (eventBinding!=null) {
+ for (Element eventListenerElement : XmlUtil.elements(element)) {
+ JpdlBinding eventBinding =
+ (JpdlBinding) getBinding(eventListenerElement, CATEGORY_EVENT_LISTENER);
+ if (eventBinding != null) {
EventListenerReference eventListenerReference = null;
Object parseResult = eventBinding.parse(eventListenerElement, parse, this);
if (parseResult instanceof EventListener) {
EventListener eventListener = (EventListener) parseResult;
eventListenerReference = event.createEventListenerReference(eventListener);
- } else {
+ }
+ else {
Descriptor eventListenerDescriptor = (Descriptor) parseResult;
- eventListenerReference = event.createEventListenerReference(eventListenerDescriptor);
+ eventListenerReference =
+ event.createEventListenerReference(eventListenerDescriptor);
}
- Boolean propagationEnabled = XmlUtil.attributeBoolean(eventListenerElement, "propagation", parse);
- if (propagationEnabled!=null) {
+ Boolean propagationEnabled =
+ XmlUtil.attributeBoolean(eventListenerElement, "propagation", parse);
+ if (propagationEnabled != null) {
eventListenerReference.setPropagationEnabled(propagationEnabled);
}
continuationText = XmlUtil.attribute(eventListenerElement, "continue");
- if (continuationText!=null) {
+ if (continuationText != null) {
if (observableElement instanceof ActivityImpl) {
- if (observableElement.getName()==null) {
+ if (observableElement.getName() == null) {
parse.addProblem("async continuation on event listener requires activity name", eventListenerElement);
}
- } else if (observableElement instanceof TransitionImpl) {
+ }
+ else if (observableElement instanceof TransitionImpl) {
TransitionImpl transition = (TransitionImpl) observableElement;
- if (transition.getSource().getName()==null) {
+ if (transition.getSource().getName() == null) {
parse.addProblem("async continuation on event listener requires name in the transition source activity", eventListenerElement);
}
}
if ("async".equals(continuationText)) {
eventListenerReference.setContinuation(Continuation.ASYNCHRONOUS);
- } else if ("exclusive".equals(continuationText)) {
+ }
+ else if ("exclusive".equals(continuationText)) {
eventListenerReference.setContinuation(Continuation.EXCLUSIVE);
}
}
-
- } else {
+ }
+ else {
String tagName = eventListenerElement.getLocalName();
- if ( ! ( (observableElement instanceof TransitionImpl)
- && ( "condition".equals(tagName)
- || "timer".equals(tagName)
- )
- )
- ) {
- parse.addProblem("unrecognized event listener: "+tagName, null, ProblemImpl.TYPE_WARNING, eventListenerElement);
+ if (!(observableElement instanceof TransitionImpl && ("condition".equals(tagName) || "timer".equals(tagName)))) {
+ parse.addProblem("unrecognized event listener: " + tagName, null, ProblemImpl.TYPE_WARNING, eventListenerElement);
}
}
}
@@ -469,14 +483,17 @@
}
public void parseTransitions(Element element, ActivityImpl activity, Parse parse) {
+ UnresolvedTransitions unresolvedTransitions =
+ parse.contextStackFind(UnresolvedTransitions.class);
+
List<Element> transitionElements = XmlUtil.elements(element, "transition");
- UnresolvedTransitions unresolvedTransitions = parse.contextStackFind(UnresolvedTransitions.class);
- for (Element transitionElement: transitionElements) {
+ for (Element transitionElement : transitionElements) {
String transitionName = XmlUtil.attribute(transitionElement, "name");
Element timerElement = XmlUtil.element(transitionElement, "timer");
- if (timerElement!=null) {
- TimerDefinitionImpl timerDefinitionImpl = parseTimerDefinition(timerElement, parse, activity);
+ if (timerElement != null) {
+ TimerDefinitionImpl timerDefinitionImpl =
+ parseTimerDefinition(timerElement, parse, activity);
timerDefinitionImpl.setSignalName(transitionName);
}
@@ -484,48 +501,56 @@
transition.setName(transitionName);
unresolvedTransitions.add(transition, transitionElement);
-
parseOnEvent(transitionElement, parse, transition, Event.TAKE);
}
}
- public void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
+ public void parseAssignmentAttributes(Element element,
+ AssignableDefinitionImpl assignableDefinition, Parse parse) {
Element descriptionElement = XmlUtil.element(element, "description");
- if (descriptionElement!=null) {
+ if (descriptionElement != null) {
String descriptionText = XmlUtil.getContentText(descriptionElement);
- Expression descriptionExpression = Expression.create(descriptionText, Expression.LANGUAGE_UEL_VALUE);
+ Expression descriptionExpression =
+ Expression.create(descriptionText, Expression.LANGUAGE_UEL_VALUE);
assignableDefinition.setDescription(descriptionExpression);
}
Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
- if (assignmentHandlerElement!=null) {
- UserCodeReference assignmentHandlerReference = parseUserCodeReference(assignmentHandlerElement, parse);
+ if (assignmentHandlerElement != null) {
+ UserCodeReference assignmentHandlerReference =
+ parseUserCodeReference(assignmentHandlerElement, parse);
assignableDefinition.setAssignmentHandlerReference(assignmentHandlerReference);
}
String assigneeExpressionText = XmlUtil.attribute(element, "assignee");
- if (assigneeExpressionText!=null) {
+ if (assigneeExpressionText != null) {
String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
- Expression assigneeExpression = Expression.create(assigneeExpressionText, assigneeExpressionLanguage);
+ Expression assigneeExpression =
+ Expression.create(assigneeExpressionText, assigneeExpressionLanguage);
assignableDefinition.setAssigneeExpression(assigneeExpression);
}
String candidateUsersExpressionText = XmlUtil.attribute(element, "candidate-users");
- if (candidateUsersExpressionText!=null) {
- String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
- Expression candidateUsersExpression = Expression.create(candidateUsersExpressionText, candidateUsersExpressionLanguage);
+ if (candidateUsersExpressionText != null) {
+ String candidateUsersExpressionLanguage =
+ XmlUtil.attribute(element, "candidate-users-lang");
+ Expression candidateUsersExpression =
+ Expression.create(candidateUsersExpressionText, candidateUsersExpressionLanguage);
assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
}
String candidateGroupsExpressionText = XmlUtil.attribute(element, "candidate-groups");
- if (candidateGroupsExpressionText!=null) {
- String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
- Expression candidateGroupsExpression = Expression.create(candidateGroupsExpressionText, candidateGroupsExpressionLanguage);
+ if (candidateGroupsExpressionText != null) {
+ String candidateGroupsExpressionLanguage =
+ XmlUtil.attribute(element, "candidate-groups-lang");
+ Expression candidateGroupsExpression =
+ Expression.create(candidateGroupsExpressionText, candidateGroupsExpressionLanguage);
assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
}
}
- public TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse, ScopeElementImpl scopeElement) {
+ public TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse,
+ ScopeElementImpl scopeElement) {
TaskDefinitionImpl taskDefinition = new TaskDefinitionImpl();
String taskName = XmlUtil.attribute(element, "name");
@@ -542,22 +567,27 @@
taskDefinition.setPriority(priority);
}
- ProcessDefinitionImpl processDefinition = parse.contextStackFind(ProcessDefinitionImpl.class);
- if (processDefinition.getTaskDefinition(taskName)!=null) {
- parse.addProblem("duplicate task name "+taskName, element);
- } else {
+ ProcessDefinitionImpl processDefinition =
+ parse.contextStackFind(ProcessDefinitionImpl.class);
+ if (processDefinition.getTaskDefinition(taskName) != null) {
+ parse.addProblem("duplicate task name " + taskName, element);
+ }
+ else {
processDefinition.addTaskDefinitionImpl(taskDefinition);
}
String swimlaneName = XmlUtil.attribute(element, "swimlane");
- if (swimlaneName!=null) {
- JpdlProcessDefinition jpdlProcessDefinition = parse.contextStackFind(JpdlProcessDefinition.class);
- SwimlaneDefinitionImpl swimlaneDefinition = jpdlProcessDefinition.getSwimlaneDefinition(swimlaneName);
- if (swimlaneDefinition!=null) {
+ if (swimlaneName != null) {
+ JpdlProcessDefinition jpdlProcessDefinition =
+ parse.contextStackFind(JpdlProcessDefinition.class);
+ SwimlaneDefinitionImpl swimlaneDefinition =
+ jpdlProcessDefinition.getSwimlaneDefinition(swimlaneName);
+ if (swimlaneDefinition != null) {
taskDefinition.setSwimlaneDefinition(swimlaneDefinition);
- } else {
- parse.addProblem("swimlane "+swimlaneName+" not declared", element);
}
+ else {
+ parse.addProblem("swimlane " + swimlaneName + " not declared", element);
+ }
}
parseAssignmentAttributes(element, taskDefinition, parse);
@@ -572,17 +602,19 @@
if (reminderElement != null) {
parseMailEvent(reminderElement, parse, scopeElement, Event.REMIND);
// associate timer to event
- TimerDefinitionImpl timerDefinition = parseTimerDefinition(reminderElement, parse, scopeElement);
+ TimerDefinitionImpl timerDefinition =
+ parseTimerDefinition(reminderElement, parse, scopeElement);
timerDefinition.setEventName(Event.REMIND);
}
return taskDefinition;
}
- public void parseVariableDefinitions(Element element, Parse parse, ScopeElementImpl scopeElement) {
+ public void parseVariableDefinitions(Element element, Parse parse,
+ ScopeElementImpl scopeElement) {
List<VariableDefinitionImpl> variableDefinitions = new ArrayList<VariableDefinitionImpl>();
- for (Element variableElement: XmlUtil.elements(element, "variable")) {
+ for (Element variableElement : XmlUtil.elements(element, "variable")) {
VariableDefinitionImpl variableDefinition = scopeElement.createVariableDefinition();
String name = XmlUtil.attribute(variableElement, "name", parse);
@@ -600,20 +632,21 @@
String initExpr = XmlUtil.attribute(variableElement, "init-expr");
String initExprType = XmlUtil.attribute(variableElement, "init-expr-type");
- if (initExpr!=null) {
+ if (initExpr != null) {
Expression initExpression = Expression.create(initExpr, initExprType);
variableDefinition.setInitExpression(initExpression);
sources++;
}
Element initDescriptorElement = XmlUtil.element(variableElement);
- if (initDescriptorElement!=null) {
- Descriptor initValueDescriptor = (Descriptor) WireParser.getInstance().parseElement(initDescriptorElement, parse);
+ if (initDescriptorElement != null) {
+ Descriptor initValueDescriptor =
+ (Descriptor) WireParser.getInstance().parseElement(initDescriptorElement, parse);
variableDefinition.setInitDescriptor(initValueDescriptor);
sources++;
}
- if (sources>1) {
+ if (sources > 1) {
parse.addProblem("init attribute and init element are mutually exclusive on element variable", variableElement);
}
@@ -622,7 +655,7 @@
}
public void parseMailEvent(Element element, Parse parse,
- ObservableElementImpl observableElement, String eventName) {
+ ObservableElementImpl observableElement, String eventName) {
// obtain assign event
EventImpl event = observableElement.getEvent(eventName);
if (event == null) {
@@ -640,20 +673,22 @@
eventListenerRef.setContinuation(Continuation.EXCLUSIVE);
}
- //https://jira.jboss.org/jira/browse/JBPM-2466
+ // https://jira.jboss.org/jira/browse/JBPM-2466
String mailTemplateName = eventName;
if (Event.ASSIGN.equals(eventName)) {
- mailTemplateName = "task-notification";
- } else if (Event.REMIND.equals(eventName)) {
- mailTemplateName = "task-reminder";
+ mailTemplateName = "task-notification";
}
+ else if (Event.REMIND.equals(eventName)) {
+ mailTemplateName = "task-reminder";
+ }
// associate mail producer to event listener
UserCodeReference mailProducer = parseMailProducer(element, parse, mailTemplateName);
eventListener.setMailProducerReference(mailProducer);
}
- public UserCodeReference parseMailProducer(Element element, Parse parse, String defaultTemplateName) {
+ public UserCodeReference parseMailProducer(Element element, Parse parse,
+ String defaultTemplateName) {
// check whether the element is a generic object descriptor
if (ObjectBinding.isObjectDescriptor(element)) {
return parseUserCodeReference(element, parse);
@@ -670,7 +705,7 @@
}
private MailTemplate parseMailTemplate(Element element, Parse parse,
- String defaultTemplateName) {
+ String defaultTemplateName) {
if (element.hasAttribute("template")) {
// fetch template from configuration
return findMailTemplate(element, parse, element.getAttribute("template"));
@@ -684,15 +719,17 @@
return findMailTemplate(element, parse, defaultTemplateName);
}
parse.addProblem("mail template must be referenced in the 'template' attribute "
- + "or specified inline", element);
+ + "or specified inline", element);
return null;
}
private MailTemplate findMailTemplate(Element element, Parse parse, String templateName) {
- MailTemplateRegistry templateRegistry = EnvironmentImpl.getFromCurrent(MailTemplateRegistry.class);
+ MailTemplateRegistry templateRegistry =
+ EnvironmentImpl.getFromCurrent(MailTemplateRegistry.class);
if (templateRegistry != null) {
MailTemplate template = templateRegistry.getTemplate(templateName);
- if (template != null) return template;
+ if (template != null)
+ return template;
}
parse.addProblem("mail template not found: " + templateName, element);
return null;
@@ -704,13 +741,13 @@
ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
userCodeReference.setDescriptor(objectDescriptor);
- if (objectDescriptor.getExpression()!=null) {
+ if (objectDescriptor.getExpression() != null) {
// expressions are not cached by default
userCodeReference.setCached(false);
}
Boolean isCached = XmlUtil.attributeBoolean(element, "cache", parse);
- if (isCached!=null) {
+ if (isCached != null) {
userCodeReference.setCached(isCached.booleanValue());
}
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -11,7 +11,7 @@
public class CacheParsingTest extends JpdlParseTestCase {
public void testCacheDisabled() {
- String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ String xmlString = "<process name='MyProcess' xmlns='http://jbpm.org/4.4/jpdl'>\n"
+ " <start name='start'>\n"
+ " <transition name='myTransition' to='end'>\n"
+ " <event-listener class='com.comp.MyEventListener' cache='disabled'/>\n"
@@ -24,11 +24,11 @@
.setString(xmlString)
.execute()
.getProblems();
- assertEquals(0, problems.size());
+ assertEquals(problems.toString(), 0, problems.size());
}
public void testCachePowered() {
- String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ String xmlString = "<process name='MyProcess' xmlns='http://jbpm.org/4.4/jpdl'>\n"
+ " <start name='start'>\n"
+ " <transition name='myTransition' to='end'>\n"
+ " <event-listener class='com.comp.MyEventListener' cache='powered'/>\n"
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -11,7 +11,7 @@
public class MailParsingTest extends JpdlParseTestCase {
public void testMailParse() {
- String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>"
+ String xmlString = "<process name='MyProcess' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start name='start'>"
+ " <transition to='mail'/>"
+ " </start>"
@@ -25,6 +25,6 @@
.setString(xmlString)
.execute()
.getProblems();
- assertEquals(0, problems.size());
+ assertEquals(problems.toString(), 0, problems.size());
}
}
Modified: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3Converter.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3Converter.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3Converter.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -50,6 +50,8 @@
import org.jbpm.jpdl.internal.convert.problem.Problem;
import org.jbpm.jpdl.internal.convert.problem.ProblemListener;
import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.util.CollectionUtil;
+
import org.xml.sax.InputSource;
/**
@@ -313,7 +315,7 @@
}
//Implement it
- List starts = jpdl4Element.elements("start-state");
+ List<?> starts = jpdl4Element.elements("start-state");
// check for duplicate start-states
if ((node instanceof StartState) && !starts.isEmpty()) {
@@ -386,8 +388,8 @@
newTransistion.addAttribute("to", to);
} else {
//The last task node has a transition to the node after the original TaskNode
- List<Element> transitions = jpdl3Element.elements("transition");
- for (Element trans : transitions) {
+ List<?> transitions = jpdl3Element.elements("transition");
+ for (Element trans : CollectionUtil.checkList(transitions, Element.class)) {
Element transElement = task4.addElement("transition");
String transName = trans.attributeValue("name") == null ? trans.attributeValue("to") :trans.attributeValue("name");
transElement.addAttribute("name", transName);
@@ -463,9 +465,7 @@
log.info("process xml information: no swimlane or assignment specified for task '" + taskElement.asXML() + "'");
}
- //event elements
- convertEvents(taskElement, task4);
-
+ //notification attribute
String notificationsText = taskElement.attributeValue("notify");
if (notificationsText != null && ("true".equalsIgnoreCase(notificationsText)
|| "on".equalsIgnoreCase(notificationsText) || "yes".equalsIgnoreCase(notificationsText))) {
@@ -475,6 +475,10 @@
}
//Reminder elements
convertTaskReminders(taskElement, task4);
+
+ //event elements
+ convertEvents(taskElement, task4);
+
//timer elements
convertTaskTimers(taskElement, task4);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -109,7 +109,8 @@
String addresses = fromTemplate.getAddresses();
if (addresses != null) {
addresses = evaluateExpression(addresses);
- email.addFrom(InternetAddress.parse(addresses));
+ // non-strict parsing applies to a list of mail addresses entered by a human
+ email.addFrom(InternetAddress.parse(addresses, false));
}
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
@@ -179,7 +180,8 @@
String addresses = addressTemplate.getAddresses();
if (addresses != null) {
addresses = evaluateExpression(addresses);
- email.addRecipients(recipientType, InternetAddress.parse(addresses));
+ // non-strict parsing applies to a list of mail addresses entered by a human
+ email.addRecipients(recipientType, InternetAddress.parse(addresses, false));
}
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -21,16 +21,27 @@
*/
package org.jbpm.pvm.internal.xml;
+import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.stream.StreamInput;
import org.jbpm.pvm.internal.util.UrlEntity;
@@ -38,11 +49,6 @@
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
import org.jbpm.pvm.internal.wire.xml.WireParser;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
/** makes typical usage of JAXP more convenient, adds a binding framework,
* entity resolution and error handling.
@@ -247,25 +253,19 @@
*/
public class Parser {
- private static Log log = Log.getLog(Parser.class.getName());
+ private static final Log log = Log.getLog(Parser.class.getName());
- protected SAXParserFactory saxParserFactory;
- protected String[] schemaResources;
-
- protected DocumentBuilderFactory documentBuilderFactory = null;
-
- protected Bindings bindings = null;
- protected ClassLoader classLoader = null;
+ protected Bindings bindings;
+ protected final DocumentBuilderFactory documentBuilderFactory =
+ createDocumentBuilderFactory();
/** the default parser */
public Parser() {
- initialize();
}
/** creates a new Parser with bindings that can be maintained statically in
* specialized subclasses of Parser. */
public Parser(Bindings bindings) {
- initialize();
this.bindings = bindings;
}
@@ -274,61 +274,99 @@
* @deprecated entities should be replaced by {@link #setSchemaResources(List)} */
@Deprecated
public Parser(Bindings bindings, Map<String, Entity> entities) {
- initialize();
this.bindings = bindings;
}
-
+
// initialization ///////////////////////////////////////////////////////////
- public void initialize() {
- initializeSaxParserFactory();
- initializeDocumentBuilderFactory();
+ protected DocumentBuilderFactory createDocumentBuilderFactory() {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setCoalescing(true);
+ factory.setIgnoringComments(true);
+ return factory;
}
- public void initializeDocumentBuilderFactory() {
- documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- }
-
- public void initializeSaxParserFactory() {
- saxParserFactory = SAXParserFactory.newInstance();
- saxParserFactory.setNamespaceAware(true);
- }
-
// document builder methods /////////////////////////////////////////////////
/** customizable creation of a new document builder. Used by
- * {@link #buildDom(Parse)}. */
+ * {@link #buildDocument(Parse)}. */
protected DocumentBuilder createDocumentBuilder(Parse parse) {
try {
- parse.documentBuilder = documentBuilderFactory.newDocumentBuilder();
- } catch (Exception e) {
- parse.addProblem("couldn't get new document builder", e);
+ DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ documentBuilder.setErrorHandler(parse);
+ parse.documentBuilder = documentBuilder;
+ return documentBuilder;
+ }
+ catch (ParserConfigurationException e) {
+ parse.addProblem("could not create document builder", e);
return null;
}
- parse.documentBuilder.setErrorHandler(parse);
- return parse.documentBuilder;
}
// schema validation ////////////////////////////////////////////////////////
-
- public void setSchemaResources(List<String> resources) {
- saxParserFactory.setValidating(true);
- saxParserFactory.setNamespaceAware(true);
+ public void setSchemaResources(String... schemaResources) {
+ // load resources from classpath
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- List<String> schemaLocations = new ArrayList<String>(resources.size());
- for (String schemaResource: resources) {
- URL schemaUrl = classLoader.getResource(schemaResource);
- if (schemaUrl!=null) {
- String schemaLocation = schemaUrl.toString();
- log.trace("schema resource found: " + schemaResource);
- schemaLocations.add(schemaLocation);
- } else {
- log.debug("skipping unavailble schema resource: " + schemaResource);
+ String[] schemaSources = new String[schemaResources.length];
+
+ for (int i = 0; i < schemaResources.length; i++) {
+ String schemaResource = schemaResources[i];
+ URL schemaLocation = classLoader.getResource(schemaResource);
+ if (schemaLocation != null) {
+ log.info("loading schema resource: " + schemaResource);
+ schemaSources[i] = schemaLocation.toString();
}
+ else {
+ log.warn("skipping unavailable schema resource: " + schemaResource);
+ }
}
- schemaResources = schemaLocations.toArray(new String[schemaLocations.size()]);
+
+ documentBuilderFactory.setValidating(true);
+ try {
+ // set xml schema as the schema language
+ documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+ XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ // set schema sources
+ documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",
+ schemaSources);
+ }
+ catch (IllegalArgumentException e) {
+ log.warn("JAXP implementation does not support XML Schema, "
+ + "XML documents will not be checked for grammar errors", e);
+ }
+
+ try {
+ // validate the document only if a grammar is specified
+ documentBuilderFactory.setAttribute("http://apache.org/xml/features/validation/dynamic",
+ Boolean.TRUE);
+ }
+ catch (IllegalArgumentException e) {
+ log.warn("JAXP implementation is not Xerces, cannot enable dynamic validation, "
+ + "XML documents without schema location will not parse", e);
+ }
+
+ /*
+ try {
+ // parse schema sources
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(sources.toArray(new Source[sources.size()]));
+ // register schema
+ documentBuilderFactory.setSchema(schema);
+ try {
+ // validate the document only if a grammar is specified
+ documentBuilderFactory.setAttribute("http://apache.org/xml/features/validation/dynamic",
+ Boolean.TRUE);
+ }
+ catch (IllegalArgumentException e) {
+ log.info("could not enable dynamic validation feature", e);
+ }
+ }
+ catch (SAXException e) {
+ log.info("could not set schema", e);
+ }
+ */
}
// bindings /////////////////////////////////////////////////////////////////
@@ -350,7 +388,7 @@
/** the handler for the given element limited to a given category */
public Binding getBinding(Element element, String category) {
- return (bindings!=null ? bindings.getBinding(element, category) : null);
+ return (bindings != null ? bindings.getBinding(element, category) : null);
}
// runtime parsing methods //////////////////////////////////////////////////
@@ -369,98 +407,66 @@
// build the dom of the imported document
Parse importedParse = createParse();
importedParse.setStreamSource(importedStreamInput);
- Document importedDocument = buildDom(importedParse);
-
- // loop over all the imported document elements
+ Document importedDocument = buildDocument(importedParse);
+
+ // loop over all the imported document elements
Element importedDocumentElement = importedDocument.getDocumentElement();
- for(Element e : XmlUtil.elements(importedDocumentElement)) {
+ for (Element e : XmlUtil.elements(importedDocumentElement)) {
// import the element into the destination element
destination.appendChild(destination.getOwnerDocument().importNode(e, true));
}
importedParse.checkErrors(destination.getTagName());
-
- } catch (Exception e) {
- importingParse.addProblem("couldn't import "+importedStreamInput, e);
}
+ catch (Exception e) {
+ importingParse.addProblem("could not import " + importedStreamInput, e);
+ }
}
/** customizable parse execution */
protected void execute(Parse parse) {
try {
- if (parse.document==null) {
- parse.document = buildDom(parse);
+ if (parse.document == null) {
+ parse.document = buildDocument(parse);
}
// walk the dom tree
- if (parse.document!=null) {
+ if (parse.document != null) {
try {
// walk the dom tree
parseDocument(parse.document, parse);
-
- } catch (Exception e) {
- parse.addProblem("parsing exception: "+e.getMessage(), e);
}
+ catch (Exception e) {
+ parse.addProblem("parsing exception: " + e.getMessage(), e);
+ }
}
-
- } finally {
- if (parse.inputStream!=null) {
+ }
+ finally {
+ if (parse.inputStream != null) {
try {
parse.inputStream.close();
- } catch (Exception e) {
+ }
+ catch (Exception e) {
parse.addProblem("couldn't close input stream", e);
}
}
}
}
- protected Document buildDom(Parse parse) {
- Document document = null;
-
+ protected Document buildDocument(Parse parse) {
+ DocumentBuilder documentBuilder = createDocumentBuilder(parse);
+ InputSource inputSource = parse.getInputSource();
try {
- SAXParser saxParser = saxParserFactory.newSAXParser();
- XMLReader xmlReader = saxParser.getXMLReader();
-
- try {
- saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
- } catch (Exception e){
- log.info("couldn't set schema language property", e);
- }
-
- if (schemaResources!=null) {
- try {
- saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaResources);
- } catch (Exception e){
- log.info("couldn't set schema source property", e);
- }
- }
-
- try {
- xmlReader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
- } catch (Exception e){
- log.info("couldn't set dynamic validation feature", e);
- }
-
- DocumentBuilder documentBuilder = createDocumentBuilder(parse);
- document = documentBuilder.getDOMImplementation().createDocument(null, null, null);
- parse.setDocument(document);
-
- DomBuilder domBuilder = new DomBuilder();
- domBuilder.setDocument(document);
-
- xmlReader.setContentHandler(domBuilder);
- xmlReader.setErrorHandler(parse);
-
- InputSource inputSource = parse.getInputSource();
- xmlReader.parse(inputSource);
-
- } catch (Exception e) {
- parse.addProblem("couldn't parse xml document", e);
+ return documentBuilder.parse(inputSource);
}
-
- return document;
+ catch (IOException e) {
+ parse.addProblem("could not read input", e);
+ }
+ catch (SAXException e) {
+ parse.addProblem("failed to parse xml", e);
+ }
+ return null;
}
-
// Document Object Model walking ////////////////////////////////////////////
/** start of the DOM walk.
@@ -505,17 +511,18 @@
*
* @return the object that is the result from parsing this element. */
public Object parseElement(Element element, Parse parse, String category) {
-
Object object = null;
String tagName = element.getLocalName();
Binding binding = getBinding(element, category);
- if (binding!=null) {
+ if (binding != null) {
object = binding.parse(element, parse, this);
- } else if (log.isDebugEnabled()) {
- log.debug("no element parser for tag "+tagName+(category!=null ? " in category "+category : " in the default category"));
}
+ else if (log.isDebugEnabled()) {
+ log.debug("no element parser for tag " + tagName
+ + (category != null ? " in category " + category : " in the default category"));
+ }
return object;
}
@@ -526,17 +533,20 @@
public List<ArgDescriptor> parseArgs(List<Element> argElements, Parse parse, String category) {
List<ArgDescriptor> args = null;
- if (argElements!=null) {
- if (argElements.size()>0) {
+ if (argElements != null) {
+ if (argElements.size() > 0) {
args = new ArrayList<ArgDescriptor>(argElements.size());
}
- for (Element argElement: argElements) {
+ for (Element argElement : argElements) {
ArgDescriptor argDescriptor = new ArgDescriptor();
argDescriptor.setTypeName(XmlUtil.attribute(argElement, "type"));
Element descriptorElement = XmlUtil.element(argElement);
- if (descriptorElement==null) {
- parse.addProblem("arg must contain exactly one descriptor element out of "+bindings.getTagNames(category)+" as contents:"+XmlUtil.toString(argElement.getParentNode()), argElement);
- } else {
+ if (descriptorElement == null) {
+ parse.addProblem("arg must contain exactly one descriptor element out of "
+ + bindings.getTagNames(category) + " as contents:"
+ + XmlUtil.toString(argElement.getParentNode()), argElement);
+ }
+ else {
Descriptor descriptor = (Descriptor) parseElement(descriptorElement, parse, category);
argDescriptor.setDescriptor(descriptor);
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -27,27 +27,22 @@
import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Problem;
-
/**
* @author Huisheng Xu
*/
public class TypesBindingTest extends BaseJbpmTestCase {
- public void testParse() {
- Parser parser = new Parser();
- Bindings bindings = new Bindings();
- parser.setBindings(bindings);
- parser.getBindings().addBinding(new TypesBinding());
- String xml = "<types resource='org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml' />";
+ public void testParse() {
+ Parser parser = new Parser();
+ Bindings bindings = new Bindings();
+ parser.setBindings(bindings);
+ parser.getBindings().addBinding(new TypesBinding());
- List<Problem> problems = parser
- .createParse()
- .setString(xml)
- .execute()
- .getProblems();
+ String xml = "<types resource='org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml' />";
- assertTextPresent(
- "couldn't import resource://org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml",
- problems.get(0).getMsg());
- }
+ List<Problem> problems = parser.createParse().setString(xml).execute().getProblems();
+
+ assertTextPresent("org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml",
+ problems.get(0).getMsg());
+ }
}
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/custom/mail/CustomMailProducerTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -81,7 +81,7 @@
public void testCustomMailProducer() {
// deploy process
- deployJpdlXmlString("<process name='custommail' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='custommail' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='send mail' />"
+ " </start>"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/assign/AssignTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/assign/AssignTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/assign/AssignTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -33,7 +33,7 @@
public class AssignTest extends JbpmTestCase {
public void testFromExprToVar() {
- deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='resolve' />"
+ " </start>"
@@ -52,7 +52,7 @@
}
public void testFromMethodExprToVar() {
- deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='resolve' />"
+ " </start>"
@@ -71,7 +71,7 @@
}
public void testFromMethodParamExprToVar() {
- deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='resolve' />"
+ " </start>"
@@ -90,7 +90,7 @@
}
public void testFromDescToExpr() {
- deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='resolve' />"
+ " </start>"
@@ -111,7 +111,7 @@
}
public void testFromVarToVar() {
- deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/jpdl/4.4'>"
+ deployJpdlXmlString("<process name='AssignTest' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start>"
+ " <transition to='resolve' />"
+ " </start>"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/foreach/ForEachTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/foreach/ForEachTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/foreach/ForEachTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -42,7 +42,7 @@
public void testForEachLiteral() {
deployJpdlXmlString(""
- + "<process name='ForEachLiteral' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachLiteral' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -88,7 +88,7 @@
public void testForEachList() {
deployJpdlXmlString(""
- + "<process name='ForEachList' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachList' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -135,7 +135,7 @@
public void testForEachArray() {
deployJpdlXmlString(""
- + "<process name='ForEachArray' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachArray' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -182,7 +182,7 @@
public void testForEachInvalid() {
deployJpdlXmlString(""
- + "<process name='ForEachInvalid' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachInvalid' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -214,7 +214,7 @@
public void testForEachMissingVar() {
try {
deployJpdlXmlString(""
- + "<process name='ForEachMissingVar' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachMissingVar' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -243,7 +243,7 @@
public void testForEachJoinMultiplicity() {
deployJpdlXmlString(""
- + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -278,7 +278,7 @@
public void testForEachConditionMet() {
deployJpdlXmlString(""
- + "<process name='ForEachConditionMet' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachConditionMet' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -326,7 +326,7 @@
public void testForEachConditionNotMet() {
deployJpdlXmlString(""
- + "<process name='ForEachConditionNotMet' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachConditionNotMet' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -361,7 +361,7 @@
public void testForEachNoTransitions() {
try {
deployJpdlXmlString(""
- + "<process name='ForEachNoTransition' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachNoTransition' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -388,7 +388,7 @@
public void testForEachJoinMultiplicityLeftTask() {
deployJpdlXmlString(""
- + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
@@ -438,7 +438,7 @@
public void testForEachJoinMultiplicityLeftTasks() {
deployJpdlXmlString(""
- + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + "<process name='ForEachJoinMultiplicity' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start g='179,17,32,29' name='start1'>"
+ " <transition g='-43,-18' name='to foreach1' to='foreach1'/>"
+ " </start>"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/HistoryVariableTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/HistoryVariableTest.java 2010-07-09 19:27:23 UTC (rev 6476)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/HistoryVariableTest.java 2010-07-10 08:20:41 UTC (rev 6477)
@@ -15,9 +15,9 @@
public class HistoryVariableTest extends JbpmTestCase {
public void testDeclaredVariableWithHistory() {
- deployJpdlXmlString("<process name='var'>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <variable name='test' type='string' init-expr='history' history='true'/>"
- + " <start name='a'>"
+ + " <start nam='a'>"
+ " <transition to='b' />"
+ " </start>"
+ " <state name='b'/>"
@@ -41,9 +41,9 @@
}
public void testDeclaredVariablesWithHistory() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='string' init-expr='test value' history='true'/>"
- + " <variable name='real' type='string' init-expr='real value' history='true'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='string' init-expr='test value' history='true'/>"
+ + " <variable name='real' type='string' init-expr='real value' history='true'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -66,7 +66,7 @@
}
public void testCreateVariableWithHistory() {
- deployJpdlXmlString("<process name='var'>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -92,7 +92,7 @@
}
public void testCreateVariablesWithHistory() {
- deployJpdlXmlString("<process name='var'>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -121,9 +121,9 @@
}
public void testDeclaredVariablesMixed() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='string' init-expr='test value' history='true'/>"
- + " <variable name='real' type='string' init-expr='real value' history='false'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='string' init-expr='test value' history='true'/>"
+ + " <variable name='real' type='string' init-expr='real value' history='false'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -148,8 +148,8 @@
}
public void testDeclaredIntegerVariableWithHistory() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -175,7 +175,7 @@
}
public void testDeclaredSerializableVariableWithHistory() {
- deployJpdlXmlString("<process name='var'>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <variable name='test' type='serializable' history='true'>"
+ " <object class='java.util.Date'>"
+ " <constructor><arg><long value='1276086573250'/></arg></constructor>"
@@ -204,73 +204,75 @@
assertEquals(variableValue.toString(), historyValue);
}
public void testDeclaredVariableWithHistoryWrongProcessInstanceId() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='string' init-expr='history' history='true'/>"
- + " <start name='a'>"
- + " <transition to='b' />"
- + " </start>"
- + " <state name='b'/>"
- + "</process>");
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='string' init-expr='history' history='true'/>"
+ + " <start name='a'>"
+ + " <transition to='b' />"
+ + " </start>"
+ + " <state name='b'/>"
+ + "</process>");
- executionService.startProcessInstanceByKey("var", "one");
+ executionService.startProcessInstanceByKey("var", "one");
- Set<String> variableNames = executionService.getVariableNames("var.one");
- assertEquals(1, variableNames.size());
- assertEquals("test", variableNames.iterator().next());
+ Set<String> variableNames = executionService.getVariableNames("var.one");
+ assertEquals(1, variableNames.size());
+ assertEquals("test", variableNames.iterator().next());
- String executionValue = (String) executionService.getVariable("var.one", "test");
- assertEquals("history", executionValue);
+ String executionValue = (String) executionService.getVariable("var.one", "test");
+ assertEquals("history", executionValue);
- Set<String> historyVariables = historyService.getVariableNames("var.one");
- assertEquals(1, historyVariables.size());
- assertEquals("test", historyVariables.iterator().next());
+ Set<String> historyVariables = historyService.getVariableNames("var.one");
+ assertEquals(1, historyVariables.size());
+ assertEquals("test", historyVariables.iterator().next());
- String wrongProcessInstanceId = "var.one.1";
- try {
- historyService.getVariable(wrongProcessInstanceId, "test");
- fail("should fail since it uses wrong process instance id");
- } catch (JbpmException e) {
- String message = e.getMessage();
- assertTrue(message, message.contains(wrongProcessInstanceId));
- }
+ String wrongProcessInstanceId = "var.one.1";
+ try {
+ historyService.getVariable(wrongProcessInstanceId, "test");
+ fail("should fail since it uses wrong process instance id");
}
-
+ catch (JbpmException e) {
+ String message = e.getMessage();
+ assertTrue(message, message.contains(wrongProcessInstanceId));
+ }
+ }
+
public void testDeclaredVariableWithHistoryWrongProcess() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='string' init-expr='history' history='true'/>"
- + " <start name='a'>"
- + " <transition to='b' />"
- + " </start>"
- + " <state name='b'/>"
- + "</process>");
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='string' init-expr='history' history='true'/>"
+ + " <start name='a'>"
+ + " <transition to='b' />"
+ + " </start>"
+ + " <state name='b'/>"
+ + "</process>");
- executionService.startProcessInstanceByKey("var", "one");
+ executionService.startProcessInstanceByKey("var", "one");
- Set<String> variableNames = executionService.getVariableNames("var.one");
- assertEquals(1, variableNames.size());
- assertEquals("test", variableNames.iterator().next());
+ Set<String> variableNames = executionService.getVariableNames("var.one");
+ assertEquals(1, variableNames.size());
+ assertEquals("test", variableNames.iterator().next());
- String executionValue = (String) executionService.getVariable("var.one", "test");
- assertEquals("history", executionValue);
- try {
-
- historyService.getVariables(null, null);
- fail("should fail since process instance id is null");
- } catch (Exception e) {
- assertEquals("processInstanceId is null", e.getMessage());
- }
- try {
-
- historyService.getVariables("var.one", null);
- fail("should fail since variable names set is null");
- } catch (Exception e) {
- assertEquals("variableNames is null", e.getMessage());
- }
+ String executionValue = (String) executionService.getVariable("var.one", "test");
+ assertEquals("history", executionValue);
+ try {
+ historyService.getVariables(null, null);
+ fail("should fail since process instance id is null");
}
+ catch (JbpmException e) {
+ assertEquals("processInstanceId is null", e.getMessage());
+ }
+ try {
+ historyService.getVariables("var.one", null);
+ fail("should fail since variable names set is null");
+ }
+ catch (JbpmException e) {
+ assertEquals("variableNames is null", e.getMessage());
+ }
+ }
+
public void testDeclaredVariableWithHistoryAndUpdateBySignal() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -289,7 +291,7 @@
Integer executionValue = (Integer) executionService.getVariable("var.one", "test");
assertEquals(35, executionValue.intValue());
-
+
// signal to next state
executionService.signalExecutionById(pi.getId(), Collections.singletonMap("test", 55));
@@ -299,11 +301,11 @@
String historyValue = (String) historyService.getVariable("var.one", "test");
assertEquals("55", historyValue);
- }
-
+ }
+
public void testDeclaredVariableWithHistoryAndUpdateByExecService() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
@@ -322,9 +324,9 @@
Integer executionValue = (Integer) executionService.getVariable("var.one", "test");
assertEquals(35, executionValue.intValue());
-
+
executionService.setVariable(pi.getId(), "test", 55);
-
+
// signal to next state
executionService.signalExecutionById(pi.getId());
@@ -335,11 +337,13 @@
String historyValue = (String) historyService.getVariable("var.one", "test");
assertEquals("55", historyValue);
}
-
+
public void testDeclaredSerializableVariableWithHistoryAndUpdateByExecService() {
- deployJpdlXmlString("<process name='var'>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ " <variable name='test' type='serializable' history='true'>"
- + " <object class='"+SetVariableListener.class.getName()+"'>"
+ + " <object class='"
+ + SetVariableListener.class.getName()
+ + "'>"
+ " </object>"
+ " </variable>"
+ " <start name='a'>"
@@ -363,7 +367,7 @@
SetVariableListener newInstance = new SetVariableListener();
newInstance.setSimpleValue("value test");
executionService.setVariable(pi.getId(), "test", newInstance);
-
+
// signal to next state
executionService.signalExecutionById(pi.getId());
@@ -374,17 +378,19 @@
String historyValue = (String) historyService.getVariable("var.one", "test");
assertEquals("value test", historyValue);
}
-
+
public void testDeclaredVariableWithHistoryAndUpdateByEvent() {
- deployJpdlXmlString("<process name='var'>"
- + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ deployJpdlXmlString("<process name='var' xmlns='http://jbpm.org/4.4/jpdl'>"
+ + " <variable name='test' type='integer' init-expr='#{testV}' history='true'/>"
+ " <start name='a'>"
+ " <transition to='b' />"
+ " </start>"
+ " <state name='b'>"
+ " <on event='end'>"
- + " <event-listener class='"+SetVariableListener.class.getName()+"' />"
- + " </on>"
+ + " <event-listener class='"
+ + SetVariableListener.class.getName()
+ + "' />"
+ + " </on>"
+ " <transition to='c' />"
+ " </state>"
+ " <state name='c'/>"
@@ -399,7 +405,7 @@
Integer executionValue = (Integer) executionService.getVariable("var.one", "test");
assertEquals(35, executionValue.intValue());
-
+
// signal to next state
executionService.signalExecutionById(pi.getId());
@@ -409,23 +415,23 @@
String historyValue = (String) historyService.getVariable("var.one", "test");
assertEquals("55", historyValue);
- }
-
+ }
+
public static class SetVariableListener implements EventListener {
+
+ private String simpleValue = "test value";
private static final long serialVersionUID = 1L;
- private String simpleValue = "test value";
+
public void notify(EventListenerExecution execution) {
execution.setVariable("test", 55);
}
-
+
public void setSimpleValue(String value) {
this.simpleValue = value;
}
-
+
public String toString() {
return this.simpleValue;
}
}
-
-
}
More information about the jbpm-commits
mailing list