Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 07:02:38 -0400 (Thu, 10 Jul 2008)
New Revision: 1569
Added:
api/trunk/modules/api/scripts/
api/trunk/modules/api/scripts/antrun-schemagen.xml
Modified:
api/trunk/modules/api/pom.xml
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
api/trunk/pom.xml
Log:
Add JAXB schema generation
Modified: api/trunk/modules/api/pom.xml
===================================================================
--- api/trunk/modules/api/pom.xml 2008-07-10 10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/pom.xml 2008-07-10 11:02:38 UTC (rev 1569)
@@ -48,8 +48,65 @@
<artifactId>junit</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- Runtime/System Dependencies -->
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
-
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <!-- mvn jaxb-schemagen:generate -->
+ <groupId>com.sun.tools.jxc.maven2</groupId>
+ <artifactId>maven-jaxb-schemagen-plugin</artifactId>
+ <configuration>
+ <srcdir>src/main/java/org/jboss/bpm/model</srcdir>
+ <destdir>target/schema</destdir>
+ <schemas>
+ <schema>
+ <namespace>org.jboss.bpm.api</namespace>
+ <file>jbpm-api.xsd</file>
+ </schema>
+ </schemas>
+ <includes>
+ <include>Activity.java</include>
+ <include>ComplexGateway.java</include>
+ <include>EndEvent.java</include>
+ <include>Event.java</include>
+ <include>ExclusiveGateway.java</include>
+ <include>FlowObject.java</include>
+ <include>Gateway.java</include>
+ <include>InclusiveGateway.java</include>
+ <include>ItermediateEvent.java</include>
+ <include>NamedFlowObject.java</include>
+ <include>ParallelGateway.java</include>
+ <include>Process.java</include>
+ <include>Signal.java</include>
+ <include>StartEvent.java</include>
+ <include>SubProcess.java</include>
+ <include>Task.java</include>
+ </includes>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath"
refid="maven.runtime.classpath" />
+ <property name="java.home" value="${java.home}" />
+ <ant antfile="scripts/antrun-schemagen.xml"
target="schemagen" />
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<!-- Reporting -->
<reporting>
<plugins>
Added: api/trunk/modules/api/scripts/antrun-schemagen.xml
===================================================================
--- api/trunk/modules/api/scripts/antrun-schemagen.xml (rev 0)
+++ api/trunk/modules/api/scripts/antrun-schemagen.xml 2008-07-10 11:02:38 UTC (rev 1569)
@@ -0,0 +1,45 @@
+<?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. -->
+<!-- ============================================================ -->
+
+<!-- $Id$ -->
+<project>
+
+ <!-- ================================================================== -->
+ <!-- jBPM Database schema -->
+ <!-- ================================================================== -->
+ <target name="schemagen" description="Generate API model
schemas">
+
+ <taskdef name="schemagen"
classname="com.sun.tools.jxc.SchemaGenTask">
+ <classpath>
+ <pathelement path="${maven.runtime.classpath}" />
+ <pathelement location="${java.home}/../lib/tools.jar" />
+ </classpath>
+ </taskdef>
+
+ <mkdir dir="target/schema"/>
+ <schemagen srcdir="src/main/java/org/jboss/bpm/model"
destdir="target/schema">
+ <schema namespace="org.jboss.bpm.api"
file="jbpm-api.xsd"/>
+ <include name="Activity.java"/>
+ <include name="ComplexGateway.java"/>
+ <include name="EndEvent.java"/>
+ <include name="Event.java"/>
+ <include name="ExclusiveGateway.java"/>
+ <include name="FlowObject.java"/>
+ <include name="Gateway.java"/>
+ <include name="InclusiveGateway.java"/>
+ <include name="ItermediateEvent.java"/>
+ <include name="NamedFlowObject.java"/>
+ <include name="ParallelGateway.java"/>
+ <include name="Process.java"/>
+ <include name="Signal.java"/>
+ <include name="StartEvent.java"/>
+ <include name="SubProcess.java"/>
+ <include name="Task.java"/>
+ </schemagen>
+ </target>
+</project>
\ No newline at end of file
Property changes on: api/trunk/modules/api/scripts/antrun-schemagen.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -33,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="Activity")
+(a)XmlType(namespace="org.jboss.bpm.api", name="Activity")
public abstract class Activity extends NamedFlowObject
{
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="ComplexGateway")
+(a)XmlType(namespace="org.jboss.bpm.api", name="ComplexGateway")
public class ComplexGateway extends Gateway
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="EndEvent")
+(a)XmlType(namespace="org.jboss.bpm.api", name="EndEvent")
public class EndEvent extends Event
{
@XmlTransient
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-10 10:58:23
UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-10 11:02:38
UTC (rev 1569)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="Event")
+(a)XmlType(namespace="org.jboss.bpm.api", name="Event")
public abstract class Event extends FlowObject
{
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
===================================================================
---
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-10
10:58:23 UTC (rev 1568)
+++
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="ExclusiveGateway")
+(a)XmlType(namespace="org.jboss.bpm.api", name="ExclusiveGateway")
public class ExclusiveGateway extends Gateway
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="FlowObject")
+(a)XmlType(namespace="org.jboss.bpm.api", name="FlowObject")
public abstract class FlowObject
{
@XmlTransient
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="Gateway")
+(a)XmlType(namespace="org.jboss.bpm.api", name="Gateway")
public abstract class Gateway extends FlowObject
{
@Override
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
===================================================================
---
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-10
10:58:23 UTC (rev 1568)
+++
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="InclusiveGateway")
+(a)XmlType(namespace="org.jboss.bpm.api", name="InclusiveGateway")
public class InclusiveGateway extends Gateway
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -23,6 +23,8 @@
// $Id$
+import javax.xml.bind.annotation.XmlTransient;
+
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.BasicAttachments;
import org.jboss.bpm.runtime.ExecutionContext;
@@ -34,6 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
+@XmlTransient
class InitialToken implements Token
{
private Process proc;
@@ -55,7 +58,8 @@
return context;
}
- class InitialContext extends BasicAttachments implements ExecutionContext
+ @XmlTransient
+ static class InitialContext extends BasicAttachments implements ExecutionContext
{
InitialContext(Attachments att)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java
===================================================================
---
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-10
10:58:23 UTC (rev 1568)
+++
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="ItermediateEvent")
+(a)XmlType(namespace="org.jboss.bpm.api", name="ItermediateEvent")
public class ItermediateEvent extends Event
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java
===================================================================
---
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java 2008-07-10
10:58:23 UTC (rev 1568)
+++
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -22,6 +22,7 @@
package org.jboss.bpm.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
//$Id$
@@ -33,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="NamedFlowObject")
+(a)XmlType(namespace="org.jboss.bpm.api", name="NamedFlowObject")
public abstract class NamedFlowObject extends FlowObject
{
@XmlElement
@@ -52,6 +53,7 @@
* Note, this MUST NOT leak into the public API.
*/
// TODO
+ @XmlTransient
public void setName(String name)
{
if (this.name != null)
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
===================================================================
---
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-10
10:58:23 UTC (rev 1568)
+++
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="ParallelGateway")
+(a)XmlType(namespace="org.jboss.bpm.api", name="ParallelGateway")
public class ParallelGateway extends Gateway
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -49,8 +49,8 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="Process")
-@XmlRootElement(name="process")
+(a)XmlType(namespace="org.jboss.bpm.api", name="Process")
+(a)XmlRootElement(namespace="org.jboss.bpm.api", name="process")
public class Process extends Activity
{
@XmlElement
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -36,7 +36,8 @@
@XmlTransient
public class Signal
{
- @XmlType(name="SignalType")
+ // @XmlTransient does not work with jaxb-2.1.7
+ @XmlType(namespace="org.jboss.bpm.api", name="SignalType")
public enum Type
{
ENTER_START_EVENT, EXIT_START_EVENT,
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="StartEvent")
+(a)XmlType(namespace="org.jboss.bpm.api", name="StartEvent")
public class StartEvent extends Event
{
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-10
10:58:23 UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-10
11:02:38 UTC (rev 1569)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="SubProcess")
+(a)XmlType(namespace="org.jboss.bpm.api", name="SubProcess")
public class SubProcess extends Process
{
@XmlTransient
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-10 10:58:23
UTC (rev 1568)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-10 11:02:38
UTC (rev 1569)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="Task")
+(a)XmlType(namespace="org.jboss.bpm.api", name="Task")
public class Task extends Activity
{
/** Get signal for enter */
Modified: api/trunk/pom.xml
===================================================================
--- api/trunk/pom.xml 2008-07-10 10:58:23 UTC (rev 1568)
+++ api/trunk/pom.xml 2008-07-10 11:02:38 UTC (rev 1569)
@@ -52,6 +52,11 @@
<version>${jaxb.ri.version}</version>
</dependency>
<dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>${jaxb.ri.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>