JBoss JBPM SVN: r1575 - jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 13:10:18 -0400 (Thu, 10 Jul 2008)
New Revision: 1575
Modified:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
Log:
Add JAXB Flow
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-10 14:46:32 UTC (rev 1574)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-10 17:10:18 UTC (rev 1575)
@@ -43,7 +43,6 @@
{
setProcess(proc);
setImplObject(oldNode);
- init(oldNode.getName());
this.delegate = task;
}
15 years, 11 months
JBoss JBPM SVN: r1574 - in api/trunk/modules/api/src/main: java/org/jboss/bpm/model and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 10:46:32 -0400 (Thu, 10 Jul 2008)
New Revision: 1574
Added:
api/trunk/modules/api/src/main/resources/
api/trunk/modules/api/src/main/resources/org/
api/trunk/modules/api/src/main/resources/org/jboss/
api/trunk/modules/api/src/main/resources/org/jboss/bpm/
api/trunk/modules/api/src/main/resources/org/jboss/bpm/model/
api/trunk/modules/api/src/main/resources/org/jboss/bpm/model/jaxb.index
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index
Log:
Move jaxb.index to resources
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index 2008-07-10 14:08:20 UTC (rev 1573)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index 2008-07-10 14:46:32 UTC (rev 1574)
@@ -1,16 +0,0 @@
-Activity
-ComplexGateway
-EndEvent
-Event
-ExclusiveGateway
-FlowObject
-Gateway
-InclusiveGateway
-ItermediateEvent
-NamedFlowObject
-ParallelGateway
-Process
-Signal
-StartEvent
-SubProcess
-Task
Copied: api/trunk/modules/api/src/main/resources/org/jboss/bpm/model/jaxb.index (from rev 1573, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index)
===================================================================
--- api/trunk/modules/api/src/main/resources/org/jboss/bpm/model/jaxb.index (rev 0)
+++ api/trunk/modules/api/src/main/resources/org/jboss/bpm/model/jaxb.index 2008-07-10 14:46:32 UTC (rev 1574)
@@ -0,0 +1,16 @@
+Activity
+ComplexGateway
+EndEvent
+Event
+ExclusiveGateway
+FlowObject
+Gateway
+InclusiveGateway
+ItermediateEvent
+NamedFlowObject
+ParallelGateway
+Process
+Signal
+StartEvent
+SubProcess
+Task
15 years, 11 months
JBoss JBPM SVN: r1573 - in api/trunk/modules/api/src/main/java/org/jboss/bpm: util and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 10:08:20 -0400 (Thu, 10 Jul 2008)
New Revision: 1573
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/util/
api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
Log:
Add ProcessMarshaller/Unmarshaller
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java 2008-07-10 14:08:20 UTC (rev 1573)
@@ -0,0 +1,62 @@
+/*
+ * 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.jboss.bpm.util;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
+import org.jboss.bpm.model.Process;
+
+/**
+ * A JAXB marshaller for a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessMarshaller
+{
+ public void marshallProcess(Process proc, Writer out) throws JAXBException, IOException
+ {
+ StringWriter strwr = new StringWriter();
+ JAXBContext jaxbContext = JAXBContext.newInstance(Process.class.getPackage().getName());
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+
+ marshaller.marshal(proc, strwr);
+
+ // Add xmlns:xsi to the top level element and remove it from all others
+ String str = strwr.toString();
+ String xsi = " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
+ str = new StringBuilder(str.replace(xsi, "")).insert(str.indexOf(">"), xsi).toString();
+
+ // Write the xml string
+ out.write(str);
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-10 14:08:20 UTC (rev 1573)
@@ -0,0 +1,54 @@
+/*
+ * 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.jboss.bpm.util;
+
+// $Id$
+
+import java.io.Reader;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+
+/**
+ * A JAXB unmarshaller for a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessUnmarshaller
+{
+ public Process unmarshallProcess(Reader xml) throws Exception
+ {
+ JAXBContext jaxbContext = JAXBContext.newInstance(Process.class.getPackage().getName());
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ Process proc = (Process)unmarshaller.unmarshal(xml);
+
+ // Set the process reference
+ for (FlowObject fo : proc.getFlowObjects())
+ fo.setProcess(proc);
+
+ return proc;
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 11 months
JBoss JBPM SVN: r1572 - maven/parent/trunk.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 10:07:45 -0400 (Thu, 10 Jul 2008)
New Revision: 1572
Modified:
maven/parent/trunk/pom.xml
Log:
Add ProcessMarshaller/Unmarshaller
Modified: maven/parent/trunk/pom.xml
===================================================================
--- maven/parent/trunk/pom.xml 2008-07-10 14:07:40 UTC (rev 1571)
+++ maven/parent/trunk/pom.xml 2008-07-10 14:07:45 UTC (rev 1572)
@@ -126,6 +126,7 @@
</dependencies>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2.SP1</version>
</plugin>
15 years, 11 months
JBoss JBPM SVN: r1571 - in api/trunk/modules: api/scripts and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 10:07:40 -0400 (Thu, 10 Jul 2008)
New Revision: 1571
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
Modified:
api/trunk/modules/api/pom.xml
api/trunk/modules/api/scripts/antrun-schemagen.xml
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
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/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/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java
Log:
Add ProcessMarshaller/Unmarshaller
Modified: api/trunk/modules/api/pom.xml
===================================================================
--- api/trunk/modules/api/pom.xml 2008-07-10 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/pom.xml 2008-07-10 14:07:40 UTC (rev 1571)
@@ -69,11 +69,12 @@
<destdir>target/schema</destdir>
<schemas>
<schema>
- <namespace>org.jboss.bpm.api</namespace>
+ <namespace>http://org.jboss.bpm.api</namespace>
<file>jbpm-api.xsd</file>
</schema>
</schemas>
<includes>
+ <include>package-info.java</include>
<include>Activity.java</include>
<include>ComplexGateway.java</include>
<include>EndEvent.java</include>
Modified: api/trunk/modules/api/scripts/antrun-schemagen.xml
===================================================================
--- api/trunk/modules/api/scripts/antrun-schemagen.xml 2008-07-10 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/scripts/antrun-schemagen.xml 2008-07-10 14:07:40 UTC (rev 1571)
@@ -23,7 +23,8 @@
<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"/>
+ <schema namespace="http://org.jboss.bpm.api" file="jbpm-api.xsd"/>
+ <include name="package-info.java"/>
<include name="Activity.java"/>
<include name="ComplexGateway.java"/>
<include name="EndEvent.java"/>
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-10 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -23,14 +23,19 @@
// $Id$
+import java.io.File;
+import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.EngineShutdownException;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.util.ProcessMarshaller;
/**
* The process manager is the entry point to create, find and otherwise manage processes.
@@ -40,6 +45,9 @@
*/
public abstract class ProcessManager
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ProcessManager.class);
+
// Injected through the MC
protected ProcessEngine engine;
// The set of process definitions
@@ -50,7 +58,7 @@
{
}
- /* Get the associated process engine */
+ /* Get the associated process engine */
public ProcessEngine getProcessEngine()
{
if (engine == null)
@@ -59,7 +67,7 @@
return engine;
}
- /* Locate the process definition manager */
+ /* Locate the process definition manager */
public static ProcessManager locateProcessManager()
{
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
@@ -74,17 +82,13 @@
// TODO: test this
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
-
- Process pd = createProcessOverride(procDescriptor);
- return pd;
+
+ Process proc = createProcessOverride(procDescriptor);
+ marshallProcess(proc);
+ return proc;
}
/*
- * Override to implement process definition creation
- */
- protected abstract Process createProcessOverride(String procDescriptor);
-
- /*
* Create a process defintion from an URL to a XML descritor in one of the supported formats
*/
public final Process createProcess(URL procURL) throws IOException
@@ -92,11 +96,32 @@
// TODO: test this
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
-
- Process pd = createProcessOverride(procURL);
- return pd;
+
+ Process proc = createProcessOverride(procURL);
+ marshallProcess(proc);
+ return proc;
}
+ /**
+ * Override to implement process definition creation
+ */
+ protected abstract Process createProcessOverride(String procDescriptor);
+
+ private void marshallProcess(Process proc)
+ {
+ try
+ {
+ File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
+ ProcessMarshaller marshaller = new ProcessMarshaller();
+ marshaller.marshallProcess(proc, new FileWriter(file));
+ log.info("Generated: " + file);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot marshall: " + proc);
+ }
+ }
+
/*
* Override to implement process definition creation
*/
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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -33,9 +33,24 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="Activity")
+@XmlType(name="Activity")
public abstract class Activity extends NamedFlowObject
{
+ /**
+ * Construct an anonymous Activity
+ */
+ public Activity()
+ {
+ }
+
+ /**
+ * Construct a Activity with a given name
+ */
+ public Activity(String name)
+ {
+ super(name);
+ }
+
/**
* Call to initialize fully
* Note, this MUST NOT leak into the public API.
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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="ComplexGateway")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="EndEvent")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="Event")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="ExclusiveGateway")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="FlowObject")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="Gateway")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="InclusiveGateway")
+@XmlType(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/ItermediateEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-10 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="ItermediateEvent")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -21,36 +21,49 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
//$Id$
-
/**
- * A Flow Object with a name
+ * A Flow Object with a name
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="NamedFlowObject")
+@XmlType(name = "NamedFlowObject")
public abstract class NamedFlowObject extends FlowObject
{
- @XmlElement
+ @XmlAttribute(required = true)
private String name;
+
+ /**
+ * Construct an anonymous NamedFlowObject
+ */
+ public NamedFlowObject()
+ {
+ }
+
+ /**
+ * Construct a NamedFlowObject with a given name
+ */
+ public NamedFlowObject(String name)
+ {
+ this.name = name;
+ }
- /**
- * Get the name
+ /**
+ * Get the name
*/
public String getName()
{
return name;
}
-
- /**
- * Set the name
- * Note, this MUST NOT leak into the public API.
+
+ /**
+ * Set the name Note, this MUST NOT leak into the public API.
*/
// TODO
@XmlTransient
@@ -58,7 +71,7 @@
{
if (this.name != null)
throw new IllegalStateException("Cannot rename: " + name);
-
+
this.name = name;
}
}
\ No newline at end of file
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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="ParallelGateway")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -21,9 +21,9 @@
*/
package org.jboss.bpm.model;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -40,7 +40,6 @@
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.runtime.Attachments;
-
// $Id$
/**
@@ -49,17 +48,31 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="Process")
-@XmlRootElement(namespace="org.jboss.bpm.api", name="process")
+@XmlType(name = "Process")
+@XmlRootElement(name = "process")
public class Process extends Activity
{
- @XmlElement
- protected Set<FlowObject> flowObjects = new HashSet<FlowObject>();
-
- /**
- * Call to initialize fully
- * Note, this MUST NOT leak into the public API.
+ @XmlElement(name = "flowObject")
+ protected List<FlowObject> flowObjects = new ArrayList<FlowObject>();
+
+ /**
+ * Construct an anonymous process
*/
+ public Process()
+ {
+ }
+
+ /**
+ * Construct a process with a given name
+ */
+ public Process(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Call to initialize fully Note, this MUST NOT leak into the public API.
+ */
protected void init(String name)
{
if (name == null)
@@ -69,10 +82,9 @@
setName(name);
}
}
-
- /**
- * Add a flow object
- * Note, this MUST NOT leak into the public API.
+
+ /**
+ * Add a flow object Note, this MUST NOT leak into the public API.
*/
protected void addFlowObject(FlowObject flowObject)
{
@@ -88,9 +100,9 @@
flowObjects.add(flowObject);
}
-
- /**
- * Get the start event
+
+ /**
+ * Get the start event
*/
@XmlTransient
public StartEvent getStartEvent()
@@ -115,21 +127,21 @@
}
return start;
}
-
+
/** Get the set of end events */
@XmlTransient
- public Set<EndEvent> getEndEvents()
+ public List<EndEvent> getEndEvents()
{
- Set<EndEvent> ends = getEndEventsInternal();
+ List<EndEvent> ends = getEndEventsInternal();
if (ends.size() == 0)
throw new InvalidProcessException("Process does not have end events");
return ends;
}
- private Set<EndEvent> getEndEventsInternal()
+ private List<EndEvent> getEndEventsInternal()
{
- Set<EndEvent> ends = new HashSet<EndEvent>();
+ List<EndEvent> ends = new ArrayList<EndEvent>();
for (FlowObject aux : flowObjects)
{
if (aux instanceof EndEvent)
@@ -139,28 +151,29 @@
}
return ends;
}
-
+
/** Get the set of flow objects */
- public Set<FlowObject> getFlowObjects()
+ public List<FlowObject> getFlowObjects()
{
- return Collections.unmodifiableSet(flowObjects);
+ return Collections.unmodifiableList(flowObjects);
}
-
+
/** Start the process */
public Future<Result> startProcess()
{
return startProcess(null);
}
-
+
/** Start the process, with a given execution context */
public Future<Result> startProcess(Attachments att)
{
execute(new InitialToken(this, att));
return new ResultFuture();
}
-
- /**
+
+ /**
* Find a flow object by name
+ *
* @return null if not found
*/
public NamedFlowObject findFlowObject(String name)
@@ -176,9 +189,9 @@
}
return nfo;
}
-
- /**
- * Get signal for enter
+
+ /**
+ * Get signal for enter
*/
@Override
public Signal getEnterSignal()
@@ -186,8 +199,8 @@
return new Signal(this, Signal.Type.ENTER_PROCESS);
}
- /**
- * Get signal for exit
+ /**
+ * Get signal for exit
*/
@Override
public Signal getExitSignal()
@@ -229,7 +242,7 @@
{
if (result == null)
{
- Set<EndEvent> ends = getEndEventsInternal();
+ List<EndEvent> ends = getEndEventsInternal();
for (EndEvent aux : ends)
{
result = aux.getResult();
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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -37,7 +37,7 @@
public class Signal
{
// @XmlTransient does not work with jaxb-2.1.7
- @XmlType(namespace="org.jboss.bpm.api", name="SignalType")
+ @XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -21,10 +21,9 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlType;
-
//$Id$
+import javax.xml.bind.annotation.XmlType;
/**
* A Start Event indicates where a particular Process will start.
@@ -35,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="StartEvent")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="SubProcess")
+@XmlType(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 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -34,9 +34,24 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(namespace="org.jboss.bpm.api", name="Task")
+@XmlType(name="Task")
public class Task extends Activity
{
+ /**
+ * Construct an anonymous Task
+ */
+ public Task()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ */
+ public Task(String name)
+ {
+ super(name);
+ }
+
/** Get signal for enter */
public Signal getEnterSignal()
{
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/jaxb.index 2008-07-10 14:07:40 UTC (rev 1571)
@@ -0,0 +1,16 @@
+Activity
+ComplexGateway
+EndEvent
+Event
+ExclusiveGateway
+FlowObject
+Gateway
+InclusiveGateway
+ItermediateEvent
+NamedFlowObject
+ParallelGateway
+Process
+Signal
+StartEvent
+SubProcess
+Task
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+@XmlSchema(namespace="http://org.jboss.bpm.api")
+package org.jboss.bpm.model;
+
+import javax.xml.bind.annotation.XmlSchema;
+
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java (rev 0)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -0,0 +1,68 @@
+/*
+ * 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.jboss.bpm.model;
+
+// $Id$
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import junit.framework.TestCase;
+
+import org.jboss.bpm.util.ProcessMarshaller;
+import org.jboss.bpm.util.ProcessUnmarshaller;
+
+/**
+ * Test JAXB marshalling of the process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessMarshallerTest extends TestCase
+{
+ public void testProcess() throws Exception
+ {
+ Process inProc = new Process("myproc");
+ inProc.addFlowObject(new StartEvent());
+ inProc.addFlowObject(new Task("mytask"));
+ inProc.addFlowObject(new EndEvent());
+
+ StringWriter strwr = new StringWriter();
+ ProcessMarshaller marshaller = new ProcessMarshaller();
+ marshaller.marshallProcess(inProc, strwr);
+ String xml = strwr.toString();
+
+ //System.out.println(xml);
+
+ ProcessUnmarshaller unmarshaller = new ProcessUnmarshaller();
+ Process outProc = unmarshaller.unmarshallProcess(new StringReader(xml));
+
+ assertEquals(inProc.getName(), outProc.getName());
+ assertNotNull(outProc.getStartEvent());
+ assertEquals(outProc, outProc.getStartEvent().getProcess());
+ assertNotNull(outProc.findFlowObject("mytask"));
+ assertEquals(outProc, outProc.findFlowObject("mytask").getProcess());
+ assertEquals(1, outProc.getEndEvents().size());
+ assertNotNull(outProc.getEndEvents().get(0));
+ assertEquals(outProc, outProc.getEndEvents().get(0).getProcess());
+ }
+}
Property changes on: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java 2008-07-10 12:13:06 UTC (rev 1570)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java 2008-07-10 14:07:40 UTC (rev 1571)
@@ -23,16 +23,10 @@
// $Id$
-import java.util.Set;
+import java.util.List;
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.EndEvent;
-import org.jboss.bpm.model.FlowObject;
-import org.jboss.bpm.model.NamedFlowObject;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.model.Task;
import org.jboss.bpm.test.DefaultEngineTestCase;
public class ProcessTest extends DefaultEngineTestCase
@@ -58,14 +52,14 @@
StartEvent start = proc.getStartEvent();
assertNotNull("Start expected", start);
- Set<FlowObject> fos = proc.getFlowObjects();
+ List<FlowObject> fos = proc.getFlowObjects();
assertEquals(3, fos.size());
NamedFlowObject nfo = proc.findFlowObject("stateA");
assertNotNull("FlowObject expected", nfo);
assertTrue("Task expected", nfo instanceof Task);
- Set<EndEvent> ends = proc.getEndEvents();
+ List<EndEvent> ends = proc.getEndEvents();
assertEquals(1, ends.size());
}
15 years, 11 months
JBoss JBPM SVN: r1570 - in jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command: ws2 and 1 other directory.
by do-not-reply@jboss.org
Author: salaboy21
Date: 2008-07-10 08:13:06 -0400 (Thu, 10 Jul 2008)
New Revision: 1570
Added:
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceFacade.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceImpl.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessDefinitionRef.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessInstanceRef.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessRequest.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/SignalRequest.java
jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/TokenRef.java
Log:
New webservices implementation, new extended methods
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceFacade.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceFacade.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceFacade.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,67 @@
+/*
+ * 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.command.ws2;
+
+import java.util.List;
+
+/**
+ * JPDL web service interface
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ */
+
+
+public interface JPDLWebServiceFacade
+{
+ /**
+ * Creates a new process instance and return the initla token.
+ * If it should be started the default transition is used.
+ *
+ * @param processRequest process reference info
+ * @return a token reference
+ */
+ // TokenRef newProcessInstance(ProcessRequest processRequest);
+
+ ProcessInstanceRef newProcessInstance(ProcessRequest processRequest);
+
+ /**
+ * Signals a token to proceed with (an optional) transition.
+ *
+ * @param signalRequest
+ * @return a token reference
+ */
+ TokenRef signal(SignalRequest signalRequest);
+
+ /**
+ * Cancel a process .
+ *
+ * @param processRequest process reference info (name)
+ * @return true if the operation success
+ */
+ public boolean cancelProcessInstance(ProcessInstanceRef processRef);
+
+
+ public void setProcessVariable(ProcessInstanceRef processRef,String variableName,Object value);
+
+ public List<ProcessDefinitionRef> getProcessDefinitions(boolean onlyLatest);
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceFacade.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceImpl.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,206 @@
+/*
+ * 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.command.ws2;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.JbpmException;
+import org.jbpm.command.CancelProcessInstanceCommand;
+import org.jbpm.command.Command;
+import org.jbpm.command.GetProcessDefinitionsCommand;
+import org.jbpm.command.GetProcessInstancesCommand;
+import org.jbpm.command.NewProcessInstanceCommand;
+import org.jbpm.command.SignalCommand;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.VariablesCommand;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.w3c.dom.Element;
+
+
+/**
+ * Web service frontend to the command facade
+ *
+ * @author Heiko.Braun(a)jboss.com
+ */
+@WebService()
+//@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public class JPDLWebServiceImpl implements JPDLWebServiceFacade
+{
+ private static Log log = LogFactory.getLog(JPDLWebServiceImpl.class);
+
+
+
+ @WebMethod()
+ public ProcessInstanceRef newProcessInstance(ProcessRequest processRequest)
+ {
+ log.debug("New process " + processRequest.getProcessDefinitionName());
+
+ // we either start it immediatley or just create the process instance
+ NewProcessInstanceCommand cmd = processRequest.isStart() ?
+ new StartProcessInstanceCommand() : new NewProcessInstanceCommand();
+ cmd.setProcessName( processRequest.getProcessDefinitionName() );
+ //I must be able to add the version of the process definition that i want... Salaboy
+ Object result = executeCommand(cmd);
+ ProcessInstanceRef processRef=new ProcessInstanceRef((ProcessInstance)result);
+
+ return processRef;
+ }
+
+
+
+ @WebMethod()
+ public TokenRef signal(SignalRequest signalRequest)
+ {
+ log.debug("Signal token " + signalRequest.getTokenId());
+
+ SignalCommand cmd = new SignalCommand(
+ signalRequest.getTokenId(),
+ signalRequest.getTransitionName()
+ );
+
+ // Associate process variables
+ addProcessVariables(cmd, signalRequest);
+
+ Token token = (Token)executeCommand(cmd);
+
+ return new TokenRef(token);
+
+ }
+ @SuppressWarnings("unchecked")
+ @WebMethod()
+ public List<ProcessDefinitionRef> getProcessDefinitions(boolean onlyLatest) {
+ GetProcessDefinitionsCommand cmd=new GetProcessDefinitionsCommand();
+ cmd.setOnlyLatest(onlyLatest);
+
+ List<ProcessDefinition> processDefs=(List<ProcessDefinition>) executeCommand(cmd);
+ List<ProcessDefinitionRef> result=new ArrayList<ProcessDefinitionRef>();
+ for (ProcessDefinition processDefinition : processDefs) {
+ result.add(new ProcessDefinitionRef(processDefinition.getName(),processDefinition.getVersion()));
+ }
+ return result;
+
+ }
+
+
+ @SuppressWarnings("unchecked")
+ @WebMethod()
+ public List<ProcessInstanceRef> getProcessInstances(ProcessDefinitionRef processDefinitionRef) {
+ GetProcessInstancesCommand cmd=new GetProcessInstancesCommand();
+ cmd.setProcessName(processDefinitionRef.getProcessDefinitionName());
+
+
+ List<ProcessInstance> processInstances=(List<ProcessInstance>) executeCommand(cmd);
+ List<ProcessInstanceRef> result=new ArrayList<ProcessInstanceRef>();
+ for (ProcessInstance processInstance : processInstances) {
+ result.add(new ProcessInstanceRef(processInstance.getId(),
+ processInstance.getProcessDefinition().getName(),
+ processInstance.getProcessDefinition().getVersion(),
+ processInstance.getRootToken().getId(),
+ processInstance.getRootToken().getNode().getName()));
+ }
+ return result;
+
+ }
+
+
+ @WebMethod()
+ public boolean cancelProcessInstance(ProcessInstanceRef processInstanceRef){
+ CancelProcessInstanceCommand cmd=new CancelProcessInstanceCommand();
+ cmd.setProcessId(processInstanceRef.getProcessInstanceId());
+
+ executeCommand(cmd);
+
+ return true;
+
+ }
+
+ //REVIEW!!!!!! AND TEST!!!! NOT FINISHED!!!
+ @WebMethod()
+ public void setProcessVariable(ProcessInstanceRef processRef,String variableName,Object value){
+ VariablesCommand cmd=new VariablesCommand();
+ Map<String,Object> variables=new HashMap<String,Object>();
+ variables.put(variableName, value);
+ cmd.setVariables(variables);
+ executeCommand(cmd);
+ }
+
+
+
+
+ private void addProcessVariables(SignalCommand cmd, SignalRequest signalRequest)
+ {
+ if(signalRequest.getAny()!=null && !signalRequest.getAny().isEmpty())
+ {
+ Map vars = new HashMap( signalRequest.getAny().size() );
+ cmd.setVariables(vars);
+
+ for(Element el : signalRequest.getAny() )
+ {
+ String name = el.getNodeName();
+ String value = el.getTextContent(); // TODO: type conversion
+
+ cmd.getVariables().put( name, value );
+ }
+ }
+ }
+
+ private Object executeCommand(Command command)
+ {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ Object result = null;
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try
+ {
+ log.debug("Executing " + command);
+ result = command.execute(jbpmContext);
+ }
+ catch (Exception e)
+ {
+ throw new JbpmException(
+ "Failed to execute '" + command + "': " + e.getMessage(), e
+ );
+ }
+ finally
+ {
+ jbpmContext.close();
+ }
+
+ return result;
+ }
+
+
+
+
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/JPDLWebServiceImpl.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessDefinitionRef.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessDefinitionRef.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessDefinitionRef.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,87 @@
+/*
+ * 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.command.ws2;
+
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.Token;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Reference info about a token
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ *
+ */
+
+@XmlType(
+ name = "processDefinitionReference",
+ namespace = "http://jbpm.org/jpdl/ws/01/2008/"
+)
+public class ProcessDefinitionRef
+{
+ String processDefinitionName;
+ long processVersion;
+
+
+ public ProcessDefinitionRef()
+ {
+ }
+
+ public ProcessDefinitionRef(String processDefinitionName, long processVersion)
+ {
+ this.processDefinitionName = processDefinitionName;
+ this.processVersion = processVersion;
+
+ }
+
+ public ProcessDefinitionRef(ProcessDefinition processDefinition)
+ {
+ this(
+ processDefinition.getName(),
+ processDefinition.getId()
+
+ );
+ }
+
+ public String getProcessDefinitionName() {
+ return processDefinitionName;
+ }
+
+ public void setProcessDefinitionName(String processDefinitionName) {
+ this.processDefinitionName = processDefinitionName;
+ }
+
+ public long getProcessVersion() {
+ return processVersion;
+ }
+
+ public void setProcessVersion(long processVersion) {
+ this.processVersion = processVersion;
+ }
+
+
+
+
+
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessDefinitionRef.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessInstanceRef.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessInstanceRef.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessInstanceRef.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,100 @@
+/*
+ * 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.command.ws2;
+
+import org.jbpm.graph.exe.Token;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Reference info about a token
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ */
+@XmlType(
+ name = "processInstanceReference",
+ namespace = "http://jbpm.org/jpdl/ws/01/2008/"
+)
+public class ProcessInstanceRef
+{
+
+ long processInstanceId;
+
+ ProcessDefinitionRef processDefinition;
+ TokenRef token;
+
+ public ProcessInstanceRef()
+ {
+ }
+
+ public ProcessInstanceRef(long processInstanceId, String processDefinitionName,long processVersion,long tokenId,String nodeName)
+ {
+
+ this.processInstanceId = processInstanceId;
+ this.processDefinition = new ProcessDefinitionRef(processDefinitionName,processVersion);
+ this.token = new TokenRef(tokenId,nodeName);
+ }
+
+ public ProcessInstanceRef(org.jbpm.graph.exe.ProcessInstance processInstance)
+ {
+ this(
+ processInstance.getId(),
+ processInstance.getProcessDefinition().getName(),
+ processInstance.getVersion(),
+ processInstance.getRootToken().getId(),
+ processInstance.getRootToken().getNode().getName()
+
+ );
+ }
+
+
+
+ public long getProcessInstanceId()
+ {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(long processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
+
+
+ public TokenRef getToken() {
+ return token;
+ }
+
+ public void setToken(TokenRef token) {
+ this.token = token;
+ }
+
+ public ProcessDefinitionRef getProcessDefinition() {
+ return processDefinition;
+ }
+
+ public void setProcessDefinition(ProcessDefinitionRef processDefinition) {
+ this.processDefinition = processDefinition;
+ }
+
+
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessInstanceRef.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessRequest.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessRequest.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessRequest.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,84 @@
+/*
+ * 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.command.ws2;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * All that you need about a Process
+ *
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ *
+ */
+
+@XmlType(
+ name = "processRequest",
+ namespace = "http://jbpm.org/jpdl/ws/01/2008/"
+)
+public class ProcessRequest
+{
+ private String processDefinitionName;
+ private long version;
+ private boolean start;
+
+ public ProcessRequest()
+ {
+ }
+
+ public ProcessRequest(String processDefinitionName, boolean start)
+ {
+ this.processDefinitionName = processDefinitionName;
+ this.start = start;
+ }
+
+ @XmlElement(required = true)
+ public String getProcessDefinitionName()
+ {
+ return processDefinitionName;
+ }
+
+ public void setProcessDefinitionName(String processDefinitionName)
+ {
+ this.processDefinitionName = processDefinitionName;
+ }
+
+ @XmlAttribute(name = "start", required = false)
+ public boolean isStart()
+ {
+ return start;
+ }
+
+ public void setStart(boolean start)
+ {
+ this.start = start;
+ }
+
+ public long getVersion() {
+ return version;
+ }
+
+ public void setVersion(long version) {
+ this.version = version;
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/ProcessRequest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/SignalRequest.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/SignalRequest.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/SignalRequest.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,92 @@
+/*
+ * 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.command.ws2;
+
+/**
+ * All that you need to make a signal
+ *
+ *
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ *
+ */
+import org.w3c.dom.Element;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import java.util.List;
+
+@XmlType
+ (
+ name = "signalRequest",
+ namespace = "http://jbpm.org/jpdl/ws/01/2008/"
+)
+public class SignalRequest
+{
+ private long tokenId;
+ private String transitionName;
+ private List<Element> any;
+
+ public SignalRequest()
+ {
+ }
+
+ public SignalRequest(long tokenId, String transitionName)
+ {
+ this.tokenId = tokenId;
+ this.transitionName = transitionName;
+ }
+
+ @XmlAttribute(required = true)
+ public long getTokenId()
+ {
+ return tokenId;
+ }
+
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
+
+ @XmlElement(required = false)
+ public String getTransitionName()
+ {
+ return transitionName;
+ }
+
+ public void setTransitionName(String transitionName)
+ {
+ this.transitionName = transitionName;
+ }
+
+ @XmlAnyElement
+ public List<Element> getAny()
+ {
+ return any;
+ }
+
+ public void setAny(List<Element> any)
+ {
+ this.any = any;
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/SignalRequest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/TokenRef.java
===================================================================
--- jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/TokenRef.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/TokenRef.java 2008-07-10 12:13:06 UTC (rev 1570)
@@ -0,0 +1,87 @@
+/*
+ * 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.command.ws2;
+
+import org.jbpm.graph.exe.Token;
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Reference info about a token
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author Salaboy21 (mailto:salaboy@gmail.com)
+ *
+ */
+@XmlType(
+ name = "tokenReference",
+ namespace = "http://jbpm.org/jpdl/ws/01/2008/"
+)
+public class TokenRef
+{
+ long tokenId;
+ String nodeName;
+
+
+ public TokenRef()
+ {
+ }
+
+ public TokenRef(long tokenId, String nodeName)
+ {
+ this.tokenId = tokenId;
+ this.nodeName = nodeName;
+
+ }
+
+ public TokenRef(Token token)
+ {
+ this(
+ token.getId(),
+ token.getNode().getName()
+
+ );
+ }
+
+
+ public long getTokenId()
+ {
+ return tokenId;
+ }
+
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
+
+ public String getNodeName()
+ {
+ return nodeName;
+ }
+
+ public void setNodeName(String nodeName)
+ {
+ this.nodeName = nodeName;
+ }
+
+
+}
Property changes on: jbpm3/trunk/modules/jpdl/ws/src/main/java/org/jbpm/command/ws2/TokenRef.java
___________________________________________________________________
Name: svn:executable
+ *
15 years, 11 months
JBoss JBPM SVN: r1569 - in api/trunk: modules/api and 2 other directories.
by do-not-reply@jboss.org
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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@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")
+@XmlType(namespace="org.jboss.bpm.api", name="Process")
+@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")
+@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")
+@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")
+@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>
15 years, 11 months
JBoss JBPM SVN: r1568 - maven/parent/trunk.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 06:58:23 -0400 (Thu, 10 Jul 2008)
New Revision: 1568
Modified:
maven/parent/trunk/pom.xml
Log:
Add JAXB schemagen plugin
Modified: maven/parent/trunk/pom.xml
===================================================================
--- maven/parent/trunk/pom.xml 2008-07-10 09:12:16 UTC (rev 1567)
+++ maven/parent/trunk/pom.xml 2008-07-10 10:58:23 UTC (rev 1568)
@@ -1,19 +1,14 @@
-<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">
+<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>JBoss jBPM - Parent</name>
<groupId>org.jboss.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
<packaging>pom</packaging>
-
<version>1.0.0-SNAPSHOT</version>
-
<organization>
<name>JBoss, a division of Red Hat</name>
<url>http://www.jboss.org</url>
</organization>
-
<url>http://www.jboss.org/jbossjbpm/</url>
<!-- Properties -->
@@ -44,7 +39,6 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/jbpm/tempranillo</developerConnection>
<url>http://fisheye.jboss.com/browse/JbpmSvn/tempranillo</url>
</scm>
-
<prerequisites>
<maven>2.0.9</maven>
</prerequisites>
@@ -115,6 +109,23 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>com.sun.tools.jxc.maven2</groupId>
+ <artifactId>maven-jaxb-schemagen-plugin</artifactId>
+ <version>1.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2.SP1</version>
</plugin>
@@ -182,6 +193,11 @@
<!-- PluginRepositories -->
<pluginRepositories>
<pluginRepository>
+ <id>maven2.java.net</id>
+ <name>Java.net Repository for Maven 2</name>
+ <url>http://download.java.net/maven/2/</url>
+ </pluginRepository>
+ <pluginRepository>
<id>repository.jboss.org</id>
<url>http://repository.jboss.org/maven2</url>
<snapshots>
@@ -210,4 +226,4 @@
<url>dav:https://snapshots.jboss.org/maven2</url>
</snapshotRepository>
</distributionManagement>
-</project>
+</project>
\ No newline at end of file
15 years, 11 months
JBoss JBPM SVN: r1566 - in jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration: model and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 05:00:27 -0400 (Thu, 10 Jul 2008)
New Revision: 1566
Modified:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
Log:
Use JAXB for API model
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -25,7 +25,7 @@
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.model.Signal;
/**
* An implementation of a signal manager
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -23,9 +23,8 @@
//$Id$
+import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.internal.AbstractEndEvent;
-import org.jboss.bpm.runtime.Token;
import org.jbpm.graph.def.Node;
/**
@@ -34,17 +33,11 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class EndEventImpl extends AbstractEndEvent
+public class EndEventImpl extends EndEvent
{
EndEventImpl(Process proc, Node oldNode)
{
setProcess(proc);
setImplObject(oldNode);
}
-
- @Override
- protected void executeOverwrite(Token token)
- {
- // nothing to do
- }
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -26,10 +26,9 @@
import java.util.List;
import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Task;
-import org.jboss.bpm.model.internal.AbstractFlowObject;
-import org.jboss.bpm.runtime.BasicTask;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.def.Event;
import org.jbpm.graph.def.Node;
@@ -52,7 +51,7 @@
List<org.jbpm.graph.def.Node> oldNodes = oldPD.getNodes();
for (org.jbpm.graph.def.Node oldNode : oldNodes)
{
- AbstractFlowObject flowObject = NodeAdapter.adaptNode(apiProc, oldNode);
+ FlowObject flowObject = NodeAdapter.adaptNode(apiProc, oldNode);
apiProc.addFlowObject(flowObject);
}
@@ -71,9 +70,9 @@
static class NodeAdapter
{
- static AbstractFlowObject adaptNode(Process apiProc, Node oldNode)
+ static FlowObject adaptNode(Process apiProc, Node oldNode)
{
- AbstractFlowObject flowObject;
+ FlowObject flowObject;
if (oldNode instanceof StartState)
{
flowObject = new StartEventImpl(apiProc, oldNode);
@@ -102,11 +101,10 @@
delegate = (Task)obj;
}
flowObject = new TaskImpl(apiProc, oldNode, delegate);
- if (delegate instanceof BasicTask)
+ if (delegate != null)
{
- BasicTask basic = (BasicTask)delegate;
- basic.setProcess(apiProc);
- basic.setName(oldNode.getName());
+ delegate.setProcess(apiProc);
+ delegate.setName(oldNode.getName());
}
}
else
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -25,8 +25,6 @@
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.internal.AbstractFlowObject;
-import org.jboss.bpm.model.internal.AbstractProcess;
import org.jboss.bpm.runtime.Token;
import org.jbpm.graph.def.GraphElement;
import org.jbpm.graph.def.ProcessDefinition;
@@ -38,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class ProcessImpl extends AbstractProcess
+public class ProcessImpl extends Process
{
public ProcessImpl(ProcessDefinition oldPD)
{
@@ -47,7 +45,7 @@
}
// Provide public access
- public void addFlowObject(AbstractFlowObject flowObject)
+ public void addFlowObject(FlowObject flowObject)
{
super.addFlowObject(flowObject);
}
@@ -57,7 +55,7 @@
FlowObject fo = null;
for (FlowObject aux : getFlowObjects())
{
- if (((AbstractFlowObject)aux).getImplObject() == graphElement)
+ if (((FlowObject)aux).getImplObject() == graphElement)
{
fo = aux;
break;
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -24,7 +24,7 @@
//$Id$
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.internal.AbstractStartEvent;
+import org.jboss.bpm.model.StartEvent;
import org.jboss.bpm.runtime.Token;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.GraphElement;
@@ -38,7 +38,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class StartEventImpl extends AbstractStartEvent
+public class StartEventImpl extends StartEvent
{
private Execution oldEx;
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-10 09:00:19 UTC (rev 1565)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-10 09:00:27 UTC (rev 1566)
@@ -25,7 +25,6 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Task;
-import org.jboss.bpm.model.internal.AbstractTask;
import org.jboss.bpm.runtime.Token;
import org.jbpm.graph.def.GraphElement;
import org.jbpm.graph.def.Node;
@@ -36,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class TaskImpl extends AbstractTask
+public class TaskImpl extends Task
{
private Task delegate;
@@ -72,10 +71,4 @@
super.execute(token);
}
}
-
- @Override
- protected void executeOverwrite(Token token)
- {
- // nothing to do
- }
}
15 years, 11 months
JBoss JBPM SVN: r1565 - in api/trunk: modules/api and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-10 05:00:19 -0400 (Thu, 10 Jul 2008)
New Revision: 1565
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java
Modified:
api/trunk/modules/api/pom.xml
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
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/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/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/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
api/trunk/pom.xml
Log:
Use JAXB for API model
Modified: api/trunk/modules/api/pom.xml
===================================================================
--- api/trunk/modules/api/pom.xml 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/pom.xml 2008-07-10 09:00:19 UTC (rev 1565)
@@ -10,11 +10,8 @@
<!-- ====================================================================== -->
<!-- $Id$ -->
-
-<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">
+<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>JBoss jBPM - API Source</name>
<groupId>org.jboss.jbpm</groupId>
<artifactId>jbpm-api</artifactId>
@@ -33,6 +30,10 @@
<!-- Compile Dependencies -->
<dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
@@ -61,5 +62,4 @@
</plugin>
</plugins>
</reporting>
-
</project>
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -30,7 +30,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.SignalListener;
/**
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,8 +21,8 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
-
// $Id$
/**
@@ -33,6 +33,20 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Activity extends NamedFlowObject
+@XmlType(name="Activity")
+public abstract class Activity extends NamedFlowObject
{
+ /**
+ * Call to initialize fully
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected void init(String name)
+ {
+ if (name == null)
+ {
+ Process proc = getProcess();
+ name = "AnonymousActivity#" + proc.getFlowObjects().size();
+ setName(name);
+ }
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -34,6 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ComplexGateway extends Gateway
+@XmlType(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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,13 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.Token;
+
+
// $Id$
/**
@@ -34,8 +40,42 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface EndEvent extends Event
+@XmlType(name="EndEvent")
+public class EndEvent extends Event
{
+ @XmlTransient
+ private Result result;
+
/** Get the result */
- Result getResult();
+ public Result getResult()
+ {
+ return result;
+ }
+
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ }
+
+ @Override
+ public void execute(final Token token)
+ {
+ super.execute(token);
+
+ // Provide the result
+ result = new Result()
+ {
+ public Attachments getAttachments()
+ {
+ return token.getExecutionContext();
+ }
+ };
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,8 +21,10 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -32,6 +34,22 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Event extends FlowObject
+@XmlType(name="Event")
+public abstract class Event extends FlowObject
{
+ /**
+ * Get signal for enter
+ */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_EVENT);
+ }
+
+ /**
+ * Get signal for exit
+ */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_EVENT);
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -30,6 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ExclusiveGateway extends Gateway
+@XmlType(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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,10 @@
*/
package org.jboss.bpm.model;
-import org.jboss.bpm.runtime.Signal;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.runtime.Token;
//$Id$
@@ -32,17 +35,90 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface FlowObject
+@XmlType(name="FlowObject")
+public abstract class FlowObject
{
- /** Get the associated Process */
- Process getProcess();
+ @XmlTransient
+ protected Process process;
+ @XmlTransient
+ private Object implObject;
+
+ /**
+ * Get the associated Process
+ */
+ public Process getProcess()
+ {
+ return process;
+ }
- /** Get signal for enter */
- Signal getEnterSignal();
+ /**
+ * Get signal for enter
+ */
+ @XmlTransient
+ public abstract Signal getEnterSignal();
- /** Get signal for exit */
- Signal getExitSignal();
+ /**
+ * Get signal for exit
+ */
+ @XmlTransient
+ public abstract Signal getExitSignal();
- /** Execute this flow object*/
- void execute(Token token);
+ /**
+ * Set the associated process
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlTransient
+ // TODO
+ public void setProcess(Process process)
+ {
+ if (this.process != null)
+ throw new IllegalStateException("Cannot reassign task to process");
+
+ this.process = process;
+ }
+
+ /**
+ * Set the associated implementation object
+ * Note, this MUST NOT leak into the public API.
+ */
+ // TODO
+ public Object getImplObject()
+ {
+ return implObject;
+ }
+
+ /**
+ * Get the associated implementation object
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected void setImplObject(Object implObject)
+ {
+ this.implObject = implObject;
+ }
+
+ /**
+ * Execute this flow object
+ */
+ public void execute(Token token)
+ {
+ SignalManager sm = SignalManager.locateSignalManager();
+ try
+ {
+ sm.throwSignal(getEnterSignal());
+ executeOverwrite(token);
+ }
+ finally
+ {
+ sm.throwSignal(getExitSignal());
+ }
+ }
+
+ /**
+ * Overwrite to provide an actual implemenation
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected void executeOverwrite(Token token)
+ {
+ // nothing to do
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,8 +21,10 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -32,6 +34,18 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Gateway extends FlowObject
+@XmlType(name="Gateway")
+public abstract class Gateway extends FlowObject
{
+ @Override
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_GATEWAY);
+ }
+
+ @Override
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -32,6 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface InclusiveGateway extends Gateway
+@XmlType(name="InclusiveGateway")
+public class InclusiveGateway extends Gateway
{
}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java (from rev 1564, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InitialToken.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -0,0 +1,65 @@
+/*
+ * 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.jboss.bpm.model;
+
+// $Id$
+
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.BasicAttachments;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * An initial token
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+class InitialToken implements Token
+{
+ private Process proc;
+ private ExecutionContext context;
+
+ public InitialToken(Process proc, Attachments att)
+ {
+ this.proc = proc;
+ this.context = new InitialContext(att);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ class InitialContext extends BasicAttachments implements ExecutionContext
+ {
+ InitialContext(Attachments att)
+ {
+ super(att);
+ }
+ }
+}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -34,6 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ItermediateEvent extends Event
+@XmlType(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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,6 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
//$Id$
@@ -30,8 +33,30 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface NamedFlowObject extends FlowObject
+@XmlType(name="NamedFlowObject")
+public abstract class NamedFlowObject extends FlowObject
{
- /** Get the name */
- String getName();
+ @XmlElement
+ private String name;
+
+ /**
+ * Get the name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name
+ * Note, this MUST NOT leak into the public API.
+ */
+ // TODO
+ public void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename: " + name);
+
+ this.name = name;
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -30,6 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ParallelGateway extends Gateway
+@XmlType(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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,9 +21,23 @@
*/
package org.jboss.bpm.model;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NameNotUniqueException;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.runtime.Attachments;
@@ -35,26 +49,197 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Process extends Activity
+@XmlType(name="Process")
+@XmlRootElement(name="process")
+public class Process extends Activity
{
- /** Start the process */
- Future<Result> startProcess();
+ @XmlElement
+ protected Set<FlowObject> flowObjects = new HashSet<FlowObject>();
- /** Start the process, with a given execution context */
- Future<Result> startProcess(Attachments att);
+ /**
+ * Call to initialize fully
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected void init(String name)
+ {
+ if (name == null)
+ {
+ ProcessManager pdm = ProcessManager.locateProcessManager();
+ name = "AnonymousProcess#" + pdm.getProcesses().size();
+ setName(name);
+ }
+ }
- /** Get the start event */
- StartEvent getStartEvent();
+ /**
+ * Add a flow object
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected void addFlowObject(FlowObject flowObject)
+ {
+ if (flowObject instanceof StartEvent && getStartEventInternal() != null)
+ throw new InvalidProcessException("Process cannot have multiple start events: " + flowObject);
+
+ if (flowObject instanceof NamedFlowObject)
+ {
+ String name = ((NamedFlowObject)flowObject).getName();
+ if (findFlowObject(name) != null)
+ throw new NameNotUniqueException("NamedFlowObject: " + name);
+ }
+
+ flowObjects.add(flowObject);
+ }
+ /**
+ * Get the start event
+ */
+ @XmlTransient
+ public StartEvent getStartEvent()
+ {
+ StartEvent start = getStartEventInternal();
+ if (start == null)
+ throw new InvalidProcessException("Process does not have a start event");
+
+ return start;
+ }
+
+ private StartEvent getStartEventInternal()
+ {
+ StartEvent start = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof StartEvent)
+ {
+ start = (StartEvent)aux;
+ break;
+ }
+ }
+ return start;
+ }
+
/** Get the set of end events */
- Set<EndEvent> getEndEvents();
+ @XmlTransient
+ public Set<EndEvent> getEndEvents()
+ {
+ Set<EndEvent> ends = getEndEventsInternal();
+ if (ends.size() == 0)
+ throw new InvalidProcessException("Process does not have end events");
+
+ return ends;
+ }
+
+ private Set<EndEvent> getEndEventsInternal()
+ {
+ Set<EndEvent> ends = new HashSet<EndEvent>();
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof EndEvent)
+ {
+ ends.add((EndEvent)aux);
+ }
+ }
+ return ends;
+ }
/** Get the set of flow objects */
- Set<FlowObject> getFlowObjects();
+ public Set<FlowObject> getFlowObjects()
+ {
+ return Collections.unmodifiableSet(flowObjects);
+ }
+ /** Start the process */
+ public Future<Result> startProcess()
+ {
+ return startProcess(null);
+ }
+
+ /** Start the process, with a given execution context */
+ public Future<Result> startProcess(Attachments att)
+ {
+ execute(new InitialToken(this, att));
+ return new ResultFuture();
+ }
+
/**
* Find a flow object by name
* @return null if not found
*/
- NamedFlowObject findFlowObject(String name);
+ public NamedFlowObject findFlowObject(String name)
+ {
+ NamedFlowObject nfo = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof NamedFlowObject && ((NamedFlowObject)aux).getName().equals(name))
+ {
+ nfo = (NamedFlowObject)aux;
+ break;
+ }
+ }
+ return nfo;
+ }
+
+ /**
+ * Get signal for enter
+ */
+ @Override
+ public Signal getEnterSignal()
+ {
+ return new Signal(this, Signal.Type.ENTER_PROCESS);
+ }
+
+ /**
+ * Get signal for exit
+ */
+ @Override
+ public Signal getExitSignal()
+ {
+ return new Signal(this, Signal.Type.EXIT_PROCESS);
+ }
+
+ @XmlTransient
+ class ResultFuture implements Future<Result>
+ {
+ private Result result;
+
+ public boolean cancel(boolean mayInterruptIfRunning)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Result get() throws InterruptedException, ExecutionException
+ {
+ return getResult();
+ }
+
+ public Result get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean isCancelled()
+ {
+ return false;
+ }
+
+ public boolean isDone()
+ {
+ return getResult() != null;
+ }
+
+ private Result getResult()
+ {
+ if (result == null)
+ {
+ Set<EndEvent> ends = getEndEventsInternal();
+ for (EndEvent aux : ends)
+ {
+ result = aux.getResult();
+ if (result != null)
+ {
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java (from rev 1561, api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -0,0 +1,98 @@
+/*
+ * 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.jboss.bpm.model;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+//$Id$
+
+
+/**
+ * A Signal thrown by the ProcessEngine
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlTransient
+public class Signal
+{
+ @XmlType(name="SignalType")
+ public enum Type
+ {
+ ENTER_START_EVENT, EXIT_START_EVENT,
+ ENTER_EVENT, EXIT_EVENT,
+ ENTER_END_EVENT, EXIT_END_EVENT,
+ ENTER_GATEWAY, EXIT_GATEWAY,
+ ENTER_PROCESS, EXIT_PROCESS,
+ ENTER_SUB_PROCESS, EXIT_SUB_PROCESS,
+ ENTER_TASK, EXIT_TASK,
+ USER_SIGNAL
+ }
+
+ private Process proc;
+ private Type type;
+ private String message;
+
+ /** Create the signal for a given process */
+ public Signal(Process proc, Type type)
+ {
+ this.proc = proc;
+ this.type = type;
+ }
+
+ /** Create the signal for a given process */
+ public Signal(Process proc, Type type, String message)
+ {
+ this.proc = proc;
+ this.type = type;
+ this.message = message;
+
+ }
+
+ /** Get the proccess */
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ StringBuilder string = new StringBuilder(type + "[" + proc.getName());
+ if (message != null)
+ {
+ string.append(":" + message);
+ }
+ string.append("]");
+ return string.toString();
+ }
+}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
//$Id$
@@ -33,6 +35,22 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface StartEvent extends Event
+@XmlType(name="StartEvent")
+public class StartEvent extends Event
{
+ /**
+ * Get signal for enter
+ */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ }
+
+ /**
+ * Get signal for exit
+ */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,6 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
// $Id$
/**
@@ -29,8 +32,15 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface SubProcess extends Process
+@XmlType(name="SubProcess")
+public class SubProcess extends Process
{
+ @XmlTransient
+ private Process parentProcess;
+
/** Get the parent process */
- Process getParentProcess();
+ public Process getParentProcess()
+ {
+ return parentProcess;
+ }
}
\ No newline at end of file
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-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
//$Id$
/**
@@ -32,6 +34,18 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Task extends Activity
+@XmlType(name="Task")
+public class Task extends Activity
{
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_TASK, getName());
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_TASK, getName());
+ }
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -1,55 +0,0 @@
-/*
- * 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.jboss.bpm.runtime;
-
-//$Id$
-
-import org.jboss.bpm.model.internal.AbstractTask;
-
-/**
- * Extend to implement a named task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class BasicTask extends AbstractTask
-{
- private String name;
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- if (this.name != null)
- throw new IllegalStateException("Cannot rename task");
-
- this.name = name;
- }
-
- // Overwrite to implement execute
- protected void executeOverwrite(Token token)
- {
- }
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -1,94 +0,0 @@
-/*
- * 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.jboss.bpm.runtime;
-
-//$Id$
-
-import org.jboss.bpm.model.Process;
-
-/**
- * A Signal thrown by the ProcessEngine
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class Signal
-{
- public enum Type
- {
- ENTER_START_EVENT, EXIT_START_EVENT,
- ENTER_EVENT, EXIT_EVENT,
- ENTER_END_EVENT, EXIT_END_EVENT,
- ENTER_GATEWAY, EXIT_GATEWAY,
- ENTER_PROCESS, EXIT_PROCESS,
- ENTER_SUB_PROCESS, EXIT_SUB_PROCESS,
- ENTER_TASK, EXIT_TASK,
- USER_SIGNAL
- }
-
- private Process proc;
- private Type type;
- private String message;
-
- /** Create the signal for a given process */
- public Signal(Process proc, Type type)
- {
- this.proc = proc;
- this.type = type;
- }
-
- /** Create the signal for a given process */
- public Signal(Process proc, Type type, String message)
- {
- this.proc = proc;
- this.type = type;
- this.message = message;
-
- }
-
- /** Get the proccess */
- public Process getProcess()
- {
- return proc;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public String toString()
- {
- StringBuilder string = new StringBuilder(type + "[" + proc.getName());
- if (message != null)
- {
- string.append(":" + message);
- }
- string.append("]");
- return string.toString();
- }
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.runtime;
+import org.jboss.bpm.model.Signal;
+
//$Id$
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -30,7 +30,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.SignalListener;
public abstract class DefaultEngineTestCase extends AbstractAPITestCase implements SignalListener
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.runtime.BasicTask;
+import org.jboss.bpm.model.Task;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,7 +33,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends BasicTask
+public class TaskA extends Task
{
protected void executeOverwrite(Token token)
{
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -31,7 +31,7 @@
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
-import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.model.Signal;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -31,8 +31,8 @@
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Signal;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-10 09:00:19 UTC (rev 1565)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.runtime.BasicTask;
+import org.jboss.bpm.model.Task;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,7 +33,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends BasicTask
+public class TaskA extends Task
{
protected void executeOverwrite(Token token)
{
Modified: api/trunk/pom.xml
===================================================================
--- api/trunk/pom.xml 2008-07-09 20:03:53 UTC (rev 1564)
+++ api/trunk/pom.xml 2008-07-10 09:00:19 UTC (rev 1565)
@@ -38,6 +38,7 @@
<!-- Properties -->
<properties>
<commons.logging.version>1.1.1</commons.logging.version>
+ <jaxb.ri.version>2.1.7</jaxb.ri.version>
<jboss.microcontainer.version>2.0.0.Beta15</jboss.microcontainer.version>
<jboss.jbpm3.version>3.2.4-SNAPSHOT</jboss.jbpm3.version>
</properties>
@@ -46,6 +47,11 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${jaxb.ri.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
15 years, 11 months