JBoss JBPM SVN: r5202 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: test/java/org/jbpm/graph/def and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-02 20:08:25 -0400 (Thu, 02 Jul 2009)
New Revision: 5202
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java
Log:
Prevent NPE wrapped in DelegationException thrown when delegation class cannot be located; throw ClassNotFoundException wrapped in DelegationException instead
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2009-07-02 23:37:21 UTC (rev 5201)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2009-07-03 00:08:25 UTC (rev 5202)
@@ -37,6 +37,7 @@
import org.dom4j.io.XMLWriter;
import org.jbpm.JbpmException;
+import org.jbpm.graph.def.DelegationException;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.jpdl.xml.JpdlXmlReader;
import org.jbpm.jpdl.xml.Parsable;
@@ -156,17 +157,15 @@
}
}
- // load the class that needs to be instantiated
- Class delegationClass = null;
try {
- delegationClass = Class.forName(className, false, classLoader);
+ // load the class that needs to be instantiated
+ Class delegationClass = Class.forName(className, false, classLoader);
+ // instantiate the object
+ return instantiator.instantiate(delegationClass, configuration);
}
catch (ClassNotFoundException e) {
- log.error("couldn't load delegation class '" + className + "'", e);
+ throw new DelegationException("could not load delegation class '" + className + "'", e);
}
-
- // instantiate the object
- return instantiator.instantiate(delegationClass, configuration);
}
// equals ///////////////////////////////////////////////////////////////////
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java 2009-07-02 23:37:21 UTC (rev 5201)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java 2009-07-03 00:08:25 UTC (rev 5202)
@@ -49,7 +49,6 @@
public class FieldInstantiator implements Instantiator {
public Object instantiate(Class clazz, String configuration) {
-
// create a new instance with the default constructor
Object newInstance = newInstance(clazz);
@@ -114,15 +113,15 @@
}
protected Object newInstance(Class clazz) {
- Object newInstance = null;
try {
- newInstance = clazz.newInstance();
+ return clazz.newInstance();
}
- catch (Exception e) {
- log.error("couldn't instantiate type '" + clazz.getName() + "' with the default constructor");
- throw new JbpmException(e);
+ catch (InstantiationException e) {
+ throw new JbpmException("could not instantiate " + clazz, e);
}
- return newInstance;
+ catch (IllegalAccessException e) {
+ throw new JbpmException("could not access " + clazz, e);
+ }
}
public static Object getValue(Class type, Element propertyElement) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java 2009-07-02 23:37:21 UTC (rev 5201)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/def/ExceptionHandlerTest.java 2009-07-03 00:08:25 UTC (rev 5202)
@@ -26,122 +26,114 @@
import org.jbpm.graph.exe.ProcessInstance;
/**
- *
* @author bernd.ruecker(a)camunda.com
*/
public class ExceptionHandlerTest extends AbstractJbpmTestCase {
- public static class NoExceptionAction implements ActionHandler
- {
- public void execute(ExecutionContext executionContext) throws Exception
- {
+ public static class NoExceptionAction implements ActionHandler {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception {
}
}
- public static class ThrowExceptionAction implements ActionHandler
- {
- public void execute(ExecutionContext executionContext) throws Exception
- {
+ public static class ThrowExceptionAction implements ActionHandler {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception {
throw new Exception("exception in action handler");
}
}
- public static class ThrowInnerExceptionAction implements ActionHandler
- {
- public void execute(ExecutionContext executionContext) throws Exception
- {
+ public static class ThrowInnerExceptionAction implements ActionHandler {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception {
throw new Exception("exception inside of exception handler");
}
}
-
- public void testExceptionHandlerThrowingExcption()
- {
-
- String xml =
- "<?xml version='1.0' encoding='UTF-8'?>"
- +"<process-definition name='TestException'>"
- +" <start-state name='start'>"
- +" <transition name='to_state' to='first'>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
- +" </transition>"
- +" </start-state> "
- +" <state name='first'>"
- +" <transition to='end' />"
- +" </state> "
- +" <end-state name='end' />"
- +" <exception-handler>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowInnerExceptionAction' />"
- +" </exception-handler>"
- +"</process-definition>";
-
+
+ public void testExceptionHandlerThrowingException() {
+ String xml = "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<process-definition name='TestException'>" +
+ " <start-state name='start'>" +
+ " <transition to='end'>" +
+ " <action class='" +
+ ThrowExceptionAction.class.getName() +
+ "' />" +
+ " </transition>" +
+ " </start-state> " +
+ " <end-state name='end' />" +
+ " <exception-handler>" +
+ " <action class='" +
+ ThrowInnerExceptionAction.class.getName() +
+ "' />" +
+ " </exception-handler>" +
+ "</process-definition>";
+
ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
ProcessInstance pi = def.createProcessInstance();
- try
- {
- pi.getRootToken().signal();
+ try {
+ pi.signal();
}
- catch (DelegationException ex)
- {
+ catch (DelegationException ex) {
// check that exception is thrown to the client nested in a DelegationException
assertEquals("exception inside of exception handler", ex.getCause().getMessage());
}
}
-
+
public void testMissingExceptionHandlerClass() {
- String xml =
- "<?xml version='1.0' encoding='UTF-8'?>"
- +"<process-definition name='TestException'>"
- +" <start-state name='start'>"
- +" <transition name='to_state' to='first'>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
- +" </transition>"
- +" </start-state> "
- +" <state name='first'>"
- +" <transition to='end' />"
- +" </state> "
- +" <end-state name='end' />"
- +" <exception-handler>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$DOESNTEXIST' />"
- +" </exception-handler>"
- +"</process-definition>";
-
- ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
+ String xml = "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<process-definition name='TestException'>" +
+ " <start-state name='start'>" +
+ " <transition to='end'>" +
+ " <action class='" +
+ ThrowExceptionAction.class.getName() +
+ "' />" +
+ " </transition>" +
+ " </start-state> " +
+ " <end-state name='end' />" +
+ " <exception-handler>" +
+ " <action class='org.jbpm.graph.def.ExceptionHandlerTest$DOESNOTEXIST' />" +
+ " </exception-handler>" +
+ "</process-definition>";
+
+ ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
ProcessInstance pi = def.createProcessInstance();
-
- try
- {
+
+ try {
pi.getRootToken().signal();
}
- catch (DelegationException ex)
- {
+ catch (DelegationException ex) {
// check that exception is thrown to the client nested in a DelegationException
- assertEquals(NullPointerException.class, ex.getCause().getClass());
+ assertSame(ClassNotFoundException.class, ex.getCause().getClass());
}
}
public void testNoException() {
- String xml =
- "<?xml version='1.0' encoding='UTF-8'?>"
- +"<process-definition name='TestException'>"
- +" <start-state name='start'>"
- +" <transition name='to_state' to='first'>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$ThrowExceptionAction' />"
- +" </transition>"
- +" </start-state> "
- +" <state name='first'>"
- +" <transition to='end' />"
- +" </state> "
- +" <end-state name='end' />"
- +" <exception-handler>"
- +" <action class='org.jbpm.graph.def.ExceptionHandlerTest$NoExceptionAction' />"
- +" </exception-handler>"
- +"</process-definition>";
+ String xml = "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<process-definition name='TestException'>" +
+ " <start-state name='start'>" +
+ " <transition to='end'>" +
+ " <action class='" +
+ ThrowExceptionAction.class.getName() +
+ "' />" +
+ " </transition>" +
+ " </start-state> " +
+ " <end-state name='end' />" +
+ " <exception-handler>" +
+ " <action class='" +
+ NoExceptionAction.class.getName() +
+ "' />" +
+ " </exception-handler>" +
+ "</process-definition>";
ProcessDefinition def = ProcessDefinition.parseXmlString(xml);
ProcessInstance pi = def.createProcessInstance();
- pi.getRootToken().signal();
-
- // exception is handled correctly
- }
+ pi.signal();
+
+ // exception is handled correctly
+ assertTrue("expected " + pi + " to have ended", pi.hasEnded());
+ }
}
15 years, 4 months
JBoss JBPM SVN: r5201 - in jbpm4/trunk/modules/devguide/src/main/docbook/en: modules and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-02 19:37:21 -0400 (Thu, 02 Jul 2009)
New Revision: 5201
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml
Removed:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
Log:
JBPM-2362: added documentation for Spring integration to dev guide
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-02 22:47:21 UTC (rev 5200)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-02 23:37:21 UTC (rev 5201)
@@ -14,7 +14,8 @@
<!ENTITY ch11-SoftwareLogging SYSTEM "modules/ch11-SoftwareLogging.xml">
<!ENTITY ch12-History SYSTEM "modules/ch12-History.xml">
<!ENTITY ch13-JBossIntegration SYSTEM "modules/ch13-JBossIntegration.xml">
- <!ENTITY ch14-Jpdl3Migration SYSTEM "modules/ch14-Jpdl3Migration.xml">
+ <!ENTITY ch14-SpringIntegration SYSTEM "modules/ch14-SpringIntegration.xml">
+ <!ENTITY ch15-Jpdl3Migration SYSTEM "modules/ch15-Jpdl3Migration.xml">
]>
<book lang="en">
@@ -38,6 +39,7 @@
&ch11-SoftwareLogging;
&ch12-History;
&ch13-JBossIntegration;
- &ch14-Jpdl3Migration;
+ &ch14-SpringIntegration;
+ &ch15-Jpdl3Migration;
</book>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml 2009-07-02 22:47:21 UTC (rev 5200)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml 2009-07-02 23:37:21 UTC (rev 5201)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="jpdl3Migration">
- <title>JPDL3 migration</title>
-
- <para>
- In many cases, a lot of work has been put in the design of JPDL3 process
- definitions. To avoid a complete manual translation of these processes to the
- JPDL4 format, the jBPM distribution contains a subdirectory called
- <emphasis role="bold">migration</emphasis>, which contains a command-line
- tool for converting JPDL3 process definition files to JPDL process XML files.
- </para>
-
- <para>
- The tool itself uses only dom4j to do the translation between
- the two formats and should be easy extensible (the source code is also in
- the same directory). The design of the tool is deliberately kept very simple
- (ie most of the logic can be found in the <emphasis role="bold">Jpdl3Converter</emphasis> class).
- Note that this tool is experimental and tested only a small set of JPDL3
- process files.
- </para>
-
- <section id="migration_overview">
- <title>Overview</title>
- <para>
- The jPDL Conversion tool takes a jpdl3 process file as input, and
- converts it to a jpdl4 process file.
- </para>
- <para>
- Syntax:
- <programlisting>java org.jbpm.jpdl.internal.convert.JpdlConverterTool -v -o <outputfile> <processfile></programlisting>
- </para>
- </section>
-
- <section id="migration_arguments">
- <title>Arguments</title>
- <itemizedlist>
- <listitem>
- <emphasis role="bold">-v (verbose):</emphasis> The tool will print the detail
- messages while converting the process file. When this argument is used,
- it will also print the error stacktrace if exceptions are thrown.
- </listitem>
- <listitem>
- <emphasis role="bold">-o (output)</emphasis> Specifies the output file name.
- By default, the tool will generate a file name ending in 'converted.jpdl.xml'
- using as a base file name the name derived from the input process file.
- The output-filename can be an absolute file name path or a relative file name path.
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="migration_examples">
- <title>Usage examples</title>
- <programlisting>
- java -jar jpdl-migration-XX.jar simple.jpdl.xml
- java -jar jpdl-migration-XX.jar -v simple.jpdl.xml
- java -jar jpdl-migration-XX.jar -o /home/scott/simple.converted.xml simple.jpdl.xml
- </programlisting>
- </section>
-
- <section id="migration_integration">
- <title>Advanced</title>
- <para>
- The conversion tool can easily be integrated with regular Java code
- (or with Maven or Ant). The following code example shows how to call the
- internal api to convert the process file:
- <programlisting>
- URL url = new URL("simple.jpdl");
- Jpdl3ConverterReader jpdlConverter = new Jpdl3ConverterReader(url);
- Document jpdl4Doc = jpdlConverter.readAndConvert();
-
- for (Problem problem : jpdlConverter.problems) {
- //do something to handle the problem
- }
-
- Writer fileWriter = new FileWriter(outputFile);
- OutputFormat format = OutputFormat.createPrettyPrint();
- XMLWriter writer = new XMLWriter( fileWriter, format );
- writer.write(jpdl4Doc);
- writer.close();
- </programlisting>
- </para>
- </section>
-
-</chapter>
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml 2009-07-02 23:37:21 UTC (rev 5201)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="springIntegration">
+ <title>Spring Integration</title>
+
+ <para>
+ The embeddability of the jBPM engine in different environments has always
+ been one of its core strengths, but often extra libraries to do the integration
+ were required. Since jBPM4 however, it is now possible to natively
+ integrate jBPM with <ulink url="http://www.springsource.org/about">Spring</ulink>.
+ This section will explain which steps are required for such an integration.
+ </para>
+
+ <para>
+ The Spring integration has started out as a community effort by
+ <ulink url="http://www.inze.be/andries/">Andries Inzé</ulink>.
+ Do note that Spring integration currently is in 'incubation', before
+ it is moved to the user guide.
+ </para>
+
+ <section id="spring_overview">
+ <title>Overview</title>
+ <para>
+ The default jBPM behaviour is to open a transaction for each operation
+ that is called on the service API. In a typical Spring setup, applications are
+ accessed from the web tier and enter a transactional boundary by invoking
+ operations on service beans. These service beans will then access the jBPM services.
+ All these operations run typically in a single transaction (ie one transaction
+ per request from the browser), which invalidates the standard jBPM
+ transaction handling approach. Instead of starting and committing
+ a transaction for every service operation, the existing transaction
+ should be used (or a new one started if none exists).
+ </para>
+ </section>
+
+ <section id="spring_configuration">
+ <title>Configuration</title>
+ <para>
+ Replace the standard-transaction-interceptor with the
+ spring-transaction-interceptor. The hibernate session needs the attribute current=”true”.
+ This forces jBPM to search for the current session,
+ which will be provided by Spring.
+ <programlisting>
+ <process-engine-context>
+ <command-service>
+ <emphasis role="bold"><spring-transaction-interceptor current="true" /></emphasis>
+ ...
+ </command-service>
+ ...
+ </process-engine-context>
+ <transaction-context>
+ ...
+ <emphasis role="bold"><hibernate-session current="true"/></emphasis>
+ </transaction-context>
+ </programlisting>
+ </para>
+
+ <para>
+ The Spring integration provides a special context, which is added to
+ the set of context where the jBPM engine will look for beans.
+ Using this SpringContext, it is now possible to retrieve beans from the
+ Spring Application Context. For the Spring context to be known, a
+ SpringConfiguration must be created. This class extends the JbpmConfiguration
+ but will add itself as a context. The single constructor take the location of the jBPM configuration.
+
+ <programlisting>
+ <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
+ <constructor-arg value="be/inze/spring/demo/jbpm.cfg.xml" />
+ </bean>
+ </programlisting>
+ </para>
+
+ <para>
+ The jBPM services can also be defined in the Spring applicationContext, as following:
+ <programlisting>
+<bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
+<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
+<bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
+ </programlisting>
+ </para>
+
+ <para>
+ For accessing Spring beans from withing a process, we need to register
+ the Spring applicationContext with the scripting-manager.
+
+ <programlisting>
+ <script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine, <emphasis role="bold">spring</emphasis>"
+ write-context="">
+ <script-language name="juel"
+ factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+ </programlisting>
+ </para>
+ </section>
+
+ <section id="spring_usage">
+ <title>Usage</title>
+
+ <para>
+ The previous section already showed how the jBPM services can be made
+ accessible for other Spring services. The other use case is calling
+ Spring beans from within a process. This can be done by using
+ an expression which resolves to the name of a Spring bean.
+
+ <programlisting>
+<java name="echo" expr="#{echoService}" method="sayHello" >
+ <transition name="to accept" to="join1"/>
+ </java>
+ </programlisting>
+
+ The scripting engine will look into all contexts from the bean named echoService.
+ If you configured the ScriptManager as above, Spring will be the last context to search for.
+ A good practice is to use unique names for the beans.
+ </para>
+
+ </section>
+
+ <section id="spring_testing">
+ <title>Testing</title>
+
+ <para>
+ Use the <emphasis role="bold">AbstractTransactionalJbpmTestCase</emphasis>
+ to test a process in isolation (ie without impact on the database).
+ This class extends from
+ the <emphasis role="italic">AbstractTransactionalDataSourceSpringContextTests</emphasis>
+ class, which means that testing a process comes down to exactly the same
+ approach as testing a DAO.
+ </para>
+
+ </section>
+
+
+
+</chapter>
Copied: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml (from rev 5200, jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml)
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml 2009-07-02 23:37:21 UTC (rev 5201)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="jpdl3Migration">
+ <title>JPDL3 migration</title>
+
+ <para>
+ In many cases, a lot of work has been put in the design of JPDL3 process
+ definitions. To avoid a complete manual translation of these processes to the
+ JPDL4 format, the jBPM distribution contains a subdirectory called
+ <emphasis role="bold">migration</emphasis>, which contains a command-line
+ tool for converting JPDL3 process definition files to JPDL process XML files.
+ </para>
+
+ <para>
+ The tool itself uses only dom4j to do the translation between
+ the two formats and should be easy extensible (the source code is also in
+ the same directory). The design of the tool is deliberately kept very simple
+ (ie most of the logic can be found in the <emphasis role="bold">Jpdl3Converter</emphasis> class).
+ Note that this tool is experimental and tested only a small set of JPDL3
+ process files.
+ </para>
+
+ <section id="migration_overview">
+ <title>Overview</title>
+ <para>
+ The jPDL Conversion tool takes a jpdl3 process file as input, and
+ converts it to a jpdl4 process file.
+ </para>
+ <para>
+ Syntax:
+ <programlisting>java org.jbpm.jpdl.internal.convert.JpdlConverterTool -v -o <outputfile> <processfile></programlisting>
+ </para>
+ </section>
+
+ <section id="migration_arguments">
+ <title>Arguments</title>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">-v (verbose):</emphasis> The tool will print the detail
+ messages while converting the process file. When this argument is used,
+ it will also print the error stacktrace if exceptions are thrown.
+ </listitem>
+ <listitem>
+ <emphasis role="bold">-o (output)</emphasis> Specifies the output file name.
+ By default, the tool will generate a file name ending in 'converted.jpdl.xml'
+ using as a base file name the name derived from the input process file.
+ The output-filename can be an absolute file name path or a relative file name path.
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="migration_examples">
+ <title>Usage examples</title>
+ <programlisting>
+ java -jar jpdl-migration-XX.jar simple.jpdl.xml
+ java -jar jpdl-migration-XX.jar -v simple.jpdl.xml
+ java -jar jpdl-migration-XX.jar -o /home/scott/simple.converted.xml simple.jpdl.xml
+ </programlisting>
+ </section>
+
+ <section id="migration_integration">
+ <title>Advanced</title>
+ <para>
+ The conversion tool can easily be integrated with regular Java code
+ (or with Maven or Ant). The following code example shows how to call the
+ internal api to convert the process file:
+ <programlisting>
+ URL url = new URL("simple.jpdl");
+ Jpdl3ConverterReader jpdlConverter = new Jpdl3ConverterReader(url);
+ Document jpdl4Doc = jpdlConverter.readAndConvert();
+
+ for (Problem problem : jpdlConverter.problems) {
+ //do something to handle the problem
+ }
+
+ Writer fileWriter = new FileWriter(outputFile);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ XMLWriter writer = new XMLWriter( fileWriter, format );
+ writer.write(jpdl4Doc);
+ writer.close();
+ </programlisting>
+ </para>
+ </section>
+
+</chapter>
15 years, 4 months
JBoss JBPM SVN: r5200 - in jbpm4/trunk: modules/devguide/src/main/docbook/en and 2 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-02 18:47:21 -0400 (Thu, 02 Jul 2009)
New Revision: 5200
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
jbpm4/trunk/pom.xml
Log:
JBPM2370: integrate conversion tool in distro build + document usage in dev guide
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-02 22:36:06 UTC (rev 5199)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-02 22:47:21 UTC (rev 5200)
@@ -14,6 +14,7 @@
<!ENTITY ch11-SoftwareLogging SYSTEM "modules/ch11-SoftwareLogging.xml">
<!ENTITY ch12-History SYSTEM "modules/ch12-History.xml">
<!ENTITY ch13-JBossIntegration SYSTEM "modules/ch13-JBossIntegration.xml">
+ <!ENTITY ch14-Jpdl3Migration SYSTEM "modules/ch14-Jpdl3Migration.xml">
]>
<book lang="en">
@@ -37,5 +38,6 @@
&ch11-SoftwareLogging;
&ch12-History;
&ch13-JBossIntegration;
+ &ch14-Jpdl3Migration;
</book>
\ No newline at end of file
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-Jpdl3Migration.xml 2009-07-02 22:47:21 UTC (rev 5200)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="jpdl3Migration">
+ <title>JPDL3 migration</title>
+
+ <para>
+ In many cases, a lot of work has been put in the design of JPDL3 process
+ definitions. To avoid a complete manual translation of these processes to the
+ JPDL4 format, the jBPM distribution contains a subdirectory called
+ <emphasis role="bold">migration</emphasis>, which contains a command-line
+ tool for converting JPDL3 process definition files to JPDL process XML files.
+ </para>
+
+ <para>
+ The tool itself uses only dom4j to do the translation between
+ the two formats and should be easy extensible (the source code is also in
+ the same directory). The design of the tool is deliberately kept very simple
+ (ie most of the logic can be found in the <emphasis role="bold">Jpdl3Converter</emphasis> class).
+ Note that this tool is experimental and tested only a small set of JPDL3
+ process files.
+ </para>
+
+ <section id="migration_overview">
+ <title>Overview</title>
+ <para>
+ The jPDL Conversion tool takes a jpdl3 process file as input, and
+ converts it to a jpdl4 process file.
+ </para>
+ <para>
+ Syntax:
+ <programlisting>java org.jbpm.jpdl.internal.convert.JpdlConverterTool -v -o <outputfile> <processfile></programlisting>
+ </para>
+ </section>
+
+ <section id="migration_arguments">
+ <title>Arguments</title>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">-v (verbose):</emphasis> The tool will print the detail
+ messages while converting the process file. When this argument is used,
+ it will also print the error stacktrace if exceptions are thrown.
+ </listitem>
+ <listitem>
+ <emphasis role="bold">-o (output)</emphasis> Specifies the output file name.
+ By default, the tool will generate a file name ending in 'converted.jpdl.xml'
+ using as a base file name the name derived from the input process file.
+ The output-filename can be an absolute file name path or a relative file name path.
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="migration_examples">
+ <title>Usage examples</title>
+ <programlisting>
+ java -jar jpdl-migration-XX.jar simple.jpdl.xml
+ java -jar jpdl-migration-XX.jar -v simple.jpdl.xml
+ java -jar jpdl-migration-XX.jar -o /home/scott/simple.converted.xml simple.jpdl.xml
+ </programlisting>
+ </section>
+
+ <section id="migration_integration">
+ <title>Advanced</title>
+ <para>
+ The conversion tool can easily be integrated with regular Java code
+ (or with Maven or Ant). The following code example shows how to call the
+ internal api to convert the process file:
+ <programlisting>
+ URL url = new URL("simple.jpdl");
+ Jpdl3ConverterReader jpdlConverter = new Jpdl3ConverterReader(url);
+ Document jpdl4Doc = jpdlConverter.readAndConvert();
+
+ for (Problem problem : jpdlConverter.problems) {
+ //do something to handle the problem
+ }
+
+ Writer fileWriter = new FileWriter(outputFile);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ XMLWriter writer = new XMLWriter( fileWriter, format );
+ writer.write(jpdl4Doc);
+ writer.close();
+ </programlisting>
+ </para>
+ </section>
+
+</chapter>
Modified: jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
===================================================================
--- jbpm4/trunk/modules/distro/scripts/assembly-distro.xml 2009-07-02 22:36:06 UTC (rev 5199)
+++ jbpm4/trunk/modules/distro/scripts/assembly-distro.xml 2009-07-02 22:47:21 UTC (rev 5200)
@@ -149,5 +149,9 @@
<directory>../examples/src/eclipse</directory>
<outputDirectory>examples</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>../migration/target/migration-distro</directory>
+ <outputDirectory>migration</outputDirectory>
+ </fileSet>
</fileSets>
</assembly>
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-07-02 22:36:06 UTC (rev 5199)
+++ jbpm4/trunk/pom.xml 2009-07-02 22:47:21 UTC (rev 5200)
@@ -39,6 +39,7 @@
<module>modules/examples</module>
<module>modules/test-db</module>
<module>modules/test-pojo</module>
+ <module>modules/migration</module>
</modules>
<!-- Properties -->
15 years, 4 months
JBoss JBPM SVN: r5199 - in jbpm4/trunk/modules/migration: scripts and 28 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-02 18:36:06 -0400 (Thu, 02 Jul 2009)
New Revision: 5199
Added:
jbpm4/trunk/modules/migration/.classpath
jbpm4/trunk/modules/migration/.project
jbpm4/trunk/modules/migration/pom.xml
jbpm4/trunk/modules/migration/scripts/
jbpm4/trunk/modules/migration/scripts/assembly-distro.xml
jbpm4/trunk/modules/migration/src/
jbpm4/trunk/modules/migration/src/main/
jbpm4/trunk/modules/migration/src/main/java/
jbpm4/trunk/modules/migration/src/main/java/org/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConverterContext.java
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/Jpdl3ConverterParser.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/JpdlConverterTool.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/ActionConverterTypes.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/CreateTimerAction.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/IllegalCommandException.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Access.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Decision.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/MailNode.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/NodeConverterTypes.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/VariableAccess.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java
jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/ProblemListener.java
jbpm4/trunk/modules/migration/src/main/resources/
jbpm4/trunk/modules/migration/src/main/resources/action.converter.types.xml
jbpm4/trunk/modules/migration/src/main/resources/log4j.properties
jbpm4/trunk/modules/migration/src/main/resources/node.converter.types.xml
jbpm4/trunk/modules/migration/src/main/resources/org/
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd
jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
jbpm4/trunk/modules/migration/src/main/xsd/
jbpm4/trunk/modules/migration/src/main/xsd/jpdl-4.0.xsd
jbpm4/trunk/modules/migration/src/test/
jbpm4/trunk/modules/migration/src/test/java/
jbpm4/trunk/modules/migration/src/test/java/com/
jbpm4/trunk/modules/migration/src/test/java/com/test/
jbpm4/trunk/modules/migration/src/test/java/com/test/Logger.java
jbpm4/trunk/modules/migration/src/test/java/com/test/MessageActionHandler.java
jbpm4/trunk/modules/migration/src/test/java/com/test/NodeEnterAction.java
jbpm4/trunk/modules/migration/src/test/java/com/test/RulesAssignmentHandler.java
jbpm4/trunk/modules/migration/src/test/java/com/test/TaskCreateAction.java
jbpm4/trunk/modules/migration/src/test/java/org/
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterToolTest.java
jbpm4/trunk/modules/migration/src/test/resources/
jbpm4/trunk/modules/migration/src/test/resources/assignment.xml
jbpm4/trunk/modules/migration/src/test/resources/businesstrip.xml
jbpm4/trunk/modules/migration/src/test/resources/exception-handler.xml
jbpm4/trunk/modules/migration/src/test/resources/invalid.xml
jbpm4/trunk/modules/migration/src/test/resources/log4j.xml
jbpm4/trunk/modules/migration/src/test/resources/process-event.xml
jbpm4/trunk/modules/migration/src/test/resources/process-state.xml
jbpm4/trunk/modules/migration/src/test/resources/script.xml
jbpm4/trunk/modules/migration/src/test/resources/simple.xml
jbpm4/trunk/modules/migration/src/test/resources/superstate-mail.xml
jbpm4/trunk/modules/migration/src/test/resources/test-transition-resolve.xml
jbpm4/trunk/modules/migration/src/test/resources/testDecision.xml
jbpm4/trunk/modules/migration/src/test/resources/timer.xml
Log:
JBPM2370: import work of Jim Ma on conversion tool after documentation/refactoring and integrating with distro build.
Added: jbpm4/trunk/modules/migration/.classpath
===================================================================
--- jbpm4/trunk/modules/migration/.classpath (rev 0)
+++ jbpm4/trunk/modules/migration/.classpath 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/migration/.project
===================================================================
--- jbpm4/trunk/modules/migration/.project (rev 0)
+++ jbpm4/trunk/modules/migration/.project 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>migration</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/trunk/modules/migration/pom.xml
===================================================================
--- jbpm4/trunk/modules/migration/pom.xml (rev 0)
+++ jbpm4/trunk/modules/migration/pom.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ======================================================================
+-->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ======================================================================
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>jBPM 4 - Migration - Tool</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jpdl-migration</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ </exclusions>
+ <version>1.6.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+
+ <!-- JBPM4 dependency only necessary for validating results in test -->
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-pvm</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Profiles -->
+ <profiles>
+ <profile>
+ <id>integration.test</id>
+ <activation>
+ <property>
+ <name>jboss.bind.address</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ <profile>
+ <id>distro</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <finalName>jbpm-migration</finalName>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>lib/</classpathPrefix>
+ <mainClass>org.jbpm.jpdl.internal.convert.JpdlConverterTool</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version>2.2-beta-3</version-->
+ <executions>
+ <execution>
+ <id>distribution-package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>assembly</goal>
+ </goals>
+ <configuration>
+ <finalName>migration-distro</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-distro.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus</id>
+ <name>codehaus</name>
+ <url>http://repository.codehaus.org
+ </url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+</project>
Added: jbpm4/trunk/modules/migration/scripts/assembly-distro.xml
===================================================================
--- jbpm4/trunk/modules/migration/scripts/assembly-distro.xml (rev 0)
+++ jbpm4/trunk/modules/migration/scripts/assembly-distro.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<assembly xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <unpack>false</unpack>
+ <includes>
+ <include>org.jbpm.jbpm4:jpdl-migration</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <unpack>false</unpack>
+ <excludes>
+ <exclude>org.jbpm.jbpm4:jpdl-migration</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}/src/main/java</directory>
+ <outputDirectory>src</outputDirectory>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </fileSet>
+ </fileSets>
+</assembly>
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConverterContext.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConverterContext.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConverterContext.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+/**
+ * Wraps the validated command line arguments
+ * and determines the context of the conversion.
+ *
+ * @author Jim Ma
+ */
+public class ConverterContext {
+
+ public static final String PROCESS_FILE = "processFile";
+ public static final String PROCESS_FILE_URL = "processFileURL";
+ public static final String VERBOSE = "verbose";
+ public static final String OUPUTFILE = "outputFile";
+ private Map<String, Object> paramMap = null;
+
+ public void put(String key, Object value) {
+ if (paramMap == null) {
+ paramMap = new ConcurrentHashMap<String, Object>();
+ }
+ paramMap.put(key, value);
+ }
+
+ public Object get(String key) {
+ if (paramMap == null) {
+ return null;
+ }
+ return paramMap.get(key);
+
+ }
+
+ public void refresh() {
+ paramMap = null;
+ }
+
+}
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3Converter.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,850 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.action.Action;
+import org.jbpm.jpdl.internal.convert.action.ActionConverterTypes;
+import org.jbpm.jpdl.internal.convert.action.CreateTimerAction;
+import org.jbpm.jpdl.internal.convert.exception.ConvertException;
+import org.jbpm.jpdl.internal.convert.node.Node;
+import org.jbpm.jpdl.internal.convert.node.NodeConverterTypes;
+import org.jbpm.jpdl.internal.convert.node.StartState;
+import org.jbpm.jpdl.internal.convert.node.TaskNode;
+import org.jbpm.jpdl.internal.convert.node.VariableAccess;
+import org.jbpm.jpdl.internal.convert.problem.Problem;
+import org.jbpm.jpdl.internal.convert.problem.ProblemListener;
+import org.xml.sax.InputSource;
+
+/**
+ * Trimmed down version JpdlXmlReader (jBPM3 code base),
+ * to have exactly the same parsing as in jBPM3.
+ *
+ * Note that the foremost requirement for this class is readability and
+ * extensibility. People who want to adapt the conversion logic
+ * for their own processes are advised to adapt this class.
+ *
+ * @author Jim Ma
+ * @author jbarrez
+ */
+public class Jpdl3Converter implements ProblemListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private static String JPDL4NS = "http://jbpm.org/4.0/jpdl";
+
+ protected InputSource inputSource;
+
+ protected Document jpdl3Document;
+
+ /* Contains any problems occurred after conversion of the jpdl3 process */
+ protected List<Problem> problems = new ArrayList<Problem>();
+
+ /*
+ * Use the constructor with a custom ProblemListener to have the conversion
+ * problems sent to another problem listener/
+ */
+ protected ProblemListener problemListener;
+
+ //the return converted jpdl4 dom model
+ protected Document jpdl4Document;
+
+ /* Contains the transition destinations which arent resolved yet */
+ protected Collection<Object[]> unresolvedTransitionDestinations;
+
+ /*
+ * Contains the actions which arent resolved yet
+ * (ie the converter hasnt encountered them yet)
+ */
+ protected Collection<Object[]> unresolvedActionReferences;
+
+ /* Contains the nodes of the process */
+ protected Map<String,Element> nodeCollection = new java.util.concurrent.ConcurrentHashMap<String, Element>();
+
+ /* Contains the encountered swimlanes */
+ protected Map<String,Element> swimlanesCollection = new java.util.concurrent.ConcurrentHashMap<String, Element>();
+
+ /* Used for autonumbering anonymous timers */
+ private int timerNumber;
+
+ /**
+ * Constructor using an URL pointing to a jpdl3 process file.
+ */
+ public Jpdl3Converter(URL url) {
+ try {
+ File file = new File(url.toURI());
+ FileReader reader = new FileReader(file);
+ this.inputSource = new InputSource(reader);
+ } catch (Exception e) {
+ //Do nothing , we validated it before
+ }
+ }
+
+ /**
+ * Constructor using an InputSource pointing to a jpdl3 process file.
+ */
+ public Jpdl3Converter(InputSource inputSource) {
+ this.inputSource = inputSource;
+ }
+
+ /**
+ * Constructor using a Reader pointing to a jpdl3 process file.
+ */
+ public Jpdl3Converter(Reader reader) {
+ this(new InputSource(reader));
+ }
+
+ public void close() throws IOException {
+ InputStream byteStream = inputSource.getByteStream();
+ if (byteStream != null) {
+ byteStream.close();
+ }
+ else {
+ Reader charStream = inputSource.getCharacterStream();
+ if (charStream != null) {
+ charStream.close();
+ }
+ }
+ jpdl3Document = null;
+ }
+
+
+
+ public void addProblem(Problem problem) {
+ problems.add(problem);
+ if (problemListener != null) {
+ problemListener.addProblem(problem);
+ }
+ }
+
+ public void addError(String description) {
+ log.error("invalid process xml: " + description);
+ addProblem(new Problem(Problem.LEVEL_ERROR, description));
+ }
+
+ public void addError(String description, Throwable exception) {
+ log.error("invalid process xml: " + description, exception);
+ addProblem(new Problem(Problem.LEVEL_ERROR, description, exception));
+ }
+
+ public void addWarning(String description) {
+ log.warn("process xml warning: " + description);
+ addProblem(new Problem(Problem.LEVEL_WARNING, description));
+ }
+
+ /**
+ * Call this method to convert the jpdl3 process.
+ * The return value will be a converted jpdl4 XML model.
+ */
+ public Document readAndConvert() {
+
+ // create a new definition
+ jpdl4Document = DocumentHelper.createDocument();
+
+ // initialize lists
+ problems = new ArrayList<Problem>();
+ unresolvedTransitionDestinations = new ArrayList<Object[]>();
+ unresolvedActionReferences = new ArrayList<Object[]>();
+
+ try {
+
+ // parse the document into a XML dom tree
+ jpdl3Document = Jpdl3ConverterParser.parse(inputSource, this);
+ jpdl4Document.setXMLEncoding(jpdl3Document.getXMLEncoding());
+
+ // Convert the root element
+ Element jpdl3Root = jpdl3Document.getRootElement();
+ Element jpdl4Root = parseProcessDefinitionAttributes(jpdl3Root);
+
+ // convert process description as comment
+ String description = jpdl3Root.elementTextTrim("description");
+ if (description != null) {
+ jpdl4Root.addComment(description);
+ }
+
+ // first pass
+ convertSwimlanes(jpdl3Root, jpdl4Root);
+ convertActions(jpdl3Root, null, null); // Todo: refactor
+ convertNodes(jpdl3Root, jpdl4Root);
+ convertEvents(jpdl3Root, jpdl4Root);
+ convertExceptionHandlers(jpdl3Root, jpdl4Root);
+ convertTasks(jpdl3Root, jpdl4Root);
+
+ // second pass processing: process any unresolved elements
+ resolveTransitionDestinations();
+ //resolveActionReferences(); // not yet implemented
+ verifySwimlaneAssignments();
+
+ }
+ catch (Exception e) {
+ log.error("couldn't parse process definition", e);
+ addProblem(new Problem(Problem.LEVEL_ERROR, "couldn't parse process definition", e));
+ }
+
+ // After conversion: check if there were any conversion problems
+
+ if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR)) {
+ throw new ConvertException(problems);
+ }
+
+ if (problems != null) {
+ for (Problem problem : problems) {
+ log.warn("process parse warning: " + problem.getDescription());
+ }
+ }
+
+ return jpdl4Document;
+ }
+
+ protected Element parseProcessDefinitionAttributes(Element root)
+ {
+ Element element = jpdl4Document.addElement("process", JPDL4NS);
+ element.addAttribute("name", root.attributeValue("name"));
+ return element;
+ }
+
+ protected void convertSwimlanes(Element jpdl3Element, Element jpdl4Element) {
+
+ Iterator<?> iter = jpdl3Element.elementIterator("swimlane");
+
+ while (iter.hasNext()) {
+
+ Element swimlaneElement = (Element)iter.next();
+ String swimlaneName = swimlaneElement.attributeValue("name");
+
+ if (swimlaneName == null) {
+ addWarning("there's a swimlane without a name");
+ }
+ else {
+
+ Element swimlane4 = jpdl4Element.addElement("swimlane");
+ swimlane4.addAttribute("name", swimlaneName);
+ Element assignmentElement = swimlaneElement.element("assignment");
+ swimlanesCollection.put(swimlaneName, swimlane4);
+ if (assignmentElement != null) {
+
+ if ((assignmentElement.attribute("actor-id") != null)) {
+ swimlane4.addAttribute("assignee", assignmentElement.attributeValue("actor-id"));
+ }
+ if (assignmentElement.attribute("pooled-actors") != null) {
+ swimlane4.addAttribute("candidate-users" ,assignmentElement.attributeValue("pooled-actors"));
+ }
+ else {
+ //readAssignmentDelegation(assignmentElement, swimlane4);
+ //swimlane.setAssignmentDelegation(assignmentDelegation);
+ }
+ }
+ }
+ }
+ }
+
+ public void convertActions(Element jpdl3Element, Element jpdl4Element, String eventType) {
+
+ Iterator< ? > nodeElementIter = jpdl3Element.elementIterator();
+
+ while (nodeElementIter.hasNext()) {
+ Element actionElement = (Element) nodeElementIter.next();
+ String actionName = actionElement.getName();
+
+ if ("cancel-timer".equalsIgnoreCase(actionName) || "mail".equalsIgnoreCase(actionName)) {
+ this.addWarning("Unsupported " + actionName + " conversion on Element : " + actionElement.asXML());
+ }
+
+ if (ActionConverterTypes.hasActionName(actionName)) {
+ createAction(actionElement, jpdl4Element);
+ }
+ }
+ }
+
+ public void convertNodes(Element jpdl3Element, Element jpdl4Element) {
+
+ Iterator<?> nodeElementIter = jpdl3Element.elementIterator();
+
+ while (nodeElementIter.hasNext()) {
+
+ Element nodeElement = (Element)nodeElementIter.next();
+ String nodeName = nodeElement.getName();
+
+ //This will affect the transition, so add error and throw exception
+ if ("super-state".equalsIgnoreCase(nodeName) || "mail-node".equalsIgnoreCase(nodeName)) {
+ this.addError("Unsupported " + nodeName + " conversion : <" + nodeName
+ + " name=\"" + jpdl3Element.attributeValue("name") + "\"");
+ }
+
+ Class<?> nodeType = NodeConverterTypes.getNodeType(nodeName);
+ if (nodeType != null) {
+
+ Node node = null;
+ try {
+ node = (Node)nodeType.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("couldn't instantiate node '" + nodeName + "', of type '" + nodeType.getName() + "'", e);
+ continue;
+ }
+
+ //Implement it
+ List starts = jpdl4Element.elements("start-state");
+
+ // check for duplicate start-states
+ if ((node instanceof StartState) && !starts.isEmpty()) {
+ addError("max one start-state allowed in a process");
+ } else if (node instanceof TaskNode) {
+ convertTasks(nodeElement, jpdl4Element);
+ } else {
+
+ // read the common node parts of the element
+ node.setNodeElement(nodeElement);
+ node.createConvertedElement(jpdl4Element);
+ convertNode(nodeElement,node.getConvertedElement());
+
+ // if the has special configuration to parse, delegate to the specific node
+ node.read(this);
+
+ }
+ }
+ }
+ }
+
+ public void convertEvents(Element jpdl3Element, Element jpdl4Element) {
+
+ Iterator<?> iter = jpdl3Element.elementIterator("event");
+
+ while (iter.hasNext()) {
+
+ Element eventElement = (Element)iter.next();
+ //String eventType = eventElement.attributeValue("type");
+ //TODO:how to handle the event type
+ Element onElement = jpdl4Element.addElement("on");
+ String type = eventElement.attributeValue("type");
+ onElement.addAttribute("event", type);
+ convertActions(eventElement, onElement, type);
+ }
+ }
+
+ public void convertTasks(Element jpdl3Element, Element jpdl4Element) {
+
+ List<?> elements = jpdl3Element.elements("task");
+ Element[] tasks = elements.toArray(new Element[0]);
+
+ if (tasks != null && tasks.length > 0) {
+
+ for (int i = 0 ; i < tasks.length; i++) {
+
+ Element tmpTask = tasks[i];
+ Element task4 = convertTask(tmpTask, jpdl4Element);
+
+ if (i ==0 ) {
+ task4.addAttribute("name", jpdl3Element.attributeValue("name"));
+ } else{
+ task4.addAttribute("name", tmpTask.attributeValue("name"));
+ }
+
+ // In jBPM4, tasks are not nested in a task node
+ // this is solved by adding seperate task to the jpdl4 model
+ // each containing a transition to the next one
+ if (i+1 < tasks.length) {
+ Element newTransistion = task4.addElement("transition");
+ String to = tasks[i+1].attributeValue("name");
+ newTransistion.addAttribute("name", to);
+ 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) {
+ Element transElement = task4.addElement("transition");
+ String transName = trans.attributeValue("name") == null ? trans.attributeValue("to") :trans.attributeValue("name");
+ transElement.addAttribute("name", transName);
+ transElement.addAttribute("to", trans.attributeValue("to"));
+ }
+ }
+ }
+ }
+ }
+
+ public Element convertTask(Element taskElement, Element jpdlElement) {
+
+ Element task4 = jpdlElement.addElement("task");
+ String name = taskElement.attributeValue("name");
+ if (name != null) {
+ task4.attributeValue("name", name);
+ }
+
+ String description = taskElement.elementTextTrim("description");
+ if (description != null) {
+ task4.addComment(description);
+ }
+
+ String condition = taskElement.elementTextTrim("condition");
+ if (condition == null) {
+ condition = taskElement.attributeValue("condition");
+ }
+ if (condition == null) {
+ addWarning("Unsupported condition attribute converstion for task : " + taskElement.asXML());
+ }
+
+ // parse common subelements
+ convertTaskTimers(taskElement, jpdlElement);
+ convertEvents(taskElement, jpdlElement);
+ convertExceptionHandlers(taskElement, jpdlElement);
+
+ String duedateText = taskElement.attributeValue("duedate");
+ if (duedateText == null) {
+ duedateText = taskElement.attributeValue("dueDate");
+ }
+
+ if (duedateText != null) {
+ addWarning("Unsupported duedateDate attribute converstion for task : " + taskElement.asXML());
+ }
+
+ String priorityText = taskElement.attributeValue("priority");
+ if (priorityText != null) {
+ addWarning("Unsupported priorityText attribute converstion for task : " + taskElement.asXML());
+ }
+
+ String blockingText = taskElement.attributeValue("blocking");
+ if (blockingText != null) {
+ addWarning("Unsupported blocking attribute converstion for task : " + taskElement.asXML());
+ }
+
+ String signallingText = taskElement.attributeValue("signalling");
+ if (signallingText != null) {
+ addWarning("Unsupported signallingText attribute converstion for task : " + taskElement.asXML());
+ }
+
+ // assignment
+ String swimlaneName = taskElement.attributeValue("swimlane");
+ Element assignmentElement = taskElement.element("assignment");
+
+ // if there is a swimlane attribute specified
+ if (swimlaneName != null) {
+
+ Element swimLane = swimlanesCollection.get(swimlaneName);
+ if (swimLane == null) {
+ addWarning("task references unknown swimlane '" + swimlaneName + "':" + taskElement.asXML());
+ }
+ else {
+ task4.addAttribute("swimlane", swimlaneName);
+ }
+ }
+ else if (assignmentElement != null) {
+ if ((assignmentElement.attribute("actor-id") != null) || (assignmentElement.attribute("pooled-actors") != null)) {
+
+ String actorid = assignmentElement.attributeValue("actor-id");
+ String pooledactors = assignmentElement.attributeValue("pooled-actors");
+
+ if (actorid != null) {
+ task4.addAttribute("assignee", actorid);
+ }
+ if (pooledactors != null) {
+ task4.addAttribute("candidate-groups", pooledactors);
+ }
+
+ }
+ else
+ {
+ convertAssignmentDelegation(assignmentElement, task4);
+ }
+ }
+ else
+ {
+ // the user has to manage assignment manually, so we better inform him/her.
+ log.info("process xml information: no swimlane or assignment specified for task '" + taskElement.asXML() + "'");
+ }
+
+ String notificationsText = taskElement.attributeValue("notify");
+ if (notificationsText != null && ("true".equalsIgnoreCase(notificationsText)
+ || "on".equalsIgnoreCase(notificationsText) || "yes".equalsIgnoreCase(notificationsText))) {
+ addWarning("Unsupported notify converstion for task : " + taskElement.asXML());
+ }
+
+ Element taskControllerElement = taskElement.element("controller");
+ if (taskControllerElement != null) {
+ addWarning("Unsupported controller converstion for task : " + taskElement.asXML());
+ }
+
+ return task4;
+ }
+
+ protected void convertAssignmentDelegation(Element jpdl3AssignmentElement, Element jpdl4Task) {
+
+ String expression = jpdl3AssignmentElement.attributeValue("expression");
+ String actorId = jpdl3AssignmentElement.attributeValue("actor-id");
+ String pooledActors = jpdl3AssignmentElement.attributeValue("pooled-actors");
+
+ if (expression != null) {
+
+ // TODO:How to convert default assignmenthandler?
+ // assignmentDelegation.setClassName("org.jbpm.identity.assignment.ExpressionAssignmentHandler");
+ // assignmentDelegation.setConfiguration("<expression>" + expression +
+ // "</expression>");
+
+ } else if ((actorId != null) || (pooledActors != null)) {
+
+ jpdl4Task.addComment("Please Update the AssignmentHandler and implement org.jbpm.api.task.AssignmentHandler to create your own AssignmentHandler.");
+ Element assignmentHandler = jpdl4Task.addElement("assignment-handler");
+ assignmentHandler.addAttribute("class", "org.jbpm.taskmgmt.assignment.ActorAssignmentHandler");
+
+ String configuration = "";
+ if (actorId != null) {
+ configuration += "<actorId>" + actorId + "</actorId>";
+ }
+ if (pooledActors != null) {
+ configuration += "<pooledActors>" + pooledActors + "</pooledActors>";
+ }
+
+ } else {
+ String claz = jpdl3AssignmentElement.attributeValue("class");
+ Element assignmentHandler = jpdl4Task.addElement("assignment-handler");
+ assignmentHandler.addAttribute("class", claz);
+ }
+ }
+
+ public List<VariableAccess> convertVariableAccesses(Element element) {
+
+ List<VariableAccess> variableAccesses = new ArrayList<VariableAccess>();
+ Iterator<?> iter = element.elementIterator("variable");
+ while (iter.hasNext()) {
+ Element variableElement = (Element)iter.next();
+
+ String variableName = variableElement.attributeValue("name");
+ if (variableName == null)
+ {
+ addProblem(new Problem(Problem.LEVEL_WARNING, "the name attribute of a variable element is required: " + variableElement.asXML()));
+ }
+ String access = variableElement.attributeValue("access", "read,write");
+ String mappedName = variableElement.attributeValue("mapped-name");
+
+ variableAccesses.add(new VariableAccess(variableName, access, mappedName));
+ }
+ return variableAccesses;
+ }
+
+ public void convertNode(Element jpdl3Element, Element jpdl4Element) {
+
+ String name = jpdl3Element.attributeValue("name");
+ if (name != null) {
+ jpdl4Element.addAttribute("name", name);
+ nodeCollection.put(name, jpdl4Element);
+ }
+
+ // get the node description
+ String description = jpdl3Element.elementTextTrim("description");
+ if (description != null) {
+ jpdl4Element.addComment(description);
+ }
+
+ String asyncText = jpdl3Element.attributeValue("async");
+ if ("true".equalsIgnoreCase(asyncText)) {
+ jpdl4Element.addAttribute("asyn", "true");
+ }
+ else if ("exclusive".equalsIgnoreCase(asyncText)) {
+ jpdl4Element.addAttribute("asyn", "exclusive");
+ }
+
+ // parse common subelements
+
+ convertNodeTimers(jpdl3Element, jpdl4Element);
+ convertEvents(jpdl3Element, jpdl4Element);
+ convertExceptionHandlers(jpdl3Element, jpdl4Element);
+
+ // save the transitions and parse them at the end
+ addUnresolvedTransitionDestination(jpdl3Element, jpdl4Element);
+ }
+
+ protected void convertNodeTimers(Element nodeElement, Element jpdl4Element) {
+ Iterator<?> iter = nodeElement.elementIterator("timer");
+ while (iter.hasNext()) {
+ Element timerElement = (Element)iter.next();
+ convertNodeTimer(timerElement, jpdl4Element);
+ }
+ }
+
+ protected void convertNodeTimer(Element timerElement, Element jpdl4Element) {
+ String name = timerElement.attributeValue("name", timerElement.getName());
+ if (name == null)
+ name = generateTimerName();
+
+ CreateTimerAction createTimerAction = new CreateTimerAction();
+ Element onElement = jpdl4Element.addElement("on");
+ onElement.addAttribute("event", "timeout");
+ createTimerAction.createConvertedElement(timerElement, onElement);
+ createTimerAction.read(timerElement, this);
+ }
+
+ private String generateTimerName() {
+ return "timer-" + (timerNumber++);
+ }
+
+ protected void convertTaskTimers(Element taskElement, Element jdpl4Element) {
+ Iterator<?> iter = taskElement.elementIterator();
+ while (iter.hasNext()) {
+ Element element = (Element)iter.next();
+ if (("timer".equals(element.getName())) || ("reminder".equals(element.getName())))
+ {
+ convertTaskTimer(element, jdpl4Element);
+ }
+ }
+ }
+
+ protected void convertTaskTimer(Element timerElement, Element jpdl4Element) {
+ if ("timer".equals(timerElement.getName())) {
+
+ String name = timerElement.attributeValue("name", timerElement.getName());
+ if (name == null)
+ name = generateTimerName();
+ Element onEle = jpdl4Element.addElement("on");
+ onEle.addAttribute("event", "timeout");
+ Element timer = jpdl4Element.addElement("timer");
+
+ String dueDate = timerElement.attributeValue("duedate");
+ if (dueDate==null) {
+ addWarning("no duedate specified in create timer action '"+ timerElement.asXML()+"'");
+ } else {
+ timer.addAttribute("duedate", dueDate);
+ }
+ String repeat = timerElement.attributeValue("repeat");
+ if ( "true".equalsIgnoreCase(repeat)
+ || "yes".equalsIgnoreCase(repeat) ) {
+ repeat = dueDate;
+ }
+
+ timer.addAttribute("repeat", repeat);
+
+ String transitionName = timerElement.attributeValue("transition");
+
+ if ( (transitionName!=null)
+ && (repeat!=null)
+ ) {
+ repeat = null;
+ addProblem(new Problem(Problem.LEVEL_WARNING, "ignoring repeat on timer with transition "+ timerElement.asXML()));
+ }
+
+ timer.addAttribute("duedata", dueDate);
+ this.convertSingleAction(timerElement, timer);
+ }
+ else
+ {
+ //TODO:Create mail node for <task-reminder> element
+
+ }
+
+ //TODO: Revist if we need to handle cancelTimerAction
+
+ }
+
+ public Element convertSingleAction(Element jpdl3NodeElement, Element jpdl4Element) {
+
+ Element jpdl4Action = null;
+ Iterator<?> iter = jpdl3NodeElement.elementIterator();
+ while (iter.hasNext()) {
+
+ Element candidate = (Element)iter.next();
+ if (ActionConverterTypes.hasActionName(candidate.getName())) {
+ // parse the action and assign it to this node
+ jpdl4Action = createAction(candidate, jpdl4Element);
+ }
+ }
+ return jpdl4Action;
+
+ }
+
+ public Element createAction(Element actionElement, Element jpdl4Element) {
+
+ // create a new instance of the action
+ Action action = null;
+ String actionName = actionElement.getName();
+ Class<? extends Action> actionType = ActionConverterTypes.getActionType(actionName);
+ try
+ {
+ action = actionType.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("couldn't instantiate action '" + actionName + "', of type '" + actionType.getName() + "'", e);
+ }
+
+ Element action4 = action.createConvertedElement(actionElement, jpdl4Element);
+ action.read(actionElement, this);
+ return action4;
+ }
+
+
+ protected void convertExceptionHandlers(Element jpdl3Element, Element jpdl4Element) {
+ Iterator<?> iter = jpdl3Element.elementIterator("exception-handler");
+ if (iter.hasNext()) {
+ addWarning("Unsupported exception handler conversion for element : <"
+ + jpdl3Element.getName()
+ + " name=\""
+ + jpdl3Element.attributeValue("name") + "\"/>");
+ }
+ }
+
+ // transition destinations are parsed in a second pass //////////////////////
+
+ public void addUnresolvedTransitionDestination(Element nodeElement, Element jpdl4Element)
+ {
+ unresolvedTransitionDestinations.add(new Object[]{nodeElement, jpdl4Element});
+ }
+
+ public void resolveTransitionDestinations()
+ {
+ for (Object[] unresolvedTransition : unresolvedTransitionDestinations)
+ {
+ Element nodeElement = (Element)unresolvedTransition[0];
+ Element jpdl4Element = (Element)unresolvedTransition[1];
+ resolveTransitionDestinations(nodeElement.elements("transition"), jpdl4Element);
+ }
+ }
+
+ public void resolveTransitionDestinations(List<?> transitionElements, Element jpdl4Element)
+ {
+ for (Object transitionElement : transitionElements)
+ {
+ resolveTransitionDestination((Element)transitionElement, jpdl4Element);
+ }
+ }
+
+ /*
+ * creates the transition object and configures it by the read attributes
+ * @return the created <code>org.jbpm.graph.def.Transition</code> object (useful, if you want to override this method to read additional configuration properties)
+ */
+ public void resolveTransitionDestination(Element transitionElement, Element jpdl4Element) {
+
+ Element transition4 = jpdl4Element.addElement("transition");
+ transition4.addAttribute("name", transitionElement.attributeValue("name"));
+ if (transitionElement.elementTextTrim("description") != null) {
+ transition4.addComment(transitionElement.elementTextTrim("description"));
+ }
+ //Get condition from jpdl3 element
+ String condition = transitionElement.attributeValue("condition");
+ if (condition == null)
+ {
+ Element conditionElement = transitionElement.element("condition");
+ if (conditionElement != null)
+ {
+ condition = conditionElement.getTextTrim();
+ // for backwards compatibility
+ if ((condition == null) || (condition.length() == 0))
+ {
+ condition = conditionElement.attributeValue("expression");
+ }
+ }
+ }
+
+
+ if (condition != null && condition.length() > 0) {
+ Element condition4 = transition4.addElement("condition");
+ condition4.addAttribute("expr", condition);
+ }
+
+
+ // set destinationNode of the transition
+ String toName = transitionElement.attributeValue("to");
+ if (toName == null)
+ {
+ addWarning("node '" + transitionElement.getPath() + "' has a transition without a 'to'-attribute to specify its destinationNode");
+ }
+ else
+ {
+ Element to = this.findNode(toName);
+ if (to == null)
+ {
+ addWarning("transition to='" + toName + "' on node '" + transitionElement.getName() + "' cannot be resolved");
+ }
+
+ transition4.addAttribute("to", toName);
+ }
+
+ // read the actions
+ convertActions(transitionElement, transition4, "");
+
+ convertExceptionHandlers(transitionElement, transition4);
+ }
+
+ // action references are parsed in a second pass ////////////////////////////
+
+ public void addUnresolvedActionReference(Element actionElemen)
+ {
+ //unresolvedActionReferences.add(new Object[] { actionElemen});
+ }
+
+ public void resolveActionReferences()
+ {
+
+ }
+
+ // verify swimlane assignments in second pass ///////////////////////////////
+ public void verifySwimlaneAssignments()
+ {
+ //
+ }
+
+ // mail delegations /////////////////////////////////////////////////////////
+
+ public void createMailDelegation(String template, String actors, String to, String subject, String text)
+ {
+ //
+ }
+
+ public String getProperty(String property, Element element)
+ {
+ String value = element.attributeValue(property);
+ if (value == null)
+ {
+ Element propertyElement = element.element(property);
+ if (propertyElement != null)
+ {
+ value = propertyElement.getText();
+ }
+ }
+ return value;
+ }
+ //New added method
+ private Element findNode(String name) {
+ return nodeCollection.get(name);
+ }
+
+ public Document getJpdl4Document()
+ {
+ return jpdl4Document;
+ }
+
+ private static final Log log = LogFactory.getLog(Jpdl3Converter.class);
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.io.Serializable;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Document;
+import org.dom4j.io.SAXReader;
+import org.jbpm.jpdl.internal.convert.problem.Problem;
+import org.jbpm.jpdl.internal.convert.problem.ProblemListener;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+
+
+/**
+ * Validate an XML document using JAXP techniques and an XML Schema. This helper
+ * class wraps the processing of a schema to aid in schema validation throughout
+ * the product.
+ *
+ * orginal authors:
+ * @author Tom Baeyens
+ * @author Jim Rigsbee
+ */
+public class Jpdl3ConverterParser implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ static SAXParserFactory saxParserFactory = createSaxParserFactory();
+ private static Set schemaResources = getDefaultSchemaResources();
+ private static Object schemaSource;
+
+ public static Document parse(InputSource inputSource, ProblemListener problemListener) throws Exception {
+ Document document = null;
+ SAXReader saxReader = createSaxReader(problemListener);
+ document = saxReader.read(inputSource);
+ return document;
+ }
+
+ public static SAXReader createSaxReader(ProblemListener problemListener) throws Exception {
+ XMLReader xmlReader = createXmlReader();
+ SAXReader saxReader = new SAXReader(xmlReader);
+ saxReader.setErrorHandler(new JpdlErrorHandler(problemListener));
+ return saxReader;
+ }
+
+ public static XMLReader createXmlReader() throws Exception {
+ 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 (SAXException e){
+ log.warn("couldn't set schema language property", e);
+ }
+
+ try {
+ saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", getSchemaSource());
+ } catch (SAXException e){
+ log.warn("couldn't set schema source property", e);
+ }
+
+ try {
+ xmlReader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
+ } catch (SAXException e){
+ log.warn("couldn't set dynamic validation feature", e);
+ }
+ return xmlReader;
+ }
+
+ private static Object getSchemaSource() {
+ if (schemaSource == null) {
+ List schemaLocations = new ArrayList(schemaResources.size());
+ for (Iterator i = schemaResources.iterator(); i.hasNext();) {
+ String schemaResource = (String) i.next();
+ URL schemaURL = Jpdl3ConverterParser.class.getClassLoader().getResource(schemaResource);
+ if (schemaURL != null) {
+ String schemaLocation = schemaURL.toString();
+ if(log.isDebugEnabled()){
+ log.debug("schema resource found: " + schemaResource);
+ }
+ schemaLocations.add(schemaLocation);
+ }
+ }
+ schemaSource = schemaLocations.toArray(new String[schemaLocations.size()]);
+ }
+ return schemaSource;
+ }
+
+ static class JpdlErrorHandler implements ErrorHandler, Serializable {
+
+ private ProblemListener problemListener = null;
+
+ private static final long serialVersionUID = 1L;
+
+ JpdlErrorHandler(ProblemListener problemListener) {
+ this.problemListener = problemListener;
+ }
+
+ public void warning(SAXParseException pe) {
+ addProblem(Problem.LEVEL_WARNING, pe);
+ }
+
+ public void error(SAXParseException pe) {
+ addProblem(Problem.LEVEL_ERROR, pe);
+ }
+
+ public void fatalError(SAXParseException pe) {
+ addProblem(Problem.LEVEL_FATAL, pe);
+ }
+
+ private void addProblem(int level, SAXParseException pe) {
+ Problem problem = new Problem(level, pe.getMessage(), pe);
+ problem.setResource(pe.getSystemId());
+ int line = pe.getLineNumber();
+ if (line != -1) problem.setLine(new Integer(line));
+ problemListener.addProblem(problem);
+ }
+ }
+
+ public static void addSchemaResource(String resource) {
+ schemaResources.add(resource);
+ schemaSource = null;
+ }
+
+ private static Set getDefaultSchemaResources() {
+ Set schemaResources = new HashSet();
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.0.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.1.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.2.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.3.xsd");
+ schemaResources.add("org/jboss/seam/pageflow-2.0.xsd");
+ return schemaResources;
+ }
+
+ private static SAXParserFactory createSaxParserFactory() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
+ return saxParserFactory;
+ }
+
+ private static final Log log = LogFactory.getLog(Jpdl3ConverterParser.class);
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/JpdlConverterTool.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/JpdlConverterTool.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/JpdlConverterTool.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,229 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.dom4j.Document;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+import org.jbpm.jpdl.internal.convert.exception.IllegalCommandException;
+import org.jbpm.jpdl.internal.convert.problem.Problem;
+
+/**
+ * Conversion command line tool main class.
+ *
+ * @author Jim Ma
+ */
+public class JpdlConverterTool {
+
+ public static void main(String[] args) {
+ JpdlConverterTool jpdlConverterTool = new JpdlConverterTool();
+
+ // Parse and validate the command line arguments
+ ConverterContext context = null;
+ try {
+ context = jpdlConverterTool.parseParam(args);
+ jpdlConverterTool.validate(context);
+ } catch (IllegalCommandException e) {
+ System.err.println(e.getMessage());
+ System.err.println(jpdlConverterTool.getUsage());
+ return;
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ return;
+ }
+
+
+ boolean verbose = false;
+ if (context.get(ConverterContext.VERBOSE) != null) {
+ verbose = true;
+ }
+ Jpdl3Converter jpdlConverter = new Jpdl3Converter((URL)context.get(context.PROCESS_FILE_URL));
+
+ try {
+ if (verbose) {
+ System.out.println("Loading process file from URL [" + context.get(context.PROCESS_FILE_URL) + "]...");
+ }
+ Document jpdl4Doc = jpdlConverter.readAndConvert();
+
+ if (verbose) {
+ System.out.println("Converting the process file to jPDL4 version....");
+ }
+
+ String outputFilePath = (String)context.get(context.OUPUTFILE);
+ File outputFile = new File(outputFilePath);
+
+ //well print xml to file
+ Writer fileWriter = new FileWriter(outputFile);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ XMLWriter writer = new XMLWriter( fileWriter, format );
+ writer.write(jpdl4Doc);
+ writer.close();
+
+
+ if (verbose) {
+ System.out.println("Generating converted file to:" + (outputFile.isAbsolute() ? outputFile.getAbsolutePath() : outputFile.getName()));
+ }
+
+ } catch (Exception e) {
+
+ for (Problem problem : jpdlConverter.problems) {
+ if (problem.getLevel() == problem.LEVEL_WARNING) {
+ System.err.println(problem);
+ }
+ if (problem.getLevel() < problem.LEVEL_WARNING) {
+ System.err.println(problem);
+ if (problem.getException() != null
+ && context.get(ConverterContext.VERBOSE) != null) {
+ problem.getException().printStackTrace(System.err);
+ System.err.println();
+ }
+ }
+ }
+
+
+ }
+ }
+
+ /**
+ * Parses the command line arguments and returns a context
+ * in which the conversion will happen.
+ */
+ public ConverterContext parseParam(String[] args) throws IllegalCommandException {
+ ConverterContext context = new ConverterContext();
+
+ if (args.length == 0) {
+ throw new IllegalCommandException("No file for conversion is supplied");
+ }
+
+ for (int i = 0; i < args.length; i++) {
+ String token = args[i];
+ if ("-v".equalsIgnoreCase(token) || "-verbose".equalsIgnoreCase(token)) {
+ context.put(ConverterContext.VERBOSE, ConverterContext.VERBOSE);
+ } else if ("-o".equalsIgnoreCase(token)
+ || "-output".equalsIgnoreCase(token)) {
+ int j = ++i;
+ if (j < args.length) {
+ String outputFile = args[j];
+ context.put(ConverterContext.OUPUTFILE, args[j]);
+ } else {
+ throw new IllegalCommandException("Missing output file name");
+ }
+ } else if (token.startsWith("-")) {
+ throw new IllegalCommandException("Unknow flag [" + token +"]");
+ } else if(context.get(ConverterContext.PROCESS_FILE) == null) {
+ context.put(ConverterContext.PROCESS_FILE, token);
+ } else {
+ throw new IllegalCommandException("Duplicate input process file");
+ }
+
+ }
+ if (context.get(ConverterContext.PROCESS_FILE) == null) {
+ throw new IllegalCommandException("No input process file defined");
+ }
+
+ return context;
+ }
+
+ public void validate(ConverterContext context) throws Exception {
+ String processFile = (String) context.get(ConverterContext.PROCESS_FILE);
+ URL processURL = getFileURL(processFile);
+ if (processURL == null) {
+ throw new IllegalCommandException("Failed to load the process file [" + processFile + "]");
+ }
+ context.put(context.PROCESS_FILE_URL, processURL);
+ //handle the output filename
+ if (context.get(ConverterContext.OUPUTFILE) == null) {
+ File tmpFile = new File(processURL.getFile());
+ String fileName = tmpFile.getName();
+ String baseName = fileName;
+
+ int index = fileName.lastIndexOf(".");
+
+ if (index > -1) {
+ baseName = fileName.substring(0, index);
+ } else {
+ baseName = fileName;
+ }
+
+ String outputFileName = baseName + ".converted.jpdl.xml";
+ File outFile = new File(".", outputFileName);
+ context.put(ConverterContext.OUPUTFILE, outFile.getAbsolutePath());
+ } else {
+ String outputFile = (String)context.get(ConverterContext.OUPUTFILE);
+ File file = new File(outputFile);
+ if (file.isAbsolute()) {
+ if (!file.getParentFile().exists()) {
+ throw new IllegalCommandException("Output directory [" + file.getParent() + "] does not exist");
+ }
+ } else {
+ file = new File(".", outputFile);
+ }
+ if (!file.exists()) {
+ file.createNewFile();
+ }
+ context.put(ConverterContext.OUPUTFILE, file.getAbsolutePath());
+ }
+
+ }
+
+ public URL getFileURL(String fileName) {
+ try {
+ URL url = new URL(fileName);
+ return url;
+ } catch (MalformedURLException e1) {
+ //Do nothing
+ }
+ File file = new File(fileName);
+ if (file.exists()) {
+ try {
+ return file.toURL();
+ } catch (MalformedURLException e) {
+ // Do nothing.
+ }
+
+ }
+ // load in current directory
+ File tmpFile = new File(".", fileName);
+ if (file.exists()) {
+ try {
+ return tmpFile.toURL();
+ } catch (MalformedURLException e) {
+ // Do nothing
+ }
+ }
+
+ return null;
+ }
+
+ public String getUsage() {
+ return "Usage : java org.jbpm.jpdl.internal.convert.JpdlConverterTool <file>\r\n"
+ + " java org.jbpm.jpdl.internal.convert.JpdlConverterTool -v -o <outputfile> <file>";
+
+ }
+
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.action;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+/**
+ * The Action class to create the converted action or script elements and map the specific attributes
+ * @author<a href="mailto:ema@redhat.com>Jim Ma</a>
+ *
+ */
+public class Action {
+
+ protected Element convertedElement = null;
+ protected boolean isPropagationAllowed = true;
+ protected boolean isAsync = false;
+ protected boolean isAsyncExclusive = false;
+
+ public Action() {
+
+ }
+
+ public Element createConvertedElement(Element actionElement, Element jpdl4Doc) {
+ String expression = actionElement.attributeValue("expression");
+
+ if (expression != null) {
+ convertedElement = jpdl4Doc.addElement("script");
+
+ }
+
+ if (actionElement.attributeValue("class")!=null) {
+ convertedElement = jpdl4Doc.addElement("java");
+
+ }
+
+ return convertedElement;
+ }
+
+ public void read(Element actionElement, Jpdl3Converter jpdlReader) {
+ String expression = actionElement.attributeValue("expression");
+ if (expression!=null) {
+ convertedElement.addAttribute("expr", expression);
+ convertedElement.addAttribute("lang", "juel");
+
+ } else if (actionElement.attribute("ref-name")!=null) {
+ //TODO: Unsupported ref-name
+ //jpdlReader.addUnresolvedActionReference(actionElement, this);
+ jpdlReader.addWarning("Unsupported ref-name attribute conversion in element " + actionElement.asXML());
+ } else if (actionElement.attribute("class")!=null) {
+ convertedElement.addAttribute("class", actionElement.attributeValue("class"));
+ convertedElement.addAttribute("method", "execute");
+
+ } else {
+ jpdlReader.addWarning("action does not have class nor ref-name attribute "+actionElement.asXML());
+ }
+ //TODO: propagate...
+ String acceptPropagatedEvents = actionElement.attributeValue("accept-propagated-events");
+ if ("false".equalsIgnoreCase(acceptPropagatedEvents)
+ || "no".equalsIgnoreCase(acceptPropagatedEvents)
+ || "off".equalsIgnoreCase(acceptPropagatedEvents)) {
+ isPropagationAllowed = false;
+ }
+
+ String asyncText = actionElement.attributeValue("async");
+ if ("true".equalsIgnoreCase(asyncText)) {
+ convertedElement.addAttribute("async", "true");
+ } else if ("exclusive".equalsIgnoreCase(asyncText)) {
+ convertedElement.addAttribute("async", "exclusive");
+ }
+ }
+
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/ActionConverterTypes.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/ActionConverterTypes.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/ActionConverterTypes.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.action;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.jbpm.jpdl.internal.convert.node.NodeConverterTypes;
+
+/**
+ * This originates from jbpm3 code base
+ * It reads the "META-INF/action.converter.types.xml" configuration to load the class to convert
+ * Action elements
+ */
+
+public class ActionConverterTypes {
+
+ public static Set<Class<? extends Action>> getActionTypes() {
+ return actionNames.keySet();
+ }
+
+ public static Set<String> getActionNames() {
+ return actionTypes.keySet();
+ }
+
+ public static Class<? extends Action> getActionType(String name) {
+ return actionTypes.get(name);
+ }
+
+ public static String getActionName(Class<? extends Action> type) {
+ return actionNames.get(type);
+ }
+
+ public static boolean hasActionName(String name) {
+ return actionTypes.containsKey(name);
+ }
+
+ private static SAXReader reader = new SAXReader();
+ static final Log log = LogFactory.getLog(ActionConverterTypes.class);
+ static Map<String, Class<? extends Action>> actionTypes = initialiseActionTypes();
+ static Map<Class<? extends Action>, String> actionNames = NodeConverterTypes.createInverseMapping(actionTypes);
+
+ static Map<String, Class<? extends Action>> initialiseActionTypes() {
+ Map<String, Class<? extends Action>> types = new HashMap<String, Class<? extends Action>>();
+
+ InputStream actionTypesStream = ActionConverterTypes.class
+ .getClassLoader().getResourceAsStream(
+ "action.converter.types.xml");
+
+ Element actionTypesElement = null;
+ try {
+ actionTypesElement = reader.read(actionTypesStream)
+ .getRootElement();
+ } catch (DocumentException e1) {
+ log.error("Failed to parse the action.converter.types.xml", e1);
+ }
+
+ Iterator<?> actionTypeIterator = actionTypesElement
+ .elementIterator("action-type");
+ while (actionTypeIterator.hasNext()) {
+ Element actionTypeElement = (Element) actionTypeIterator.next();
+
+ String elementTag = actionTypeElement.attributeValue("element");
+ String className = actionTypeElement.attributeValue("class");
+ try {
+ Class<?> actionClass = ActionConverterTypes.class.forName(className);
+ types.put(elementTag, actionClass.asSubclass(Action.class));
+
+ } catch (Exception e) {
+ // NOTE that Error's are not caught because that might halt the
+ // JVM and mask the original Error.
+ if (log.isDebugEnabled()) {
+ log.debug("action '" + elementTag
+ + "' will not be available. class '" + className
+ + "' couldn't be loaded");
+ }
+ }
+ }
+ return types;
+ }
+
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/CreateTimerAction.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/CreateTimerAction.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/CreateTimerAction.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.action;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+import org.jbpm.jpdl.internal.convert.problem.Problem;
+
+/**
+ * Create the converted timer element and map the specific attributes
+ * @author<a href="mailto:ema@redhat.com>Jim Ma</a>
+ *
+ */
+
+public class CreateTimerAction extends Action {
+ @Override
+ public Element createConvertedElement(Element actionElement,
+ Element jpdl4Doc) {
+ this.convertedElement = jpdl4Doc.addElement("timer");
+ return convertedElement;
+ }
+
+ @Override
+ public void read(Element actionElement, Jpdl3Converter jpdlReader) {
+
+ Element timerAction = jpdlReader.convertSingleAction(actionElement, this.convertedElement);
+
+ String dueDate = actionElement.attributeValue("duedate");
+ if (dueDate == null) {
+ jpdlReader
+ .addWarning("no duedate specified in create timer action '"
+ + actionElement + "'");
+ } else {
+ convertedElement.addAttribute("duedate", dueDate);
+ }
+ String repeat = actionElement.attributeValue("repeat");
+ if ("true".equalsIgnoreCase(repeat) || "yes".equalsIgnoreCase(repeat)) {
+ repeat = dueDate;
+ }
+
+ if (repeat != null) {
+ convertedElement.addAttribute("repeat", repeat);
+ }
+
+ String transitionName = actionElement.attributeValue("transition");
+
+ if ((transitionName != null) && (repeat != null)) {
+ repeat = null;
+ jpdlReader.addProblem(new Problem(Problem.LEVEL_WARNING,
+ "ignoring repeat on timer with transition "
+ + actionElement.asXML()));
+ }
+ //TODO: Investigate how to convert transition attribute
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.action;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+/**
+ * Create the converted script element and map the specific attributes
+ * @author<a href="mailto:ema@redhat.com>Jim Ma</a>
+ *
+ */
+public class Script extends Action {
+
+ public Element createConvertedElement(Element actionElement, Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("script");
+ return convertedElement;
+ }
+
+ public void read(Element actionElement, Jpdl3Converter jpdlReader) {
+ String expression = null;
+ if (actionElement.isTextOnly()) {
+ expression = actionElement.getText();
+ } else {
+ //TODO:Unsupported variable conversion
+ //List<VariableAccess> vias = jpdlReader.readVariableAccesses(actionElement);
+ expression = actionElement.element("expression").getText();
+ }
+ convertedElement.addAttribute("expr", expression);
+ convertedElement.addAttribute("lang", "juel");
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/ConvertException.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.exception;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.jbpm.jpdl.internal.convert.problem.Problem;
+
+public class ConvertException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ protected List problems = null;
+
+ public ConvertException(List problems) {
+ super(problems.toString());
+ this.problems = problems;
+ }
+ public ConvertException(String msg) {
+ this(Collections.singletonList(new Problem(Problem.LEVEL_ERROR, msg)));
+ }
+ public ConvertException(String msg, Throwable e ) {
+ this(Collections.singletonList(new Problem(Problem.LEVEL_ERROR, msg, e)));
+ }
+ public List getProblems() {
+ return problems;
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/IllegalCommandException.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/IllegalCommandException.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/exception/IllegalCommandException.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.exception;
+
+/**
+ * Custom exception to indicate an illegal usage of a command line argument.
+ *
+ * @author Jim Ma
+ */
+public class IllegalCommandException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public IllegalCommandException() {
+ super();
+ }
+
+ public IllegalCommandException(String msg) {
+ super(msg);
+ }
+
+
+ public IllegalCommandException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public IllegalCommandException(Throwable cause) {
+ super(cause);
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Access.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Access.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Access.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import java.io.Serializable;
+
+/**
+ * This originates from jbpm3 code base for variable acces
+ *
+ */
+public class Access implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ String access = "read,write";
+
+ public Access() {
+ }
+
+ public Access(String access) {
+ if (access!=null) {
+ if ("".equals(access)) {
+ this.access = " ";
+ } else {
+ this.access = access;
+ }
+ }
+ }
+
+ public boolean isReadable() {
+ return hasAccess("read");
+ }
+
+ public boolean isWritable() {
+ return hasAccess("write");
+ }
+
+ public boolean isRequired() {
+ return hasAccess("required");
+ }
+
+ public boolean isLock() {
+ return hasAccess("lock");
+ }
+
+ /**
+ * verifies if the given accessLiteral is included in the access text.
+ */
+ public boolean hasAccess(String accessLiteral) {
+ if (access==null) return false;
+ return (access.indexOf(accessLiteral.toLowerCase())!=-1);
+ }
+
+ public String toString() {
+ return access;
+ }
+
+ public boolean equals(Object object) {
+ if (object instanceof Access) {
+ Access other = (Access) object;
+ return (isReadable()==other.isReadable())
+ && (isWritable()==other.isWritable())
+ && (isRequired()==other.isRequired())
+ && (isLock()==other.isLock());
+ } else {
+ return false;
+ }
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Decision.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Decision.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Decision.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class Decision extends Node {
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("decision");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class EndState extends Node {
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("end");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+
+ }
+}
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class Fork extends Node {
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("fork");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class Join extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("join");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/MailNode.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/MailNode.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/MailNode.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class MailNode extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("mail");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+ String template = nodeElement.attributeValue("template");
+ String actors = nodeElement.attributeValue("actors");
+ String to = nodeElement.attributeValue("to");
+ String subject = reader.getProperty("subject", nodeElement);
+ String text = reader.getProperty("text", nodeElement);
+ if (template != null) {
+ convertedElement.addAttribute("template", template);
+ }
+ //TODO: handler actors and look at if there is the equivalent AddressResolver in jbpm4
+ if (actors != null) {
+
+ }
+ if (to != null) {
+ Element toElement = convertedElement.addElement("to");
+ //TODO: handler expression
+ toElement.addAttribute("to", to);
+ }
+ if (subject != null) {
+ Element subjectElement = convertedElement.addElement("subject");
+ subjectElement.addText(subject);
+ }
+ if (text != null) {
+ Element textElement = convertedElement.addElement("text");
+ textElement.addText(text);
+ }
+ }
+}
+
+
+/*<mail name="send rectify note" language="juel" g="99,25,115,45">
+<to addresses="winston@minitrue" />
+<cc users="bb" groups="innerparty" />
+<bcc groups="thinkpol" />
+<subject>rectify ${newspaper}</subject>
+<text>${newspaper} ${date} reporting bb dayorder doubleplusungood
+ refs unpersons rewrite fullwise upsub antefiling</text>
+<!--
+<html><table><tr><td>${newspaper}</td><td>${date}</td>
+ <td>reporting bb dayorder doubleplusungood
+ refs unpersons rewrite fullwise upsub antefiling</td>
+ </tr></table></html>
+<attachments>
+ <attachment url='http://www.george-orwell.org/1984/3.html' />
+ <attachment resource='org/example/pic.jpg' />
+ <attachment file='${user.home}/.face' />
+</attachments>
+-->
+<transition to="end" />
+</mail>*/
+
+/*
+<mail name="send rectify note"
+ template="rectify-template"
+ g="99,25,115,45">
+<transition to="end"/>
+</mail>*/
+
+
+
+
+
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+import org.jbpm.jpdl.internal.convert.action.Action;
+/**
+ * create the converted action element and map the specific attributes
+ * @author<a href="mailto:ema@redhat.com>Jim Ma</a>
+ *
+ */
+public class Node {
+
+ protected Element convertedElement = null;
+
+ protected Element nodeElement = null;
+
+ protected Action action = new Action();
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ Element actionElement = nodeElement.element("action");
+ convertedElement= action.createConvertedElement(actionElement, jpdl4Doc);
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+ Element actionElement = nodeElement.element("action");
+ action.read(actionElement, reader);
+
+ }
+
+ public Element getConvertedElement() {
+ return convertedElement;
+ }
+
+ //set the jpdl3 element
+ public void setNodeElement(Element ele) {
+ this.nodeElement = ele;
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/NodeConverterTypes.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/NodeConverterTypes.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/NodeConverterTypes.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+
+/**
+ * This originates from jbpm3 code base
+ *
+ * Basically, it maps a type string to a Node class.
+ */
+public class NodeConverterTypes {
+
+ public static Set<String> getNodeTypes() {
+ return nodeTypes.keySet();
+ }
+
+ public static Set<Class<? extends Node>> getNodeNames() {
+ return nodeNames.keySet();
+ }
+
+ public static Class<? extends Node> getNodeType(String name) {
+ return nodeTypes.get(name);
+ }
+
+ public static String getNodeName(Class<? extends Node> type) {
+ return nodeNames.get(type);
+ }
+
+ private static final Log log = LogFactory.getLog(NodeConverterTypes.class);
+ private static SAXReader reader = new SAXReader();
+ static Map<String, Class<? extends Node>> nodeTypes = initialiseNodeTypes();
+ static Map<Class<? extends Node>, String> nodeNames = createInverseMapping(nodeTypes);
+
+ static Map<String, Class<? extends Node>> initialiseNodeTypes() {
+ Map<String, Class<? extends Node>> types = new HashMap<String, Class<? extends Node>>();
+ InputStream nodeTypesStream = NodeConverterTypes.class.getClassLoader().getResourceAsStream("node.converter.types.xml");
+ Element nodeTypesElement = null;
+ try {
+ nodeTypesElement = reader.read(nodeTypesStream).getRootElement();
+ } catch (DocumentException e1) {
+ log.error("Failed to parse the node.converter.types.xml", e1);
+ }
+ Iterator<?> nodeTypeIterator = nodeTypesElement.elementIterator("node-type");
+ while(nodeTypeIterator.hasNext()) {
+ Element nodeTypeElement = (Element) nodeTypeIterator.next();
+
+ String elementTag = nodeTypeElement.attributeValue("element");
+ String className = nodeTypeElement.attributeValue("class");
+ try {
+ Class<?> nodeClass = NodeConverterTypes.class.forName(className);
+ types.put(elementTag, nodeClass.asSubclass(Node.class));
+
+ } catch (Exception e) {
+ if (!"org.jboss.seam.jbpm.Page".equals(className)) {
+ if(log.isDebugEnabled())
+ {
+ log.debug("node '"+elementTag+"' will not be available. class '"+className+"' couldn't be loaded");
+ }
+ }
+ }
+ }
+
+ return types;
+ }
+
+ public static <K, V> Map<V, K> createInverseMapping(Map<K, V> map) {
+ Map<V, K> inverse = new HashMap<V, K>();
+ for (Map.Entry<K, V> entry : map.entrySet()) {
+ inverse.put(entry.getValue(), entry.getKey());
+ }
+ return inverse;
+ }
+ }
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,40 @@
+package org.jbpm.jpdl.internal.convert.node;
+
+import java.util.List;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class ProcessState extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("sub-process");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+ String name = nodeElement.attributeValue("name");
+
+ convertedElement.attributeValue("name", name);
+
+ Element subProcessElement = nodeElement.element("sub-process");
+ if (subProcessElement!=null) {
+ String subProcessName = subProcessElement.attributeValue("name");
+ //String subProcessVersion = subProcessElement.attributeValue("version");
+ convertedElement.attributeValue("sub-process-id", subProcessName);
+ }
+
+ List<VariableAccess> readVariableAccesses = reader.convertVariableAccesses(nodeElement);
+ for (VariableAccess via : readVariableAccesses) {
+ Element para = null;
+ if (via.isReadable()) {
+ para = convertedElement.addElement("parameter-in");
+ } else {
+ para = convertedElement.addElement("parameter-out");
+ }
+ para.addAttribute("var", via.getVariableName());
+ para.addAttribute("subvar", via.getMappedName());
+ }
+
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class StartState extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("start");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+ Element startTaskElement = nodeElement.element("task");
+ if (startTaskElement!=null) {
+ reader.addWarning("Unsupported start task conversion");
+ }
+
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class State extends Node {
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("state");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+ }
+ }
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3Converter;
+
+public class TaskNode extends Node {
+
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("task");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3Converter reader) {
+
+ }
+}
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/VariableAccess.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/VariableAccess.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/VariableAccess.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.node;
+
+import java.io.Serializable;
+
+/**
+ * This originates from jbpm3 codebase.
+ * specifies access to a variable.
+ * Variable access is used in 3 situations:
+ * 1) process-state
+ * 2) script
+ * 3) task controllers
+ */
+public class VariableAccess implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ long id = 0;
+ protected String variableName = null;
+ protected Access access = null;
+ protected String mappedName = null;
+
+ // constructors /////////////////////////////////////////////////////////////
+
+ public VariableAccess() {
+ }
+
+ public VariableAccess(String variableName, String access, String mappedName) {
+ this.variableName = variableName;
+ if (access!=null) access = access.toLowerCase();
+ this.access = new Access(access);
+ this.mappedName = mappedName;
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
+ /**
+ * the mapped name. The mappedName defaults to the variableName in case
+ * no mapped name is specified.
+ */
+ public String getMappedName() {
+ if (mappedName==null) {
+ return variableName;
+ }
+ return mappedName;
+ }
+
+ /**
+ * specifies a comma separated list of access literals {read, write, required}.
+ */
+ public Access getAccess() {
+ return access;
+ }
+ public String getVariableName() {
+ return variableName;
+ }
+
+ public boolean isReadable() {
+ return access.isReadable();
+ }
+
+ public boolean isWritable() {
+ return access.isWritable();
+ }
+
+ public boolean isRequired() {
+ return access.isRequired();
+ }
+
+ public boolean isLock() {
+ return access.isLock();
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/Problem.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.problem;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * This class orginates from jpbm3 codebase
+ *
+ */
+public class Problem implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final int LEVEL_FATAL = 1;
+ public static final int LEVEL_ERROR = 2;
+ public static final int LEVEL_WARNING = 3;
+ public static final int LEVEL_INFO = 4;
+
+ static String getTypeDescription(int level) {
+ if (level==LEVEL_FATAL) return "FATAL";
+ if (level==LEVEL_ERROR) return "ERROR";
+ if (level==LEVEL_WARNING) return "WARNING";
+ if (level==LEVEL_INFO) return "INFO";
+ return null;
+ }
+
+ protected int level;
+ protected String description;
+ protected String resource;
+ protected String folder;
+ protected Integer line;
+ protected Throwable exception;
+
+ public Problem(int level, String description) {
+ this.level = level;
+ this.description = description;
+ }
+
+ public Problem(int level, String description, Throwable exception) {
+ this.level = level;
+ this.description = description;
+ this.exception = exception;
+ }
+
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("["+getTypeDescription(level)+"]");
+ if (description!=null) buffer.append(" "+description);
+ if (resource!=null) buffer.append(" at "+resource);
+ if (line!=null) buffer.append(" line "+line);
+ if (folder!=null) buffer.append(" in "+folder);
+ return buffer.toString();
+ }
+
+ public static boolean containsProblemsOfLevel(Collection c, int level) {
+ Iterator iter = c.iterator();
+ while (iter.hasNext()) {
+ Problem problem = (Problem) iter.next();
+ if (problem.level <= level) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public Throwable getException() {
+ return exception;
+ }
+ public void setException(Throwable exception) {
+ this.exception = exception;
+ }
+ public String getFolder() {
+ return folder;
+ }
+ public void setFolder(String folder) {
+ this.folder = folder;
+ }
+ public Integer getLine() {
+ return line;
+ }
+ public void setLine(Integer line) {
+ this.line = line;
+ }
+ public String getResource() {
+ return resource;
+ }
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+ public int getLevel() {
+ return level;
+ }
+}
Added: jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/ProblemListener.java
===================================================================
--- jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/ProblemListener.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/problem/ProblemListener.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert.problem;
+
+import java.io.Serializable;
+
+/**
+ * This class orginates from jpbm3 codebase
+ *
+ */
+public interface ProblemListener extends Serializable {
+
+ void addProblem(Problem problem);
+}
Added: jbpm4/trunk/modules/migration/src/main/resources/action.converter.types.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/action.converter.types.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/action.converter.types.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,7 @@
+<action-types>
+ <action-type element="action" class="org.jbpm.jpdl.internal.convert.action.Action" />
+ <action-type element="create-timer" class="org.jbpm.jpdl.internal.convert.action.CreateTimerAction" />
+ <action-type element="cancel-timer" class="org.jbpm.scheduler.def.CancelTimerAction" />
+ <action-type element="script" class="org.jbpm.jpdl.internal.convert.action.Script" />
+ <action-type element="mail" class="org.jbpm.graph.action.MailAction" />
+</action-types>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/resources/log4j.properties
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/log4j.properties (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/log4j.properties 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,4 @@
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+log4j.rootLogger=info, stdout
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/resources/node.converter.types.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/node.converter.types.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/node.converter.types.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,20 @@
+<node-types>
+ <node-type element="start-state" class="org.jbpm.jpdl.internal.convert.node.StartState" />
+ <node-type element="end-state" class="org.jbpm.jpdl.internal.convert.node.EndState" />
+ <node-type element="node" class="org.jbpm.jpdl.internal.convert.node.Node" />
+ <node-type element="state" class="org.jbpm.jpdl.internal.convert.node.State" />
+ <node-type element="task-node" class="org.jbpm.jpdl.internal.convert.node.TaskNode" />
+ <node-type element="fork" class="org.jbpm.jpdl.internal.convert.node.Fork" />
+ <node-type element="join" class="org.jbpm.jpdl.internal.convert.node.Join" />
+ <node-type element="decision" class="org.jbpm.jpdl.internal.convert.node.Decision" />
+ <node-type element="process-state" class="org.jbpm.jpdl.internal.convert.node.ProcessState" />
+ <node-type element="mail-node" class="org.jbpm.jpdl.internal.convert.node.MailNode" />
+ <!--node-type element="super-state" class="org.jbpm.jpdl.internal.convert.node.SuperState" />
+
+ <node-type element="merge" class="org.jbpm.jpdl.internal.convert.node.Merge" />
+ <node-type element="milestone-node" class="oorg.jbpm.jpdl.internal.convert.node.MilestoneNode" />
+ <node-type element="interleave-start" class="org.jbpm.jpdl.internal.convert.node.InterleaveStart" />
+ <node-type element="interleave-end" class="org.jbpm.jpdl.internal.convert.node.InterleaveEnd"/>
+ <node-type element="page" class="org.jboss.seam.pageflow.Page" />
+ <node-type element="start-page" class="org.jboss.seam.pageflow.Page" /-->
+</node-types>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,866 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Jim Rigsbee (private) -->
+<xs:schema targetNamespace="http://jbpm.org/3/jpdl" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.0" xmlns="http://jbpm.org/3/jpdl" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="process-definition" type="process-definition-v3.0">
+ <xs:annotation>
+ <xs:documentation>jBPM Process Definition Language (JPDL) version 3.0 </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:simpleType name="configType">
+ <xs:annotation>
+ <xs:documentation>Indicates how to use the metadata within a handler</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="duedateType">
+ <xs:annotation>
+ <xs:documentation>Expression that indicates when a timer is due to fire</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\p{N}+([ ]+business)?[ ]+((second)|(seconds)|(minute)|(minutes)|(hour)|(hours)|(day)|(days)|(week)|(weeks)|(month)|(months)|(year)|(years))([ ]+(and)[ ]+\p{N}+([ ]+business)?[ ]+((second)|(seconds)|(minute)|(minutes)|(hour)|(hours)|(day)|(days)|(week)|(weeks)|(month)|(months)|(year)|(years)))*"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="booleanType">
+ <xs:annotation>
+ <xs:documentation>Yes, no, true, false, on, and off</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="accessType">
+ <xs:annotation>
+ <xs:documentation>Defines how a variable may be accessed</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="read"/>
+ <xs:enumeration value="read,required"/>
+ <xs:enumeration value="read,write"/>
+ <xs:enumeration value="read,write,required"/>
+ <xs:enumeration value="write"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="repeatType">
+ <xs:annotation>
+ <xs:documentation>Defines if and when to repeat a timer</xs:documentation>
+ </xs:annotation>
+ <xs:union memberTypes="duedateType booleanType"/>
+ </xs:simpleType>
+ <xs:element name="action">
+ <xs:annotation>
+ <xs:documentation>Defines custom behavior</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="class" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Either a class or ref-name must be specified.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="ref-name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Either a class or ref-name must be specified. The content of this action is not processed if a referenced action is specified.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="accept-propagated-events" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>If set to false, the action will only be executed on events that were fired on this action's element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the action object should be constructed and how the content of this element should be used as configuration information for the action object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="assignment">
+ <xs:annotation>
+ <xs:documentation>Controls the behavior of assigning a task to an identity.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The content of the assignment element can be used as configuration information for your custom assignment handler implementations. This allows the creation of reusable delegation classes.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The fully qualified class name of an implementation of org.jbpm.taskmgmt.def.AssignmentHandler.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the assignment handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="expression" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="cancel-timer">
+ <xs:annotation>
+ <xs:documentation>Cancels a timer previously set with create-timer</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the timer to be cancelled.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="create-timer">
+ <xs:annotation>
+ <xs:documentation>See documentation for the timer element.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the timer. This name can be used later in a cancel-timer element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="decision">
+ <xs:annotation>
+ <xs:documentation>Defines a decision to be made in the processing path</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>Either a handler or transitions with conditions should be specified. The decision will look for the first transition for which the condition evaluates to true. A transition without a condition is considered to evaluate to true (to model the 'otherwise' branch. See the condition element.</xs:documentation>
+ </xs:annotation>
+ <xs:element name="handler" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The content of the handler element can be used as configuration information for your custom decision handler implementations. This allows the creation of reusable delegation classes.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The fully qualified class name of an implementation of org.jbpm.graph.node.DecisionHandler.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the decision handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="condition" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>A beanshell script that evaluates to true or false.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="script" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="create-timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="cancel-timer" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the transition. Note that each transition leaving a node must have a distinct name.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="to" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The hierarchical name of the destination node. See documentation for an description of hierarchical names.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="end-state">
+ <xs:annotation>
+ <xs:documentation>Marks the end of a processing path.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Event types supported: node-enter, before-signal</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="before-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="event">
+ <xs:annotation>
+ <xs:documentation>Supported event types: node-enter, node-leave, before-signal, after-signal.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="exception-handler">
+ <xs:annotation>
+ <xs:documentation>A list of exception handlers that applies to all exceptions thrown by delegation classes within this node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies the fully qualified class name of the java throwable class that should match this exception handler. If this attribute is not specified it matches all exceptions derived from java.lang.Throwable.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="fork">
+ <xs:annotation>
+ <xs:documentation>Defines a point in the processing path where multiple execution paths will run in parallel.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="script" minOccurs="0"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="join">
+ <xs:annotation>
+ <xs:documentation>Defines a point in the processing path where multiple execution paths merge into one path.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="node">
+ <xs:annotation>
+ <xs:documentation>A generic node allowing custom behavior.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>A custom action that represents the behaviour for this node</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="process-state">
+ <xs:annotation>
+ <xs:documentation>A node that allows execution of another subordinate process.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the subordinate process definition to be executed within the enclosing process.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="version" type="xs:integer" use="optional">
+ <xs:annotation>
+ <xs:documentation>The version of the deployed process-definition that is to be executed. If none is specified the latest version of the identified process will be used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supported event types: node-enter, node-leave, before-signal, after-signal, subprocess-created, subprocess-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="script">
+ <xs:annotation>
+ <xs:documentation>A beanshell script to execute. The script can be the content of this tag or you can specify one or more variables and a beanshell script in the expression tag.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence minOccurs="0">
+ <xs:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="expression">
+ <xs:annotation>
+ <xs:documentation>The beanshell script.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the script action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="accept-propagated-events" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>If set to false the action will only be executed on events that were fired in this action's element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="state">
+ <xs:annotation>
+ <xs:documentation>Represents a wait state in a process.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>A custom action that represents the behaviour for this node</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="super-state">
+ <xs:annotation>
+ <xs:documentation>Grouping mechanism for a named set of nodes.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The nodes of the process definition. Note that a process without nodes is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="node"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports all event types except the process-start and end events.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="transition"/>
+ <xs:enumeration value="timer"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="swimlane">
+ <xs:annotation>
+ <xs:documentation>Groups tasks assigned to the same resource.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="assignment" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="task">
+ <xs:annotation>
+ <xs:documentation>The tasks that should be created when execution arrives in this task node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="assignment" minOccurs="0"/>
+ <xs:element name="controller" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Controller supports the inclusion of one or more "variable" tags as children. It also supports custom XML for use with a custom controller class as indicated by config-type.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>This section can include "variable" elements to identify input and output variables involved in this task.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="optional"/>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the assignment handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports events: task-create, task-assign, task-start, task-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timer" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Specifies a timer that monitors the duration of an execution in this task.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name for this timer. Every timer should have a unique name. If a name is not specified then the name of the enclosing node is taken.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>A transition name to be taken after the timer executes, the timer event is fired and execution of any specified actions has completed.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="cancel-event" type="xs:string" use="optional" default="task-end">
+ <xs:annotation>
+ <xs:documentation>task-assign, task-start, task-end, or any combination of these specified as a comma separated list.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Named tasks can be referenced and looked up via the TaskMgmtDefinition.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="blocking" type="booleanType" use="optional" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" use="optional" default="true"/>
+ <xs:attribute name="description" type="xs:string" use="optional"/>
+ <xs:attribute name="duedate" type="duedateType" use="optional">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="swimlane" type="xs:string" use="optional"/>
+ <xs:attribute name="priority" use="optional" default="normal">
+ <xs:annotation>
+ <xs:documentation>This value can also be any integer where the lower the number the higher the priority.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="task-node">
+ <xs:annotation>
+ <xs:documentation>A node which accepts a list of tasks to be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="task" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="signal" use="optional" default="last">
+ <xs:annotation>
+ <xs:documentation>Signal specifies the effect of task completion on the process execution continuation.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="create-tasks" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>Can be set to false when a runtime calculation has to determine which of the tasks have to be created. In that case, add an action on node-enter, create the tasks in the action, and set create-tasks to false.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="end-tasks" type="booleanType" use="optional" default="false">
+ <xs:annotation>
+ <xs:documentation>Can be set to true, in which all the tasks that are still open are ended on the node-leave event.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timer">
+ <xs:annotation>
+ <xs:documentation>Specifies a timer that monitors the duration of an execution in this node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name for this timer. Every timer should have a unique name. If a name is not specified then the name of the enclosing node is taken.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>A transition name to be taken after the timer executes, the timer event is fired and execution of any specified actions has completed.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="transition">
+ <xs:annotation>
+ <xs:documentation>The leaving transitions. Each transition leaving a node must have a distinct name. At most one transition can have no name. The first transition specified is the default transition: the path taken when the node is left without specifying a transition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the transition. Note that each transition leaving a node must have a distinct name.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="to" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The hierarchical name of the destination node. See documentation for an description of hierarchical names.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="variable">
+ <xs:annotation>
+ <xs:documentation>Input and Output variables for the node. Input variables are specified by access "read". If you have assigned variables during the script evaluation, the variables with "write" access allows you to store the values in the process instance. It does not matter whether the variables existed prior to this action.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>User defined metadata.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="accessType" use="optional" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Defaults to the process variable name as given by the name attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="process-definition-v3.0">
+ <xs:annotation>
+ <xs:documentation>Version 3.0 of the PDL schema</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element ref="swimlane" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="start-state" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The start state of the process. Note that a process without a start-state is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="task" minOccurs="0"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="after-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional"/>
+ <xs:attribute name="swimlane" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The nodes of the process definition. Note that a process without nodes is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="node"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Globally defined actions that can be referenced from events and transitions. </xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="task" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports all event types. Uniquely supports process-start and process-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="transition"/>
+ <xs:enumeration value="timer"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>the name of the process</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema>
Added: jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,456 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns= "urn:jbpm.org:jpdl-3.1"
+ targetNamespace="urn:jbpm.org:jpdl-3.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <!-- PROCESS-DEFINITION -->
+ <!-- ################## -->
+ <xs:element name="process-definition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="swimlane" />
+ <xs:element ref="start-state" />
+ <xs:group ref="node-elements"/>
+ <xs:group ref="action-elements" />
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="task" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- SWIMLANE -->
+ <!-- ######## -->
+ <xs:element name="swimlane">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element ref="assignment"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- NODES -->
+ <!-- ##### -->
+ <xs:element name="start-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task"/>
+ <xs:element ref="transition"/>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="end-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="decision">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="handler" type="delegation" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="condition">
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="expression" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="fork">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="script" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="join">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="process-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ <xs:attribute name="version" type="xs:integer" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="super-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-elements"/>
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="task-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="create-tasks" type="booleanType" default="true" />
+ <xs:attribute name="end-tasks" type="booleanType" default="false" />
+ <xs:attribute name="signal" default="last">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TRANSITION -->
+ <!-- ########## -->
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler" />
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- ACTIONS -->
+ <!-- ####### -->
+ <xs:element name="action">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="ref-name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="cancel-timer">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="create-timer">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="script">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EVENT -->
+ <!-- ##### -->
+ <xs:element name="event">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="timer-create"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EXCEPTION-HANDLER -->
+ <!-- ################# -->
+ <xs:element name="exception-handler">
+ <xs:complexType>
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TASK -->
+ <!-- #### -->
+ <xs:element name="task">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="assignment"/>
+ <xs:element ref="controller"/>
+ <xs:element ref="event"/>
+ <xs:element ref="timer"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="blocking" type="booleanType" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" default="true"/>
+ <xs:attribute name="description" type="xs:string" />
+ <xs:attribute name="duedate" type="xs:string" />
+ <xs:attribute name="swimlane" type="xs:string" />
+ <xs:attribute name="priority" type="priorityType" default="normal" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="controller" type="delegation" />
+
+ <xs:element name="assignment">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="delegation">
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="actor-id" type="xs:string" />
+ <xs:attribute name="pooled-actors" type="xs:string" />
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TIMER -->
+ <!-- ##### -->
+ <xs:element name="timer">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="variable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="xs:string" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TYPES AND GROUPS -->
+ <!-- ################ -->
+ <xs:complexType name="delegation" mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+
+ <xs:simpleType name="configType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="booleanType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="priorityType">
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:group name="node-elements">
+ <xs:choice>
+ <xs:element ref="node"/>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="action-elements">
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="node-content-elements">
+ <xs:choice>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="timer"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ </xs:group>
+
+</xs:schema>
Added: jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
===================================================================
--- jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,499 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns= "urn:jbpm.org:jpdl-3.2"
+ targetNamespace="urn:jbpm.org:jpdl-3.2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <!-- PROCESS-DEFINITION -->
+ <!-- ################## -->
+ <xs:element name="process-definition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="swimlane" />
+ <xs:element ref="start-state" />
+ <xs:group ref="node-elements"/>
+ <xs:group ref="action-elements" />
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="task" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- SWIMLANE -->
+ <!-- ######## -->
+ <xs:element name="swimlane">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element ref="assignment"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- NODES -->
+ <!-- ##### -->
+ <xs:element name="start-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="task"/>
+ <xs:element ref="transition"/>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="end-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="end-complete-process" type="booleanType" use="optional" default="false"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="decision">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element name="handler" type="delegation" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="fork">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="script" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="join">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="process-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"
+ use="required" />
+ <xs:attribute name="version" type="xs:integer" />
+ <xs:attribute name="binding" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="binding" type="bindingType"></xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="super-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-elements"/>
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="task-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="create-tasks" type="booleanType" default="true" />
+ <xs:attribute name="end-tasks" type="booleanType" default="false" />
+ <xs:attribute name="signal" default="last">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="mail-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="subject" />
+ <xs:element ref="text" />
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="template" type="xs:string"/>
+ <xs:attribute name="actors" type="xs:string"/>
+ <xs:attribute name="to" type="xs:string"/>
+ <xs:attribute name="subject" type="xs:string"/>
+ <xs:attribute name="text" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+
+ <!-- TRANSITION -->
+ <!-- ########## -->
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element name="condition">
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="expression" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler" />
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- ACTIONS -->
+ <!-- ####### -->
+ <xs:element name="action">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="ref-name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="cancel-timer">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="create-timer">
+ <xs:complexType>
+ <xs:choice minOccurs="0">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="script">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="mail">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="subject" />
+ <xs:element ref="text" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="template" type="xs:string"/>
+ <xs:attribute name="actors" type="xs:string"/>
+ <xs:attribute name="to" type="xs:string"/>
+ <xs:attribute name="subject" type="xs:string"/>
+ <xs:attribute name="text" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EVENT -->
+ <!-- ##### -->
+ <xs:element name="event">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="timer-create"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EXCEPTION-HANDLER -->
+ <!-- ################# -->
+ <xs:element name="exception-handler">
+ <xs:complexType>
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TASK -->
+ <!-- #### -->
+ <xs:element name="task">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="assignment"/>
+ <xs:element ref="controller"/>
+ <xs:element ref="event"/>
+ <xs:element ref="timer"/>
+ <xs:element name="reminder">
+ <xs:complexType>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="repeat" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="blocking" type="booleanType" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" default="true"/>
+ <xs:attribute name="description" type="xs:string" />
+ <xs:attribute name="duedate" type="xs:string" />
+ <xs:attribute name="swimlane" type="xs:string" />
+ <xs:attribute name="priority" type="priorityType" default="normal" />
+ <xs:attribute name="notify" type="booleanType" default="false"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="controller" type="delegation" />
+
+ <xs:element name="assignment">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="delegation">
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="actor-id" type="xs:string" />
+ <xs:attribute name="pooled-actors" type="xs:string" />
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TIMER -->
+ <!-- ##### -->
+ <xs:element name="timer">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="variable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="xs:string" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- MAIL -->
+ <!-- #### -->
+ <xs:element name="to" type="xs:string"/>
+ <xs:element name="recipients" type="xs:string"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="text" type="xs:string"/>
+ <xs:element name="template" type="xs:string"/>
+
+ <!-- TYPES AND GROUPS -->
+ <!-- ################ -->
+
+ <xs:element name="description" type="xs:string" />
+
+ <xs:complexType name="delegation" mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field" type="xs:string" />
+ </xs:complexType>
+
+ <xs:simpleType name="configType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="booleanType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="priorityType">
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:group name="node-elements">
+ <xs:choice>
+ <xs:element ref="node"/>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ <xs:element ref="mail-node"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="action-elements">
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ <xs:element ref="mail"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="node-content-elements">
+ <xs:choice>
+ <xs:element ref="description" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="timer"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="bindingType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="late"></xs:enumeration>
+ <xs:enumeration value="early"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: jbpm4/trunk/modules/migration/src/main/xsd/jpdl-4.0.xsd
===================================================================
--- jbpm4/trunk/modules/migration/src/main/xsd/jpdl-4.0.xsd (rev 0)
+++ jbpm4/trunk/modules/migration/src/main/xsd/jpdl-4.0.xsd 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,1147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://jbpm.org/4.0/jpdl"
+ xmlns:tns="http://jbpm.org/4.0/jpdl"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
+
+ <annotation>
+ <documentation>Schema for jPDL 4 process descriptions;
+ element process is the top level element.
+
+ TODO: Add activity pluggability. (add the proper any's and
+ anyAttributes)
+
+ TODO: Pull up expression. The expression element in the
+ delegation group can be pulled up as an expression
+ attribute in each use case of the delegationGroup
+
+ TODO: Investigate if object-refs to centrally defined objects would
+ add value over inline defined objects.
+ </documentation>
+ </annotation>
+
+ <!-- ### PROCESS DEFINITION ############################################# -->
+
+ <element name="process">
+ <annotation><documentation>A jPDL process definition description; This
+ is the top level element in a jPDL process file.</documentation></annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <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" />
+ </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>
+ </annotation>
+ </attribute>
+ <attribute name="key" type="string">
+ <annotation>
+ <documentation>
+ The key can be used to provide a short acronym that will replace the name as the basis for the generated
+ process definition id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="version" type="int">
+ <annotation>
+ <documentation>
+ Indicates the sequence number of this version for all processes with the same name. By specifying a version
+ automatic deployment can figure out if this process is already deployed or not.
+ </documentation>
+ </annotation>
+ </attribute>
+ <anyAttribute processContents="skip">
+ <annotation><documentation>for extensibility
+ </documentation></annotation>
+ </anyAttribute>
+ </complexType>
+ </element>
+
+ <!-- ### ACTIVITIES ##################################################### -->
+
+ <group name="activityGroup">
+ <choice>
+ <!-- ~~~ START ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="start">
+ <annotation><documentation>Start event
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="end">
+ <annotation><documentation>End event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <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"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="state" default="ended" type="string">
+ <annotation><documentation>sets the state of the execution explicitely</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="end-cancel">
+ <annotation><documentation>End cancel event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <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"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="end-error">
+ <annotation><documentation>End cancel event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <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"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ 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>
+ <complexType>
+ <sequence>
+ <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>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ 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>
+ <complexType>
+ <sequence>
+ <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>
+ <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>
+ <!-- TODO add conditions -->
+ </element>
+ </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>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Identification of the scripting language
+ to use for the expr attribute.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ FORK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="fork">
+ <annotation><documentation>Spawns multiple concurrent paths of
+ execution.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ JOIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="join">
+ <annotation><documentation>Spawns multiple concurrent paths of
+ execution.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="multiplicity" type="int" />
+ <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"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ SCRIPT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="script">
+ <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>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ HQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="hql">
+ <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>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ SQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="sql">
+ <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>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ 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>
+ <complexType>
+ <complexContent>
+ <extension base="tns:javaType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ TASK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="task">
+ <annotation><documentation>Creates a task in the task component.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <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>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attributeGroup ref="tns:assignmentAttributes"/>
+ <attribute name="swimlane" type="string" />
+ <attribute name="on-transition" default="cancel">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="keep"/>
+ <enumeration value="cancel"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="completion" type="string" default="complete" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ 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>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <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>
+ </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>
+ </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>
+ </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>
+ </attribute>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ group ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!--
+ <element name="group">
+ <annotation><documentation>Scope enclosing a number of activities.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <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"/>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+ -->
+ </choice>
+ </group>
+
+ <group name="wireObjectGroup">
+ <choice>
+ <!-- SPECIAL OBJECTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="null">
+ <annotation><documentation>the null value
+ </documentation></annotation>
+ </element>
+ <element name="ref">
+ <annotation><documentation>A 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>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="env-ref">
+ <annotation><documentation>The current environment.
+ </documentation></annotation>
+ </element>
+ <element name="jndi">
+ <annotation><documentation>A lookup from JNDI through the InitialContext
+ </documentation></annotation>
+ <complexType>
+ <attribute name="jndi-name" type="string" use="required" />
+ </complexType>
+ </element>
+
+ <!-- COLLECTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="list">
+ <annotation><documentation>A java.util.List</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <attribute name="class" type="string" default="java.util.ArrayList">
+ <annotation><documentation>Implementation class for this list.
+ </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>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="map">
+ <annotation><documentation>A java.util.Map</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="entry">
+ <complexType>
+ <choice minOccurs="0">
+ <element name="key" minOccurs="0">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ <element name="value" minOccurs="0">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ </choice>
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="class" type="string" default="java.util.HashMap">
+ <annotation><documentation>Implementation class for this map.
+ </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>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="set">
+ <annotation><documentation>A java.util.Set
+ </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>
+ </attribute>
+ <attribute name="class" type="string" default="java.util.HashList">
+ <annotation><documentation>Implementation class for this set.
+ </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>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="properties">
+ <annotation><documentation>A java.util.Properties</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="property">
+ <complexType>
+ <attribute name="name" type="string" use="required" />
+ <attribute name="value" type="string" use="required" />
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="file" type="string">
+ <annotation><documentation>A file on the file system</documentation></annotation>
+ </attribute>
+ <attribute name="resource" type="string">
+ <annotation><documentation>A file as a resource in the classpath</documentation></annotation>
+ </attribute>
+ <attribute name="url" type="string">
+ <annotation><documentation>the contents is fetched by loading a url</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>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- OBJECT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="object" type="tns:wireObjectType" />
+
+ <!-- BASIC TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="string">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="value">
+ <annotation><documentation>the actual string value</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="byte">
+ <annotation><documentation>A java.lang.Byte</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>
+ </attribute>
+ <attribute name="value" type="byte" use="required" />
+ </complexType>
+ </element>
+ <element name="char">
+ <annotation><documentation>A java.lang.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>
+ </attribute>
+ <attribute name="value" use="required">
+ <simpleType>
+ <restriction base="string">
+ <maxLength value="1" />
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="double">
+ <annotation><documentation>A java.lang.Double</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>
+ </attribute>
+ <attribute name="value" type="double" use="required" />
+ </complexType>
+ </element>
+ <element name="false">
+ <annotation><documentation>java.lang.Boolean.FALSE
+ </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>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="float">
+ <annotation><documentation>A java.lang.Float
+ </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>
+ </attribute>
+ <attribute name="value" type="float" use="required" />
+ </complexType>
+ </element>
+ <element name="int">
+ <annotation><documentation>A java.lang.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>
+ </attribute>
+ <attribute name="value" type="int" use="required"/>
+ </complexType>
+ </element>
+ <element name="long">
+ <annotation><documentation>A java.lang.Long</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>
+ </attribute>
+ <attribute name="value" type="long" use="required"/>
+ </complexType>
+ </element>
+ <element name="short">
+ <annotation><documentation>a java.lang.Short
+ </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>
+ </attribute>
+ <attribute name="value" type="short" use="required"/>
+ </complexType>
+ </element>
+ <element name="true">
+ <annotation><documentation>java.lang.Boolean.TRUE
+ </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>
+ </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>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="factory">
+ <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>
+ <complexType>
+ <choice maxOccurs="unbounded">
+ <element name="arg" type="tns:argType" />
+ </choice>
+ </complexType>
+ </element>
+ <element name="arg" type="tns:argType">
+ <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>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The 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>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The name of the property (without the 'set' prefix)</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="invoke">
+ <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>
+ </attribute>
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="class" type="string">
+ <annotation><documentation>The fully qualified class name</documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The class to instantiate.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>The class to instantiate.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="factory" type="string">
+ <annotation><documentation>The name of the factory object</documentation></annotation>
+ </attribute>
+ <attribute name="method" type="string">
+ <annotation><documentation>The 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>
+ </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>
+ <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>
+ </attribute>
+ </complexType>
+
+ <complexType name="javaType">
+ <sequence>
+ <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>
+ </sequence>
+ <attribute name="object" type="string">
+ <annotation><documentation>Name of the object in the environment
+ </documentation></annotation>
+ </attribute>
+ <attribute name="method" type="string" use="required">
+ <annotation><documentation>The name of the method to invoke.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <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>
+ </attribute>
+ <attribute name="lang" type="string">
+ <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>
+ </attribute>
+ </complexType>
+
+ <complexType name="scriptType">
+ <sequence>
+ <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>
+ </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>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Identification of the scripting language
+ to 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>
+ </attribute>
+ </complexType>
+
+ <complexType name="qlType">
+ <sequence>
+ <element name="query" type="string">
+ <annotation><documentation>The query text.</documentation></annotation>
+ </element>
+ <element name="parameters" minOccurs="0">
+ <annotation><documentation>Query parameters.</documentation></annotation>
+ <complexType>
+ <sequence>
+ <group ref="tns:wireObjectGroup" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+ </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>
+ </attribute>
+ <attribute name="unique" type="string">
+ <annotation><documentation>Does this query return a unique result or a list
+ </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>
+ </attribute>
+ <attribute name="g" type="string">
+ <annotation><documentation>Graphical information used by process designer tool.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="async">
+ <annotation><documentation>Graphical information used by process designer tool.
+ </documentation></annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="true" />
+ <enumeration value="exclusive" />
+ </restriction>
+ </simpleType>
+ </attribute>
+ </attributeGroup>
+
+ <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>
+ <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>
+ </attribute>
+ <attribute name="assignee-lang" type="string">
+ <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>
+ </attribute>
+ <attribute name="candidate-users-lang" type="string">
+ <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>
+ </attribute>
+ <attribute name="candidate-groups-lang" type="string">
+ <annotation><documentation>Expression language for the
+ candidate-groups attribute.</documentation></annotation>
+ </attribute>
+ </attributeGroup>
+
+ <element name="swimlane">
+ <annotation><documentation>A process role.</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required" />
+ <attributeGroup ref="tns:assignmentAttributes" />
+ </complexType>
+ </element>
+
+ <complexType name="transitionType">
+ <annotation><documentation>The outgoing transitions. The first in the list
+ will be the default outgoing transition.
+ </documentation></annotation>
+ <sequence>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="string">
+ <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>
+ </attribute>
+ <attribute name="g" type="string">
+ <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>
+ </element>
+
+ <element name="on">
+ <complexType>
+ <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>
+ </group>
+ </sequence>
+ <attribute name="event" type="string">
+ <annotation><documentation>The event identification. start, end, take or
+ any other custom event.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <complexType name="parameterType">
+ <attribute name="subvar" type="string">
+ <annotation><documentation>The 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>
+ </attribute>
+ <attribute name="lang" type="string">
+ <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>
+ </attribute>
+ </complexType>
+
+
+ <element name="timer">
+ <complexType>
+ <sequence>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>A list of event listeners that will
+ be notified when the timer fires</documentation></annotation>
+ </group>
+ </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>
+ </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>
+ </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>
+ </attribute>
+ </complexType>
+ </element>
+
+ <group name="eventListenerGroup">
+ <choice>
+ <element name="event-listener" type="tns:wireObjectType" />
+ <element name="hql" type="tns:qlType" />
+ <element name="sql" type="tns:qlType" />
+ <element name="java" type="tns:javaType" />
+ <element name="script" type="tns:scriptType" />
+ </choice>
+ </group>
+
+ <complexType name="emailType">
+ <sequence>
+ <element name="property">
+ <annotation><documentation>Template property value</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string" />
+ <attribute name="value" type="string" />
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="to" type="string" />
+ <attribute name="type" type="string">
+ <annotation><documentation>Reference to the email template</documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <complexType name="taskType" >
+ <!--
+ <sequence>
+ <element name="reminder">
+ <complexType>
+ <attribute name="duedate" type="string" use="required" />
+ <attribute name="repeat" type="string" />
+ </complexType>
+ </element>
+ </sequence>
+ -->
+ <attributeGroup ref="tns:assignmentAttributes" />
+ <attribute name="form" type="string">
+ </attribute>
+ <attribute name="swimlane" type="string">
+ </attribute>
+ <attribute name="description" type="string" />
+ <attribute name="duedate" type="string" />
+ <attribute name="notify" type="boolean" default="false"/>
+ <!--
+ <attribute name="subtasksync">
+ <simpleType>
+ <union>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="last">
+ <annotation><documentation>When the last subtask completes,
+ this task is completed.</documentation></annotation>
+ </enumeration>
+ <enumeration value="first">
+ <annotation><documentation>When the first subtask completes,
+ this task is completed.</documentation></annotation>
+ </enumeration>
+ </restriction>
+ </simpleType>
+ <simpleType>
+ <restriction base="int">
+ <annotation><documentation>The number of subtasks that
+ have to complete before this task is considered
+ completed.</documentation></annotation>
+ </restriction>
+ </simpleType>
+ </union>
+ </simpleType>
+ </attribute>
+ -->
+ </complexType>
+
+ <simpleType name="booleanValueType">
+ <restriction base="string">
+ <enumeration value="true" />
+ <enumeration value="on" />
+ <enumeration value="enabled" />
+ <enumeration value="false" />
+ <enumeration value="off" />
+ <enumeration value="disabled" />
+ </restriction>
+ </simpleType>
+
+</schema>
Added: jbpm4/trunk/modules/migration/src/test/java/com/test/Logger.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/com/test/Logger.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/com/test/Logger.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package com.test;
+
+
+/**
+ * Dummy Action Handler
+ * @author Joram Barrez
+ */
+public class Logger {
+
+}
Added: jbpm4/trunk/modules/migration/src/test/java/com/test/MessageActionHandler.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/com/test/MessageActionHandler.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/com/test/MessageActionHandler.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package com.test;
+
+
+/**
+ * Dummy Action Handler
+ * @author Joram Barrez
+ */
+public class MessageActionHandler {
+
+}
Added: jbpm4/trunk/modules/migration/src/test/java/com/test/NodeEnterAction.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/com/test/NodeEnterAction.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/com/test/NodeEnterAction.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package com.test;
+
+
+/**
+ * Dummy Action Handler
+ * @author Joram Barrez
+ */
+public class NodeEnterAction {
+
+}
Added: jbpm4/trunk/modules/migration/src/test/java/com/test/RulesAssignmentHandler.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/com/test/RulesAssignmentHandler.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/com/test/RulesAssignmentHandler.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package com.test;
+
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.api.task.Assignable;
+import org.jbpm.api.task.AssignmentHandler;
+
+
+/**
+ * Dummy Assignment Handler
+ * @author Joram Barrez
+ */
+public class RulesAssignmentHandler implements AssignmentHandler {
+
+ public void assign(Assignable assignable, OpenExecution execution) throws Exception {
+
+ }
+
+}
Added: jbpm4/trunk/modules/migration/src/test/java/com/test/TaskCreateAction.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/com/test/TaskCreateAction.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/com/test/TaskCreateAction.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package com.test;
+
+
+/**
+ * Dummy Action Handler
+ * @author Joram Barrez
+ */
+public class TaskCreateAction {
+
+}
Added: jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.jbpm.api.Problem;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
+import org.jbpm.pvm.internal.env.EnvironmentFactory;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.xml.sax.InputSource;
+
+/**
+ * Test the jpdl3Converter
+ *
+ */
+public class Jpdl3ConverterReaderTest {
+ @Test
+ public void testSimpleProcesss() throws Exception {
+ testConvert("simple.xml");
+ }
+
+ @Ignore
+ public void testBusinessTrip() throws Exception {
+ testConvert("businesstrip.xml");
+ }
+
+ @Test
+ public void testAssignment() throws Exception {
+ testConvert("assignment.xml");
+ }
+
+ @Test
+ public void testEvent() throws Exception {
+ setUpScriptManager();
+ testConvert("process-event.xml");
+ }
+
+ @Test
+ public void testDescision() throws Exception {
+ testConvert("testDecision.xml");
+ }
+
+ @Test
+ public void testProcessState() throws Exception {
+ testConvert("process-state.xml");
+ }
+
+ @Test
+ public void testScript() throws Exception {
+ setUpScriptManager();
+ testConvert("script.xml");
+ }
+
+ @Test
+ // Unsupported exception handler conversion test
+ public void testExceptionHandler() throws Exception {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("exception-handler.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3Converter converter = new Jpdl3Converter(ins);
+ Document doc = converter.readAndConvert();
+ Assert.assertEquals(converter.problems.size(), 2);
+ Assert.assertTrue(converter.problems.get(0).toString().indexOf("[WARNING] Unsupported exception handler conversion for element") > -1);
+ Assert.assertTrue(converter.problems.get(1).toString().indexOf("[WARNING] Unsupported exception handler conversion for element") > -1);
+ }
+
+ @Test
+ //Unsupported super-sate and mail node conversion
+ public void testSuperStateAndMailNode() {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("superstate-mail.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3Converter converter = new Jpdl3Converter(ins);
+ try {
+ Document doc = converter.readAndConvert();
+ Assert.fail("The unsupported exception does not throw");
+ } catch (java.lang.Throwable e) {
+ }
+ }
+
+ @Test
+ public void testTransitionResolved() {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("test-transition-resolve.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3Converter converter = new Jpdl3Converter(ins);
+ Document doc = converter.readAndConvert();
+ Assert.assertEquals(converter.problems.size(), 2);
+ for (org.jbpm.jpdl.internal.convert.problem.Problem pb : converter.problems) {
+ System.out.println(pb);
+ }
+ Assert.assertTrue(converter.problems.get(0).toString().startsWith(
+ "[WARNING] transition to='first2'"));
+ Assert.assertTrue(converter.problems.get(1).toString().startsWith(
+ "[WARNING] transition to='end2'"));
+
+ }
+
+ @Test
+ public void testTimer() throws Exception {
+ String xml = convert("timer.xml");
+ List<Problem> problems = new JpdlParser().createParse().setString(xml)
+ .execute().getProblems();
+ Assert.assertEquals(2, problems.size());
+ Assert.assertTrue(problems.get(0).getMsg().startsWith(
+ "unrecognized event listener"));
+ Assert.assertTrue(problems.get(1).getMsg().startsWith(
+ "unrecognized event listener"));
+ }
+
+ private void testConvert(String resourcefile) throws Exception {
+ String xml = convert(resourcefile);
+ List<Problem> problems = new JpdlParser().createParse().setString(xml).execute().getProblems();
+ Assert.assertEquals(problems.toString(), 0, problems.size());
+ }
+
+ private String convert(String resouceFile) throws Exception {
+ InputStream inputStream = getClass().getClassLoader().getResourceAsStream(resouceFile);
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3Converter converter = new Jpdl3Converter(ins);
+ Document doc = converter.readAndConvert();
+ //System.out.println(doc.asXML());
+ return doc.asXML();
+ }
+
+ private void setUpScriptManager() throws Exception {
+ EnvironmentFactory environmentFactory = JbpmConfiguration
+ .parseXmlString("<jbpm-configuration>"
+ + " <process-engine-context>"
+ + " <script-manager default-expression-language='juel'"
+ + " default-script-language='juel'"
+ + " read-contexts='execution, environment, process-engine' "
+ + " write-context='execution'>"
+ + " <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />"
+ + " </script-manager>"
+ + " </process-engine-context> </jbpm-configuration>");
+
+ environmentFactory.openEnvironment();
+ }
+}
Added: jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterToolTest.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterToolTest.java (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterToolTest.java 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.convert;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Test the command line parser and validation
+ *
+ */
+public class JpdlConverterToolTest {
+
+ JpdlConverterTool tool = new JpdlConverterTool();
+ java.io.ByteArrayOutputStream bout = null;
+ PrintStream oldOut = null;
+
+ java.io.ByteArrayOutputStream errorOut = null;
+ PrintStream oldError = null;
+
+ @Before
+ public void replaceSystemOut() {
+ oldOut = System.out;
+ bout = new java.io.ByteArrayOutputStream();
+ System.setOut(new java.io.PrintStream(bout));
+
+ oldError = System.err;
+ errorOut = new java.io.ByteArrayOutputStream();
+ System.setErr(new java.io.PrintStream(errorOut));
+ }
+
+ @After
+ public void restoreSystemOut() {
+ System.setErr(oldError);
+ System.setOut(oldOut);
+ }
+
+ @Test
+ public void wrongArgs1() {
+ String args[] = {"-v","-t"};
+ try {
+ tool.parseParam(args);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //do nothing
+ }
+ }
+ @Test
+ public void wrongArgs2() {
+
+ String args2[] = {"-v","-o"};
+ try {
+ tool.parseParam(args2);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //do nothing
+ }
+
+ }
+ @Test
+ public void wrongArgs3() {
+ String args3[] = {"-v","-o", "tmp.xml"};
+ try {
+ tool.parseParam(args3);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //do nothing
+ }
+ }
+
+ @Test
+ public void wrongArgs4() {
+ String args4[] = {"-o", "tmp.xml", "process.xml", "myprocess.xml"};
+ try {
+ tool.parseParam(args4);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //do nothing
+ }
+
+ }
+
+
+ @Test
+ public void rightArgs() throws Exception {
+ String args4[] = {"-o", "tmp.xml", "process.xml"};
+ tool.parseParam(args4);
+ String args5[] = {"process.xml"};
+ tool.parseParam(args5);
+ String args6[] = {"-v","process.xml"};
+ tool.parseParam(args6);
+ String args7[] = {"-o","process.xml", "processed.xml"};
+ tool.parseParam(args7);
+ }
+
+
+ @Test
+ public void validateArgs1() throws Exception {
+ ConverterContext context = new ConverterContext();
+ context.put(ConverterContext.PROCESS_FILE, "test.xml");
+ try {
+ tool.validate(context);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //
+ }
+ }
+
+ @Test
+ public void validateArgs2() throws Exception {
+ String fileName = getResource("simple.xml");
+ ConverterContext context = new ConverterContext();
+ context.put(ConverterContext.PROCESS_FILE, fileName);
+ context.put(ConverterContext.OUPUTFILE, "/mytest/histest");
+ try {
+ tool.validate(context);
+ Assert.fail("No Illegal command exception thrown");
+ } catch (Exception e) {
+ //
+ }
+ }
+
+ @Ignore
+ //Test convert the process file under current directory
+ //it will generate a tmp file under migration dir.
+ //Enable this test until we find how to set the current directory
+ public void runConcretProcess() throws Exception {
+ String fileName = getResource("simple.xml");
+ String args[] = new String[]{"-v",fileName};
+ JpdlConverterTool.main(args);
+ URL url = new URL(fileName);
+ File tmpFile = new File(url.getFile());
+ File destFile = new File(tmpFile.getParentFile(), "simple.converted.jpdl.xml");
+ Assert.assertTrue(destFile.exists());
+ }
+
+ @Test
+ public void runConcretProcess2() throws Exception {
+ String fileName = getResource("simple.xml");
+ URL url = new URL(fileName);
+ File tmpFile = new File(url.getFile());
+ File outputfile = new File(tmpFile.getParentFile(), "tmp-output.xml");
+
+ String args[] = new String[]{"-v","-o", outputfile.getAbsolutePath(),fileName};
+ JpdlConverterTool.main(args);
+
+ Assert.assertTrue(outputfile.exists());
+ Assert.assertTrue(outputfile.length() > 0);
+ }
+
+ @Test
+ public void testErrorMessage() throws Exception {
+ String fileName = getResource("invalid.xml");
+ String args[] = new String[]{fileName};
+ JpdlConverterTool.main(args);
+ String str = new String(errorOut.toByteArray());
+ Assert.assertTrue(str.indexOf("[ERROR] cvc-complex-type.2.4.a:") > -1);
+ }
+
+
+ public String getResource(String file) throws Exception {
+ URL url = getClass().getClassLoader().getResource(file);
+ return url.toString();
+ }
+}
Added: jbpm4/trunk/modules/migration/src/test/resources/assignment.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/assignment.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/assignment.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2" name="RulesAssignment">
+ <start-state name="start">
+ <transition name="" to="Approve Order Node"></transition>
+ </start-state>
+ <end-state name="end1"></end-state>
+ <task-node name="Approve Order Node">
+ <task name="ApproveOrder1">
+ <assignment class="com.test.RulesAssignmentHandler" >
+ <group>reviewers</group>
+ <objectNames>
+ <element>order</element>
+ </objectNames>
+ <ruleFile>/assignment/Assignment.drl</ruleFile>
+ </assignment>
+ </task>
+
+ <task name="ApproveOrder2">
+ <assignment class="com.test.RulesAssignmentHandler" >
+ <group>reviewers</group>
+ <objectNames>
+ <element>order</element>
+ </objectNames>
+ <ruleFile>/assignment/Assignment.drl</ruleFile>
+ </assignment>
+ </task>
+
+ <transition name="" to="end1"></transition>
+ </task-node>
+</process-definition>
Added: jbpm4/trunk/modules/migration/src/test/resources/businesstrip.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/businesstrip.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/businesstrip.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition name="business trip request"
+ xmlns="urn:jbpm.org:jpdl-3.2">
+
+ <swimlane name="employee" />
+ <swimlane name="manager">
+ <assignment actor-id="manager" />
+ </swimlane>
+ <swimlane name="hr">
+ <assignment actor-id="hr" />
+ </swimlane>
+ <swimlane name="accountant">
+ <assignment actor-id="accountant" />
+ </swimlane>
+
+ <start-state name="submit business trip request">
+ <task swimlane="employee" />
+ <transition name="submit request" to="manager evaluation" />
+ </start-state>
+
+ <task-node name="manager evaluation">
+ <task swimlane="manager" />
+ <transition to="end" name="reject" />
+ <transition to="preparations" name="approve" />
+ </task-node>
+
+ <fork name="preparations">
+ <transition to="erp update" name="erp update"></transition>
+ <transition to="ticket purchase" name="book ticket"></transition>
+ </fork>
+
+ <node name="erp update">
+ <action
+ class="org.jbpm.examples.businesstrip.action.UpdateErpAction">
+ </action>
+ <transition to="join"></transition>
+ </node>
+
+ <node name="query travel agent db">
+ <action
+ class="org.jbpm.examples.businesstrip.action.QueryTravelAgentDbAction">
+ </action>
+ <transition to="join"></transition>
+ </node>
+
+ <task-node name="ticket purchase">
+ <task swimlane="accountant" />
+ <transition to="query travel agent db"></transition>
+ </task-node>
+
+ <join name="join">
+ <transition to="end"></transition>
+ </join>
+
+ <end-state name="end" />
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/exception-handler.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/exception-handler.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/exception-handler.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest" />
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end">
+ <exception-handler exception-class="a">
+ <action class="b"/>
+ </exception-handler>
+ </end-state>
+
+ <exception-handler exception-class="a">
+ <action class="b"/>
+ </exception-handler>
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/invalid.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/invalid.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/invalid.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <transition name="to_end" to="end">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state1 name="end"></end-state1>
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/log4j.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/log4j.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/log4j.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="ERROR" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: jbpm4/trunk/modules/migration/src/test/resources/process-event.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/process-event.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/process-event.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <transition name="to_end" to="end">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+
+ <event type="process-start">
+
+ <action name="ation1" expression="a=b+c"></action>
+ <action name="action2" class="com.test.Logger"></action>
+ <script>run this script</script>
+ </event>
+
+
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/process-state.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/process-state.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/process-state.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="hire">
+ <start-state>
+ <transition to="initial interview" />
+ </start-state>
+ <process-state name="initial interview">
+ <sub-process name="interview" />
+ <variable name="a" access="read,write" mapped-name="aa" />
+ <variable name="b" access="read" mapped-name="bb" />
+ <transition to="end" />
+ </process-state>
+ <end-state name="end"></end-state>
+</process-definition>
+
Added: jbpm4/trunk/modules/migration/src/test/resources/script.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/script.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/script.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,36 @@
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="action process">
+
+ <event type="node-enter">
+ <script>
+ <variable name="var1" />
+ <variable name="var2" />
+ <expression>
+ System.out.println("blabla");
+ </expression>
+ </script>
+ <script>
+ System.out.println("blabla");
+ </script>
+ </event>
+
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="com.test.NodeEnterAction"/>
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/simple.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/simple.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/simple.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="com.test.NodeEnterAction"/>
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/superstate-mail.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/superstate-mail.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/superstate-mail.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="phase one">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+
+ <super-state name="phase one">
+ <node name="node1"/>
+ <transition to="mail-node"/>
+ </super-state>
+
+ <mail-node name="mail-node" to="simple">
+ <subject>test</subject>
+ <text>test</text>
+ <transition to="first"/>
+ </mail-node>
+
+ <state name="first">
+ <event type="transistion">
+ <mail name="test"/>
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
Added: jbpm4/trunk/modules/migration/src/test/resources/test-transition-resolve.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/test-transition-resolve.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/test-transition-resolve.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first2">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest"/>
+ </event>
+ <transition name="to_end" to="end2">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Added: jbpm4/trunk/modules/migration/src/test/resources/testDecision.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/testDecision.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/testDecision.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="decision process">
+ <start-state name="start">
+ <transition name="to_state" to="make_decision">
+ <action name="action" class="com.test.MessageActionHandler">
+ </action>
+ </transition>
+ </start-state>
+
+ <decision name="make_decision">
+ <transition to="second">
+ <condition>a=="OKOK"</condition>
+ </transition>
+ <transition to="second">
+ <condition>a=="NOK"</condition>
+ </transition>
+ </decision>
+
+ <state name="second">
+ <transition name="to_end" to="end">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
Added: jbpm4/trunk/modules/migration/src/test/resources/timer.xml
===================================================================
--- jbpm4/trunk/modules/migration/src/test/resources/timer.xml (rev 0)
+++ jbpm4/trunk/modules/migration/src/test/resources/timer.xml 2009-07-02 22:36:06 UTC (rev 5199)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <timer duedate="2 business minutes">
+ <action name="timer-action1" class="com.test.MessageActionHandler"/>
+ </timer>
+ <event type="task-create">
+ <create-timer duedate="3 business minutes">
+ <action name="timer-action2" class="com.test.MessageActionHandler2"/>
+ </create-timer>
+ <action class="com.test.TaskCreateAction"/>
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.test.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
15 years, 4 months
JBoss JBPM SVN: r5198 - jbpm4/trunk/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-02 18:21:13 -0400 (Thu, 02 Jul 2009)
New Revision: 5198
Added:
jbpm4/trunk/modules/migration/
Log:
Import of work from Jim Ma on JPDL conversion tool
15 years, 4 months
JBoss JBPM SVN: r5197 - jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-02 17:52:17 -0400 (Thu, 02 Jul 2009)
New Revision: 5197
Modified:
jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
Log:
Process diagram is optional
Modified: jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-07-02 21:12:56 UTC (rev 5196)
+++ jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-07-02 21:52:17 UTC (rev 5197)
@@ -26,6 +26,8 @@
import java.io.InputStream;
import java.util.List;
import java.util.ArrayList;
+import java.net.URL;
+import java.net.MalformedURLException;
import javax.naming.InitialContext;
@@ -42,6 +44,8 @@
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.integration.spi.mgmt.ServerConfig;
+import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -49,13 +53,36 @@
public class GraphViewerPluginImpl implements GraphViewerPlugin
{
- private ProcessEngine processEngine = null;
+ protected final static String WEB_CONTEXT = "/gwt-console-server/rs";
+ protected ProcessEngine processEngine;
+ protected ServerConfig serverConfig = null; // lazy
+
+
public GraphViewerPluginImpl()
{
initializeProcessEngine();
}
+ protected ServerConfig getServerConfig()
+ {
+ if(null==serverConfig)
+ {
+ serverConfig = ServerConfigFactory.getServerConfig();
+ }
+ return serverConfig;
+ }
+
+ protected StringBuilder getBaseUrl()
+ {
+ StringBuilder spec = new StringBuilder();
+ spec.append("http://");
+ spec.append(getServerConfig().getWebServiceHost());
+ spec.append(":").append(getServerConfig().getWebServicePort());
+ spec.append(WEB_CONTEXT);
+ return spec;
+ }
+
public byte[] getProcessImage(String processId)
{
@@ -74,7 +101,7 @@
);
if(null==in)
- return null; //throw new RuntimeException("Failed to retrieve image resource: " +imgRes);
+ throw new RuntimeException("Failed to retrieve image resource: " +imgRes);
ByteArrayOutputStream out = new ByteArrayOutputStream();
final int BUF_SIZE = 1 << 8; //1KiB buffer
@@ -163,4 +190,64 @@
}
}
+ public URL getDiagramURL(String id)
+ {
+ URL result = null;
+
+ // check resource availability
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ boolean hasImageResource = false;
+
+ try
+ {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .processDefinitionId(id)
+ .uniqueResult();
+
+ InputStream inputStream = null;
+ if(processDefinition!=null)//TODO: JBPM-2383 Suspended definitions don't show up here
+ {
+ String imgRes = processDefinition.getImageResourceName();
+ inputStream = repositoryService.getResourceAsStream(
+ processDefinition.getDeploymentId(), imgRes
+ );
+ }
+
+ if(inputStream!=null)
+ {
+ hasImageResource = true;
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Failed to close stream", e);
+ }
+ }
+
+ }
+ finally{
+ env.close();
+ }
+
+ if(hasImageResource)
+ {
+ StringBuilder sb = getBaseUrl().append("/process/definition/");
+ sb.append(id);
+ sb.append("/image");
+
+ try
+ {
+ result = new URL(sb.toString());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException("Failed to create url", e);
+ }
+ }
+
+ return result;
+ }
}
15 years, 4 months
JBoss JBPM SVN: r5196 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/icons and 6 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-02 17:12:56 -0400 (Thu, 02 Jul 2009)
New Revision: 5196
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
Log:
Process diagram is optional
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -210,8 +210,10 @@
{
if(isError)
{
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
WindowPanel err = new WindowPanel("Error");
- err.getHeader().add( new Image("images/icons/error.png") );
+ err.getHeader().add( icons.errorIcon().createImage() );
err.setAnimationEnabled(true);
err.setSize("320px", "240px");
ScrollLayoutPanel scrollLayoutPanel = new ScrollLayoutPanel();
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -75,7 +75,7 @@
AbstractImagePrototype collapseLeftIcon();
/**
- * @gwt.resource dialog-error.png
+ * @gwt.resource errorIcon.png
*/
AbstractImagePrototype errorIcon();
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -29,15 +29,13 @@
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.WindowResizeListener;
-import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
-import org.gwt.mosaic.ui.client.WindowPanel;
-import org.gwt.mosaic.ui.client.Caption;
-import org.gwt.mosaic.ui.client.Label;
+import org.gwt.mosaic.ui.client.*;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
import org.jboss.bpm.console.client.util.WindowUtil;
import org.jboss.bpm.console.client.ApplicationContext;
@@ -73,8 +71,9 @@
private boolean hasDiagramPlugin;
private SimpleDateFormat dateFormat = new SimpleDateFormat();
-
- public InstanceDetailView(ApplicationContext appContext)
+ private ProcessDefinitionRef currentDefintion;
+
+ public InstanceDetailView(final ApplicationContext appContext)
{
super("Instance details");
this.appContext = appContext;
@@ -94,13 +93,23 @@
{
public void onClick(Widget widget)
{
- if(currentInstance!=null)
+ String diagramUrl = getCurrentDefintion().getDiagramUrl();
+ if(diagramUrl !=null && !diagramUrl.equals(""))
{
- createDiagramWindow(currentInstance);
- controller.handleEvent(
- new Event(LoadActivityDiagramAction.ID, currentInstance)
- );
+ ProcessInstanceRef selection = getCurrentInstance();
+ if(selection!=null)
+ {
+ createDiagramWindow(selection);
+ controller.handleEvent(
+ new Event(LoadActivityDiagramAction.ID, selection)
+ );
+ }
}
+ else
+ {
+ MessageBox.alert("Incomplete deployment", "No diagram associated with process");
+ }
+
}
}
);
@@ -146,7 +155,7 @@
Label header = new Label("Instance: "+inst.getId());
header.setStyleName("bpm-label-header");
layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
-
+
diagramWindowPanel.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
diagramWindowPanel = null;
@@ -192,7 +201,7 @@
new WindowResizeListener() {
public void onWindowResized(int i, int i1)
- {
+ {
instanceDataView.invalidate();
}
}
@@ -221,8 +230,9 @@
controller.addAction(UpdateInstanceDataAction.ID, new UpdateInstanceDataAction(appContext));
}
- public void update(ProcessInstanceRef instance)
+ public void update(ProcessDefinitionRef def, ProcessInstanceRef instance)
{
+ this.currentDefintion = def;
this.currentInstance = instance;
String[] values = new String[] {
@@ -244,9 +254,21 @@
public void clearView()
{
grid.clear();
+ this.currentDefintion=null;
this.currentInstance = null;
this.diagramBtn.setEnabled(false);
instanceDataBtn.setEnabled(false);
}
+
+
+ private ProcessDefinitionRef getCurrentDefintion()
+ {
+ return currentDefintion;
+ }
+
+ private ProcessInstanceRef getCurrentInstance()
+ {
+ return currentInstance;
+ }
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -34,6 +34,7 @@
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.events.InstanceEvent;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
@@ -131,7 +132,9 @@
// update details
controller.handleEvent(
- new Event(UpdateInstanceDetailAction.ID, item)
+ new Event(UpdateInstanceDetailAction.ID,
+ new InstanceEvent(currentDefinition, item)
+ )
);
}
}
@@ -171,7 +174,7 @@
{
if(doIt)
{
- String url = getCurrentDefinition().getUrl();
+ String url = getCurrentDefinition().getFormUrl();
boolean hasForm = (url !=null && !url.equals(""));
if(hasForm)
{
@@ -347,7 +350,7 @@
);
ConsoleLog.debug(frame.getElement().toString());
- frame.setUrl(process.getUrl());
+ frame.setUrl(process.getFormUrl());
layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
windowPanel.setWidget(layout);
@@ -391,7 +394,9 @@
// clear details
controller.handleEvent(
- new Event(UpdateInstanceDetailAction.ID, null)
+ new Event(UpdateInstanceDetailAction.ID,
+ new InstanceEvent(def, null)
+ )
);
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDetailAction.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -24,6 +24,7 @@
import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.process.events.InstanceEvent;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -34,11 +35,12 @@
public void execute(Controller controller, Object object)
{
- ProcessInstanceRef instance = object!=null ? (ProcessInstanceRef)object : null;
+ InstanceEvent event = (InstanceEvent)object;
+
InstanceDetailView view = (InstanceDetailView)controller.getView(InstanceDetailView.ID);
- if(instance!=null)
- view.update(instance);
+ if(event.getInstance()!=null)
+ view.update(event.getDefinition(), event.getInstance());
else
view.clearView();
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/InstanceEvent.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process.events;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InstanceEvent
+{
+ private ProcessDefinitionRef definition;
+ private ProcessInstanceRef instance;
+
+ public InstanceEvent(ProcessDefinitionRef definition, ProcessInstanceRef instance)
+ {
+ this.definition = definition;
+ this.instance = instance;
+ }
+
+ public ProcessDefinitionRef getDefinition()
+ {
+ return definition;
+ }
+
+ public ProcessInstanceRef getInstance()
+ {
+ return instance;
+ }
+}
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -61,10 +61,15 @@
ref.setSuspended(isSuspended);
// optional start form url
- JSONWalk.JSONWrapper url = JSONWalk.on(root).next("url");
- if(url!=null)
- ref.setUrl(url.asString());
-
+ JSONWalk.JSONWrapper formUrl = JSONWalk.on(root).next("formUrl");
+ if(formUrl !=null)
+ ref.setFormUrl(formUrl.asString());
+
+ // optional diagram url
+ JSONWalk.JSONWrapper diagramUrl = JSONWalk.on(root).next("diagramUrl");
+ if(diagramUrl !=null)
+ ref.setDiagramUrl(diagramUrl.asString());
+
return ref;
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -40,7 +40,8 @@
private String deploymentId;
private boolean suspended;
- private String url = null;
+ private String formUrl = null;
+ private String diagramUrl = null;
public ProcessDefinitionRef()
{
@@ -165,13 +166,23 @@
return result;
}
- public void setUrl(String s)
+ public void setFormUrl(String s)
{
- this.url = s;
+ this.formUrl = s;
}
- public String getUrl()
+ public String getFormUrl()
{
- return url;
+ return formUrl;
}
+
+ public String getDiagramUrl()
+ {
+ return diagramUrl;
+ }
+
+ public void setDiagramUrl(String diagramUrl)
+ {
+ this.diagramUrl = diagramUrl;
+ }
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -32,13 +32,13 @@
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.Payload2XML;
import org.jboss.bpm.console.server.util.RsComment;
-import org.jboss.bpm.console.server.util.Payload2XML;
+import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Context;
-import javax.servlet.http.HttpServletRequest;
import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -87,7 +87,7 @@
return this.processManagement;
}
- private GraphViewerPlugin getProcessGraphViewPlugin()
+ private GraphViewerPlugin getGraphViewerPlugin()
{
if(graphViewerPlugin==null)
{
@@ -108,6 +108,10 @@
return decorateProcessDefintions(processDefinitions);
}
+ /**
+ * Enriches {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef} with
+ * form and diagram URLs if applicable.
+ */
private Response decorateProcessDefintions( List<ProcessDefinitionRef> processDefinitions)
{
// decorate process form URL if plugin available
@@ -121,11 +125,25 @@
);
if(processFormURL!=null)
{
- def.setUrl(processFormURL.toExternalForm());
+ def.setFormUrl(processFormURL.toExternalForm());
}
}
}
+ // decorate the diagram URL if available
+ GraphViewerPlugin graphViewer = getGraphViewerPlugin();
+ if(graphViewer!=null)
+ {
+ for(ProcessDefinitionRef def : processDefinitions)
+ {
+ URL diagramUrl = graphViewer.getDiagramURL(def.getId());
+ if(diagramUrl!=null)
+ {
+ def.setDiagramUrl(diagramUrl.toExternalForm());
+ }
+ }
+ }
+
ProcessDefinitionRefWrapper wrapper =
new ProcessDefinitionRefWrapper(processDefinitions);
return createJsonResponse(wrapper);
@@ -188,7 +206,7 @@
{
Map<String, Object> javaPayload = getProcessManagement().getInstanceData(instanceId);
Payload2XML payload2XML = new Payload2XML();
- StringBuffer sb = payload2XML.convert(instanceId, javaPayload);
+ StringBuffer sb = payload2XML.convert(instanceId, javaPayload);
return Response.ok(sb.toString()).build();
}
@@ -270,13 +288,13 @@
@Path("definition/{id}/image")
@Produces("image/*")
public Response getProcessImage(
- @Context
- HttpServletRequest request,
- @PathParam("id")
- String id
+ @Context
+ HttpServletRequest request,
+ @PathParam("id")
+ String id
)
{
- GraphViewerPlugin plugin = getProcessGraphViewPlugin();
+ GraphViewerPlugin plugin = getGraphViewerPlugin();
if(plugin !=null)
{
byte[] processImage = plugin.getProcessImage(id);
@@ -299,7 +317,7 @@
String id)
{
- GraphViewerPlugin plugin = getProcessGraphViewPlugin();
+ GraphViewerPlugin plugin = getGraphViewerPlugin();
if(plugin !=null)
{
List<ActiveNodeInfo> info = plugin.getActiveNodeInfo(id);
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java 2009-07-02 21:11:53 UTC (rev 5195)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java 2009-07-02 21:12:56 UTC (rev 5196)
@@ -22,6 +22,7 @@
package org.jboss.bpm.console.server.plugin;
import java.util.List;
+import java.net.URL;
import org.jboss.bpm.console.client.model.ActiveNodeInfo;
import org.jboss.bpm.console.client.model.DiagramInfo;
@@ -33,9 +34,17 @@
*/
public interface GraphViewerPlugin
{
+ /**
+ * Check {@link #getDiagramURL(String)} != null before invoking.
+ */
byte[] getProcessImage(String processId);
DiagramInfo getDiagramInfo(String processId);
List<ActiveNodeInfo> getActiveNodeInfo(String instanceId);
+
+ /**
+ * Can be null, in case no diagram is associated with the process
+ */
+ URL getDiagramURL(String id);
}
15 years, 4 months
JBoss JBPM SVN: r5195 - jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-02 17:11:53 -0400 (Thu, 02 Jul 2009)
New Revision: 5195
Modified:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.jpdl.xml
Log:
Change vacation reqzest process name
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.jpdl.xml 2009-07-02 19:44:41 UTC (rev 5194)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/taskform/vacation2.jpdl.xml 2009-07-02 21:11:53 UTC (rev 5195)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="vacation2" xmlns="http://jbpm.org/4.0/jpdl">
+<process name="VacationRequest" xmlns="http://jbpm.org/4.0/jpdl">
<start g="274,13,48,48" name="start1">
<transition g="-109,-18" name="to number_of_days" to="request_vacation"/>
</start>
15 years, 4 months
JBoss JBPM SVN: r5194 - in jbpm4/trunk/modules/integration: form-plugin/src/main/java/org/jbpm/integration/console/forms and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-02 15:44:41 -0400 (Thu, 02 Jul 2009)
New Revision: 5194
Removed:
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
Log:
Cleanup FormDispatcher API
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-02 19:32:12 UTC (rev 5193)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-02 19:44:41 UTC (rev 5194)
@@ -254,6 +254,23 @@
}
+ public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.startProcessInstanceById(definitionId);
+ execService.setVariables(exec.getId(), processVars);
+
+ return ModelAdaptor.adoptExecution((ExecutionImpl)exec);
+ }
+ finally{
+ env.close();
+ }
+ }
+
public void endInstance(String instanceId, ProcessInstanceRef.RESULT result)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java 2009-07-02 19:32:12 UTC (rev 5193)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java 2009-07-02 19:44:41 UTC (rev 5194)
@@ -69,19 +69,4 @@
throw new IllegalArgumentException("Unknown authority type:"+ref.getType());
}
}
-
- public void processCompletion(FormAuthorityRef ref, Map<String, Object> payload, String performingUser, String outcome)
- {
- switch(ref.getType())
- {
- case TASK:
- taskDispatcher.processCompletion(ref, payload, performingUser, outcome);
- break;
- case PROCESS:
- processDispatcher.processCompletion(ref, payload, performingUser, outcome);
- break;
- default:
- throw new IllegalArgumentException("Unknown authority type:"+ref.getType());
- }
- }
}
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-07-02 19:32:12 UTC (rev 5193)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-07-02 19:44:41 UTC (rev 5194)
@@ -23,7 +23,6 @@
import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
-import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.RepositoryService;
import org.jbpm.pvm.internal.env.Environment;
@@ -34,8 +33,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
-import java.util.Map;
import java.util.List;
+import java.util.Map;
/**
* Processes form data to start processes.
@@ -153,28 +152,4 @@
env.close();
}
}
-
- public void processCompletion(FormAuthorityRef ref, Map<String, Object> payload, String performingUser, String outcome)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ExecutionService execService = processEngine.getExecutionService();
- if(payload!=null)
- {
- execService.startProcessInstanceById(
- ref.getReferenceId(), payload
- );
- }
- else
- {
- execService.startProcessInstanceById(ref.getReferenceId());
- }
- }
- finally
- {
- env.close();
- }
- }
}
Deleted: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java 2009-07-02 19:32:12 UTC (rev 5193)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java 2009-07-02 19:44:41 UTC (rev 5194)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.console.forms;
-
-import freemarker.template.DefaultObjectWrapper;
-import freemarker.template.Template;
-
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class Runner
-{
- static String template = "<html>\n" +
- "<body>\n" +
- "\n" +
- "<h2>Please enter your name</h2>\n" +
- "<formResourceName action=\"${formResourceName.action}\" method=\"POST\" enctype=\"multipart/formResourceName-data\">\n" +
- "<input type=\"text\" name=\"name\" value=\"\"><br/>\n" +
- "Outcomes:<br/>\n" +
- "<ul>\n" +
- "<#list outcome.values as transition>\n" +
- " <li>${transition} \n" +
- "</#list>\n" +
- "</ul> \n" +
- "<input type=\"submit\">\n" +
- "</formResourceName>\n" +
- "</body>\n" +
- "</html>";
-
- public static void main(String[] args)
- {
- Runner r = new Runner();
-
- Map<String,Object> ctx = new HashMap<String,Object>();
- FormDirective f = new FormDirective("http://localhost:8080/");
- OutcomeDirective o = new OutcomeDirective();
- o.getValues().add("transition1");
- o.getValues().add("transition2");
-
- ctx.put("formResourceName", f);
- ctx.put("outcome", o);
-
- r.execute(ctx, "testRun", new ByteArrayInputStream(template.getBytes()));
- }
-
- private void execute(Map<String, Object> renderContext, String name, InputStream src)
- {
- try
- {
- freemarker.template.Configuration cfg = new freemarker.template.Configuration();
- cfg.setObjectWrapper(new DefaultObjectWrapper());
- cfg.setTemplateUpdateDelay(0);
-
- Template temp = new Template(name, new InputStreamReader(src), cfg);
- temp.dump(System.out);
-
- final ByteArrayOutputStream bout = new ByteArrayOutputStream();
- Writer out = new OutputStreamWriter(bout);
- temp.process(renderContext, out);
- out.flush();
-
- System.out.println(new String(bout.toByteArray()));
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
-
-}
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-07-02 19:32:12 UTC (rev 5193)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-07-02 19:44:41 UTC (rev 5194)
@@ -167,33 +167,4 @@
}
}
- public void processCompletion(
- FormAuthorityRef ref,
- Map<String,Object> payload,
- String performingUser,
- String outcome)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- String taskId = ref.getReferenceId();
-
- try
- {
- TaskService taskService = processEngine.getTaskService();
-
- if(payload!=null)
- taskService.setVariables(taskId, payload);
-
- if(null==outcome)
- taskService.completeTask(taskId);
- else
- taskService.completeTask(taskId, outcome);
-
- }
- finally
- {
- env.close();
- }
- }
-
}
15 years, 4 months
JBoss JBPM SVN: r5193 - in projects/gwt-console/trunk/server: server-core/src/main/java/org/jboss/bpm/console/server and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-02 15:32:12 -0400 (Thu, 02 Jul 2009)
New Revision: 5193
Removed:
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TestFacade.java
Modified:
projects/gwt-console/trunk/server/server-core/server-core.iml
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java
Log:
Cleanup FormDispatcherPlugin API
Modified: projects/gwt-console/trunk/server/server-core/server-core.iml
===================================================================
--- projects/gwt-console/trunk/server/server-core/server-core.iml 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-core/server-core.iml 2009-07-02 19:32:12 UTC (rev 5193)
@@ -17,6 +17,15 @@
<orderEntry type="module" module-name="server-integration" exported="" />
<orderEntry type="module" module-name="report-server" exported="" />
<orderEntry type="library" name="jaxb-impl-2.1" level="application" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -42,8 +42,7 @@
singletons.add(new ProcessMgmtFacade());
singletons.add(new TaskListFacade());
singletons.add(new TaskMgmtFacade());
- singletons.add(new UserMgmtFacade());
- singletons.add(new TestFacade());
+ singletons.add(new UserMgmtFacade());
singletons.add(new EngineFacade());
singletons.add(new FormProcessingFacade());
singletons.add(new ReportFacade() );
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -23,6 +23,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.integration.TaskManagement;
import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
@@ -59,9 +63,40 @@
private FormDispatcherPlugin formPlugin;
+ private ProcessManagement processManagement;
+
+ private TaskManagement taskManagement;
+
/**
* Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
*/
+ private TaskManagement getTaskManagement()
+ {
+ if(null==this.taskManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.taskManagement = factory.createTaskManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.taskManagement;
+ }
+
+ private ProcessManagement getProcessManagement()
+ {
+ if(null==this.processManagement)
+ {
+ ManagementFactory factory = ManagementFactory.newInstance();
+ this.processManagement = factory.createProcessManagement();
+ log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
+ }
+
+ return this.processManagement;
+ }
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.integration.TaskManagement}
+ */
private FormDispatcherPlugin getFormDispatcherPlugin()
{
if(null==this.formPlugin)
@@ -111,8 +146,11 @@
Map<String,Object> processVars = createVariableMapping(payload);
// complete task
- getFormDispatcherPlugin().processCompletion(
- new FormAuthorityRef(taskId), processVars, request.getRemoteUser(), (String)processVars.get("outcome")
+ getTaskManagement().completeTask(
+ Long.valueOf(taskId), // TODO: change to string id's
+ String.valueOf(processVars.get("outcome")), // actually a plugin implementation detail
+ processVars,
+ request.getRemoteUser()
);
return Response.ok("Successfully processed input").build();
@@ -132,12 +170,8 @@
{
Map<String,Object> processVars = createVariableMapping(payload);
- // complete task
- FormAuthorityRef authref = new FormAuthorityRef(definitionId, FormAuthorityRef.Type.PROCESS);
- getFormDispatcherPlugin().processCompletion(
- authref, processVars, request.getRemoteUser(),
- (String)processVars.get("outcome")
- );
+ // start process
+ ProcessInstanceRef instance = getProcessManagement().newInstance(definitionId, processVars);
return Response.ok("Successfully processed input").build();
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -25,27 +25,14 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.TaskManagement;
-import org.jboss.bpm.console.server.plugin.PluginMgr;
-import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
import org.jboss.bpm.console.server.util.RsComment;
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
/**
* REST server module for accessing task related data.
@@ -158,101 +145,4 @@
return Response.ok().build();
}
- /*
- @GET
- @Path("{taskId}/render")
- @Produces("text/html")
- public Response renderUI(
- @PathParam("taskId")
- String taskId
- )
- {
- DataHandler dh = getFormDispatcherPlugin().provideForm(
- new FormAuthorityRef(taskId)
- );
-
- if(null==dh)
- {
- throw new RuntimeException("No UI associated with task ID " + taskId);
- }
-
- return Response.ok(dh.getDataSource()).type("text/html").build();
- }
-
- @POST
- @Path("{taskId}/process")
- @Produces("text/html")
- @Consumes("multipart/form-data")
- public Response closeWithUI(
- @Context
- HttpServletRequest request,
- @PathParam("taskId")
- String taskId,
- MultipartFormDataInput payload
- )
- {
- Map<String,Object> processVars = new HashMap<String,Object>();
-
- Map<String,InputPart> formData = payload.getFormData();
- Iterator<String> partNames = formData.keySet().iterator();
-
- String outcome = null;
-
- while(partNames.hasNext())
- {
- final String partName = partNames.next();
- final InputPart part = formData.get(partName);
- final MediaType mediaType = part.getMediaType();
-
- if(partName.equals("outcome"))
- {
- outcome = part.getBodyAsString();
- }
- else if(MediaType.TEXT_PLAIN_TYPE.equals(mediaType))
- {
- // RFC2045: Each part has an optional "Content-Type" header
- // that defaults to "text/plain".
- // Can go into process without conversion
- processVars.put(partName, part.getBodyAsString());
- }
- else
- {
- // anything else turns into a DataHandler
- final byte[] data = part.getBodyAsString().getBytes();
- DataHandler dh = new DataHandler(
- new DataSource()
- {
- public InputStream getInputStream() throws IOException
- {
- return new ByteArrayInputStream(data);
- }
-
- public OutputStream getOutputStream() throws IOException
- {
- throw new RuntimeException("This is a readonly DataHandler");
- }
-
- public String getContentType()
- {
- return mediaType.getType();
- }
-
- public String getName()
- {
- return partName;
- }
- }
- );
-
- processVars.put(partName, dh);
- }
- }
-
- // complete task
- getFormDispatcherPlugin().processCompletion(
- new FormAuthorityRef(taskId), processVars, request.getRemoteUser(), outcome
- );
-
- return Response.ok("Successfully processed task UI").build();
- } */
}
Deleted: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TestFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.server;
-
-import com.google.gson.Gson;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.integration.ManagementFactory;
-import org.jboss.bpm.console.server.integration.ProcessManagement;
-
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
-import java.util.List;
-
-/**
- * Test utility to simplify GWT tests.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-@Path("test")
-public class TestFacade
-{
- private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
-
- private ProcessManagement processManagement;
- private static final String SAMPLE_PROCESS_PAR = "/process.jpdl.xml";
-
- private ProcessManagement getProcessManagement()
- {
- if(null==this.processManagement)
- {
- ManagementFactory factory = ManagementFactory.newInstance();
- this.processManagement = factory.createProcessManagement();
- log.debug("Using ManagementFactory impl:" + factory.getClass().getName());
- }
-
- return this.processManagement;
- }
-
- @POST
- @Path("deploy/harness")
- public Response deployTestHarness()
- {
- InputStream in = getClass().getResourceAsStream(SAMPLE_PROCESS_PAR);
- if(null==in)
- throw new RuntimeException("Failed to read test deployment: " + SAMPLE_PROCESS_PAR);
-
- getProcessManagement().deploy("test.jpdl.xml", "text/xml", in);
- return Response.ok().build();
- }
-
- @POST
- @Path("undeploy/harness")
- public Response undeployTestHarness()
- {
- List<ProcessDefinitionRef> defs = getProcessManagement().getProcessDefinitions();
-
- for(ProcessDefinitionRef pd : defs)
- {
- if(pd.getName().equals("GWT_Test_Harness"))
- {
- log.info("Remove test harness " +pd);
- getProcessManagement().removeProcessDefinition(pd.getId());
- }
- }
- return Response.ok().build();
- }
-
- private Response createJsonResponse(Object wrapper)
- {
- Gson gson = GsonFactory.createInstance();
- String json = gson.toJson(wrapper);
- return Response.ok(json).type("application/json").build();
- }
-}
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -45,8 +45,10 @@
ProcessInstanceRef getProcessInstance(String instanceId);
- ProcessInstanceRef newInstance(String instanceId);
+ ProcessInstanceRef newInstance(String defintionId);
+ ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars);
+
Map<String, Object> getInstanceData(String instanceId);
void setInstanceData(String instanceId, Map<String, Object> data);
@@ -59,6 +61,4 @@
void signalExecution(String executionId, String signal);
- @Deprecated
- void deploy(String fileName, String contentType, InputStream deployment);
}
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java 2009-07-02 16:38:22 UTC (rev 5192)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormDispatcherPlugin.java 2009-07-02 19:32:12 UTC (rev 5193)
@@ -35,8 +35,4 @@
URL getDispatchUrl(FormAuthorityRef ref);
DataHandler provideForm(FormAuthorityRef ref);
-
- void processCompletion(
- FormAuthorityRef ref, Map<String, Object> payload,
- String performingUser, String outcome);
}
15 years, 4 months