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 -->
Show replies by date