[jbpm-commits] JBoss JBPM SVN: r1582 - in api/trunk: docs/VioletUML and 5 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jul 11 07:23:42 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-07-11 07:23:42 -0400 (Fri, 11 Jul 2008)
New Revision: 1582
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEndEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractItermediateEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractStartEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ObjectFactory.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/resources/org/
Modified:
api/trunk/.project
api/trunk/docs/VioletUML/APIModel.class.violet
api/trunk/docs/VioletUML/APIModel.png
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/Flow.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/MessageFlow.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/ProcessBuilder.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.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/api/src/main/java/org/jboss/bpm/model/package-info.java
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
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
Log:
Seperate behaviour from jaxb
Modified: api/trunk/.project
===================================================================
--- api/trunk/.project 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/.project 2008-07-11 11:23:42 UTC (rev 1582)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jbpm-api-root</name>
+ <name>jbpm-api</name>
<comment></comment>
<projects>
</projects>
Modified: api/trunk/docs/VioletUML/APIModel.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIModel.class.violet 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/docs/VioletUML/APIModel.class.violet 2008-07-11 11:23:42 UTC (rev 1582)
@@ -67,8 +67,8 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>211.0</double>
- <double>354.0</double>
+ <double>267.0</double>
+ <double>251.0</double>
</void>
</object>
</void>
@@ -104,6 +104,11 @@
</void>
<void method="addNode">
<object id="ClassNode6" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>name</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>IntermediateEvent</string>
@@ -119,6 +124,11 @@
</void>
<void method="addNode">
<object id="ClassNode7" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>name</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>EndEvent</string>
@@ -134,6 +144,11 @@
</void>
<void method="addNode">
<object id="ClassNode8" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>name</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Activity</string>
@@ -142,13 +157,18 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>349.0</double>
- <double>240.0</double>
+ <double>350.0</double>
+ <double>130.0</double>
</void>
</object>
</void>
<void method="addNode">
<object id="ClassNode9" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>name</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Gateway
@@ -179,8 +199,8 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>205.0</double>
- <double>445.0</double>
+ <double>269.0</double>
+ <double>342.0</double>
</void>
</object>
</void>
@@ -194,8 +214,8 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>436.0</double>
- <double>353.0</double>
+ <double>423.0</double>
+ <double>249.0</double>
</void>
</object>
</void>
@@ -281,29 +301,8 @@
</void>
<void method="addNode">
<object id="ClassNode17" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
<void property="name">
<void property="text">
- <string>NamedFlowObject
-</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>327.0</double>
- <double>127.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode18" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
<string>Result</string>
</void>
</void>
@@ -316,7 +315,7 @@
</object>
</void>
<void method="addNode">
- <object id="ClassNode19" class="com.horstmann.violet.ClassNode">
+ <object id="ClassNode18" class="com.horstmann.violet.ClassNode">
<void property="name">
<void property="text">
<string>Attachments</string>
@@ -501,26 +500,26 @@
<void method="connect">
<object class="com.horstmann.violet.ClassRelationshipEdge">
<void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
</void>
<void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
</void>
</object>
+ <object idref="ClassNode7"/>
<object idref="ClassNode17"/>
- <object idref="ClassNode2"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.ClassRelationshipEdge">
<void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
</void>
<void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
</void>
</object>
- <object idref="ClassNode8"/>
- <object idref="ClassNode17"/>
+ <object idref="ClassNode2"/>
+ <object idref="ClassNode12"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.ClassRelationshipEdge">
@@ -531,32 +530,20 @@
<object class="com.horstmann.violet.ArrowHead" field="V"/>
</void>
</object>
- <object idref="ClassNode7"/>
+ <object idref="ClassNode17"/>
<object idref="ClassNode18"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.ClassRelationshipEdge">
<void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
</void>
<void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
</void>
</object>
+ <object idref="ClassNode8"/>
<object idref="ClassNode2"/>
- <object idref="ClassNode12"/>
</void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- </object>
- <object idref="ClassNode18"/>
- <object idref="ClassNode19"/>
- </void>
</object>
</java>
Modified: api/trunk/docs/VioletUML/APIModel.png
===================================================================
(Binary files differ)
Modified: api/trunk/modules/api/pom.xml
===================================================================
--- api/trunk/modules/api/pom.xml 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/pom.xml 2008-07-11 11:23:42 UTC (rev 1582)
@@ -61,7 +61,15 @@
<build>
<plugins>
<plugin>
- <!-- mvn jaxb-schemagen:generate -->
+ <!--
+ ~/.m2/settings.xml
+
+ <pluginGroups>
+ <pluginGroup>com.sun.tools.jxc.maven2</pluginGroup>
+ </pluginGroups>
+
+ mvn jaxb-schemagen:generate
+ -->
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<configuration>
@@ -69,12 +77,23 @@
<destdir>target/schema</destdir>
<schemas>
<schema>
- <namespace>http://org.jboss.bpm.api</namespace>
- <file>jbpm-api.xsd</file>
+ <namespace>urn:api.bpm.jboss:jpdl-0.1</namespace>
+ <file>jbpm-api-0.1.xsd</file>
</schema>
</schemas>
<includes>
<include>package-info.java</include>
+ <include>AbstractActivity.java</include>
+ <include>AbstractEndEvent.java</include>
+ <include>AbstractEvent.java</include>
+ <include>AbstractFlow.java</include>
+ <include>AbstractFlowObject.java</include>
+ <include>AbstractGateway.java</include>
+ <include>AbstractProcess.java</include>
+ <include>AbstractStartEvent.java</include>
+ <include>AbstractSubProcess.java</include>
+ <include>AbstractTask.java</include>
+
<include>Activity.java</include>
<include>ComplexGateway.java</include>
<include>EndEvent.java</include>
@@ -97,16 +116,6 @@
<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>
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,77 @@
+/*
+ * 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 javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * An activity is a generic term for work that a company or organization performs via business processes.
+ * An activity can be atomic or non-atomic (compound).
+ * The types of activities that are a part of a Process Model are: Process, Sub-Process, and Task.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractActivity")
+abstract class AbstractActivity extends FlowObject implements NamedFlowObject
+{
+ protected String name;
+
+ /**
+ * Construct an anonymous Activity
+ */
+ public AbstractActivity()
+ {
+ }
+
+ /**
+ * Construct a Activity with a given name
+ */
+ public AbstractActivity(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = true)
+ public void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename: " + name);
+
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEndEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEndEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEndEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,75 @@
+/*
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+// $Id$
+
+/**
+ * As the name implies, the End Event indicates where a Process will end.
+ *
+ * In terms of Sequence Flow, the End Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flow. An End Event can have a specific Result
+ * that will appear as a marker within the center of the End Event shape. End Event Results are Message, Error, Compensation, Link, and Multiple.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractEndEvent")
+abstract class AbstractEndEvent extends Event
+{
+ private String name;
+
+ public AbstractEndEvent()
+ {
+ }
+
+ /**
+ * Construct a Activity with a given name
+ */
+ public AbstractEndEvent(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = true)
+ protected void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename: " + name);
+
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEndEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,40 @@
+/*
+ * 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.XmlType;
+
+
+
+// $Id$
+
+/**
+ * An Event is something that “happens” during the course of a business process.
+ * These Events affect the flow of the Process and usually have a cause or an impact.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractEvent")
+abstract class AbstractEvent extends FlowObject
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,97 @@
+/*
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+
+// $Id$
+
+/**
+ * A Flow is a graphical line connecting two objects in a BPD.
+ *
+ * There are two types of Flow: Sequence Flow and Message Flow, each with their own line style.
+ * Flow is also used in a generic sense (and lowercase) to describe how Tokens will traverse
+ * Sequence Flow from the Start Event to an End Event.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractFlow")
+abstract class AbstractFlow
+{
+ private String name;
+ private String targetName;
+
+ /**
+ * Construct a flow with no target
+ */
+ public AbstractFlow()
+ {
+ }
+
+ /**
+ * Construct a flow with a given target
+ */
+ public AbstractFlow(String targetName)
+ {
+ this.targetName = targetName;
+ }
+
+ /**
+ * Get the optional name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the optional name
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = false)
+ protected void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the target name
+ */
+ public String getTargetName()
+ {
+ return targetName;
+ }
+
+ /**
+ * Set the target name
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = true)
+ protected void setTargetName(String targetName)
+ {
+ this.targetName = targetName;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractFlowObject")
+abstract class AbstractFlowObject
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,97 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Gateways are modelling elements that are used to control how Sequence Flow interact as they converge and diverge within a Process. If the flow does not need to be
+ * controlled, then a Gateway is not needed.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractGateway")
+abstract class AbstractGateway extends FlowObject implements NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
+{
+ private String name;
+
+ @XmlElements( {
+ @XmlElement(name = "sequence", type = SequenceFlow.class),
+ @XmlElement(name = "message", type = MessageFlow.class)
+ })
+ protected List<Flow> outFlows = new ArrayList<Flow>();
+
+ /**
+ * Construct an anonymous Gateway
+ */
+ public AbstractGateway()
+ {
+ }
+
+ /**
+ * Construct a Activity with a given name
+ */
+ public AbstractGateway(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = true)
+ protected void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename: " + name);
+
+ this.name = name;
+ }
+
+ public List<Flow> getOutFlows()
+ {
+ return outFlows;
+ }
+
+ protected void setOutFlow(List<Flow> outFlow)
+ {
+ this.outFlows = outFlow;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractItermediateEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractItermediateEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractItermediateEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,101 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+// $Id$
+
+/**
+ * An Intermediate Event is an Event that occurs after a Process has been started.
+ *
+ * It will affect the Flow of the Process, but will not start or (directly) terminate the Process.
+ * An Intermediate Event will show where messages or delays are expected within the Process,
+ * disrupt the Normal Flow through exception handling, or show the extra flow required for compensating a transaction.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractItermediateEvent")
+abstract class AbstractItermediateEvent extends Event implements MultipleOutFlowSupport, MultipleInFlowSupport
+{
+ private String name;
+
+ @XmlElements( {
+ @XmlElement(name = "sequence", type = SequenceFlow.class),
+ @XmlElement(name = "message", type = MessageFlow.class)
+ })
+ protected List<Flow> outFlows = new ArrayList<Flow>();
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected AbstractItermediateEvent()
+ {
+ }
+
+ /**
+ * Construct a Activity with a given name
+ */
+ public AbstractItermediateEvent(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the name
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlAttribute(required = true)
+ protected void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename: " + name);
+
+ this.name = name;
+ }
+
+ public List<Flow> getOutFlows()
+ {
+ return outFlows;
+ }
+
+ protected void setOutFlow(List<Flow> outFlow)
+ {
+ this.outFlows = outFlow;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractItermediateEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,78 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractProcess")
+abstract class AbstractProcess extends Activity
+{
+ @XmlElements( {
+ @XmlElement(name = "start", type = StartEvent.class),
+ @XmlElement(name = "event", type = ItermediateEvent.class),
+ @XmlElement(name = "task", type = Task.class),
+ @XmlElement(name = "exclusive-gateway", type = ExclusiveGateway.class),
+ @XmlElement(name = "inclusive-gateway", type = InclusiveGateway.class),
+ @XmlElement(name = "complex-gateway", type = ComplexGateway.class),
+ @XmlElement(name = "parallel-gateway", type = ParallelGateway.class),
+ @XmlElement(name = "sub-process", type = SubProcess.class),
+ @XmlElement(name = "end", type = EndEvent.class)
+ })
+ protected List<FlowObject> flowObjects = new ArrayList<FlowObject>();
+
+ /**
+ * Construct an anonymous process
+ */
+ public AbstractProcess()
+ {
+ }
+
+ /**
+ * Construct a process with a given name
+ */
+ public AbstractProcess(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Get the list of flow objects
+ */
+ public List<FlowObject> getFlowObjects()
+ {
+ return flowObjects;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractStartEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractStartEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractStartEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,77 @@
+/*
+ * 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 javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * A Start Event indicates where a particular Process will start.
+ *
+ * In terms of Sequence Flow, the Start Event starts the Flow of the Process, and thus, will not have any incoming Sequence Flow.
+ * A Start Event can have a Trigger that indicates how the Process starts: Message, Timer, Rule, Link, or Multiple.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractStartEvent")
+abstract class AbstractStartEvent extends Event implements SingleOutFlowSupport
+{
+ @XmlElements( {
+ @XmlElement(name = "sequence", type = SequenceFlow.class),
+ @XmlElement(name = "message", type = MessageFlow.class)
+ })
+ protected Flow outFlow;
+
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected AbstractStartEvent()
+ {
+ }
+
+ /**
+ * Get the out flow
+ */
+ public Flow getOutFlow()
+ {
+ return outFlow;
+ }
+
+ /**
+ * Set the out flow
+ * Note, this MUST NOT leak into the public API.
+ */
+ @XmlTransient
+ public void setOutFlow(Flow outFlow)
+ {
+ if (this.outFlow != null)
+ throw new IllegalStateException("Cannot reassign out flow");
+ this.outFlow = outFlow;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractStartEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,79 @@
+/*
+ * 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 javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * A Sub-Process is Process that is included within another Process.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="AbstractSubProcess")
+abstract class AbstractSubProcess extends Process implements SingleOutFlowSupport
+{
+ @XmlElements( {
+ @XmlElement(name = "sequence", type = SequenceFlow.class),
+ @XmlElement(name = "message", type = MessageFlow.class)
+ })
+ protected Flow outFlow;
+
+ /**
+ * Construct an anonymous process
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected AbstractSubProcess()
+ {
+ }
+
+ /**
+ * Construct a process with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected AbstractSubProcess(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Get the out flow
+ */
+ public Flow getOutFlow()
+ {
+ return outFlow;
+ }
+
+ /**
+ * Set the out flow Note, this MUST NOT leak into the public API.
+ */
+ @XmlTransient
+ public void setOutFlow(Flow outFlow)
+ {
+ this.outFlow = outFlow;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,80 @@
+/*
+ * 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.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+//$Id$
+
+/**
+ * A Task is an Atomic Activity that is included within a Process.
+ *
+ * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
+ * perform the Task when it is executed.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractTask")
+abstract class AbstractTask extends Activity implements SingleOutFlowSupport
+{
+ @XmlElements( {
+ @XmlElement(name = "sequence", type = SequenceFlow.class),
+ @XmlElement(name = "message", type = MessageFlow.class)
+ })
+ protected Flow outFlow;
+
+ /**
+ * Construct an anonymous Task
+ */
+ public AbstractTask()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ */
+ public AbstractTask(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Get the out flow
+ */
+ public Flow getOutFlow()
+ {
+ return outFlow;
+ }
+
+ /**
+ * Set the out flow Note, this MUST NOT leak into the public API.
+ */
+ @XmlTransient
+ public void setOutFlow(Flow outFlow)
+ {
+ this.outFlow = outFlow;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
___________________________________________________________________
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,7 +21,6 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
// $Id$
@@ -35,44 +34,22 @@
* @since 08-Jul-2008
*/
@XmlType(name="Activity")
-public abstract class Activity extends FlowObject implements NamedFlowObject
+public abstract class Activity extends AbstractActivity implements NamedFlowObject
{
- private String name;
-
/**
* Construct an anonymous Activity
+ * Note, this MUST NOT leak into the public API.
*/
- public Activity()
+ protected Activity()
{
}
/**
* Construct a Activity with a given name
+ * Note, this MUST NOT leak into the public API.
*/
public Activity(String name)
{
- this.name = name;
+ super(name);
}
-
- /**
- * Get the name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Set the name.
- * Note, this MUST NOT leak into the public API.
- */
- // TODO
- @XmlAttribute(required = true)
- 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/ComplexGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -39,4 +39,25 @@
@XmlType(name="ComplexGateway")
public class ComplexGateway extends Gateway
{
+ /**
+ * Construct an anonymous Task
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ComplexGateway()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ComplexGateway(String name)
+ {
+ super(name);
+ }
+
+ public String toString()
+ {
+ return "ComplexGateway[" + getName() + "]";
+ }
}
\ 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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,16 +21,14 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlAttribute;
+//$Id$
+
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$
-
/**
* As the name implies, the End Event indicates where a Process will end.
*
@@ -42,39 +40,25 @@
* @since 08-Jul-2008
*/
@XmlType(name="EndEvent")
-public class EndEvent extends Event implements NamedFlowObject
+public class EndEvent extends AbstractEndEvent implements NamedFlowObject
{
- private String name;
private Result result;
- public EndEvent()
- {
- }
-
- public EndEvent(String name)
- {
- this.name = name;
- }
-
/**
- * Get the name
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
*/
- public String getName()
+ protected EndEvent()
{
- return name;
}
-
+
/**
- * Set the name.
+ * Construct an anonymous StartEvent.
* Note, this MUST NOT leak into the public API.
*/
- @XmlAttribute(required = true)
- protected void setName(String name)
+ protected EndEvent(String name)
{
- if (this.name != null)
- throw new IllegalStateException("Cannot rename: " + name);
-
- this.name = name;
+ super(name);
}
/**
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -35,8 +35,16 @@
* @since 08-Jul-2008
*/
@XmlType(name="Event")
-public abstract class Event extends FlowObject
+public abstract class Event extends AbstractEvent
{
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected Event()
+ {
+ }
+
/**
* Get signal for enter
*/
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.model;
+//$Id$
+
import javax.xml.bind.annotation.XmlType;
-// $Id$
-
/**
* A point in the workflow process where, based on a decision or workflow control data, one of several branches is chosen.
*
@@ -35,4 +35,25 @@
@XmlType(name="ExclusiveGateway")
public class ExclusiveGateway extends Gateway
{
+ /**
+ * Construct an anonymous Task
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ExclusiveGateway()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ExclusiveGateway(String name)
+ {
+ super(name);
+ }
+
+ public String toString()
+ {
+ return "ExclusiveGateway[" + getName() + "]";
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,7 +21,6 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@@ -40,25 +39,25 @@
* @since 08-Jul-2008
*/
@XmlType(name="Flow")
-public abstract class Flow
+public abstract class Flow extends AbstractFlow
{
private FlowObject source;
- private String name;
- private String targetName;
/**
- * JAXB Constructer
+ * Construct a flow with no target
+ * Note, this MUST NOT leak into the public API.
*/
- public Flow()
+ protected Flow()
{
}
/**
* Construct a flow with a given target
+ * Note, this MUST NOT leak into the public API.
*/
public Flow(String targetName)
{
- this.targetName = targetName;
+ super(targetName);
}
/**
@@ -78,42 +77,4 @@
{
this.source = source;
}
-
- /**
- * Get the optional name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Set the optional name
- * Note, this MUST NOT leak into the public API.
- */
- @XmlAttribute(required = false)
- protected void setName(String name)
- {
- this.name = name;
- }
-
- /**
- * Get the target name
- * Note, this MUST NOT leak into the public API.
- */
- public String getTargetName()
- {
- return targetName;
- }
-
- /**
- * Set the target name
- * Note, this MUST NOT leak into the public API.
- */
- @XmlAttribute(required = true)
- protected void setTargetName(String targetName)
- {
- this.targetName = targetName;
- }
-
}
\ 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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -36,13 +36,21 @@
* @since 08-Jul-2008
*/
@XmlType(name="FlowObject")
-public abstract class FlowObject
+public abstract class FlowObject extends AbstractFlowObject
{
@XmlTransient
private Process process;
@XmlTransient
private Object implObject;
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected FlowObject()
+ {
+ }
+
/**
* Get the associated Process
*/
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -23,6 +23,11 @@
//$Id$
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
/**
@@ -33,8 +38,28 @@
* @since 08-Jul-2008
*/
@XmlType(name="Gateway")
-public abstract class Gateway extends FlowObject
+public abstract class Gateway extends AbstractGateway implements NamedFlowObject
{
+ @XmlTransient
+ protected List<Flow> inFlows = new ArrayList<Flow>();
+
+ /**
+ * Construct an anonymous Gateway
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected Gateway()
+ {
+ }
+
+ /**
+ * Construct a Gateway with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected Gateway(String name)
+ {
+ super(name);
+ }
+
@Override
public Signal getEnterSignal()
{
@@ -46,4 +71,19 @@
{
return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
}
+
+ public void addOutFlow(Flow flow)
+ {
+ outFlows.add(flow);
+ }
+
+ public List<Flow> getInFlows()
+ {
+ return Collections.unmodifiableList(inFlows);
+ }
+
+ public void addInFlow(Flow inFlow)
+ {
+ this.inFlows.add(inFlow);
+ }
}
\ 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-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -37,4 +37,25 @@
@XmlType(name="InclusiveGateway")
public class InclusiveGateway extends Gateway
{
+ /**
+ * Construct an anonymous Task
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected InclusiveGateway()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected InclusiveGateway(String name)
+ {
+ super(name);
+ }
+
+ public String toString()
+ {
+ return "InclusiveGateway[" + getName() + "]";
+ }
}
\ 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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,6 +21,11 @@
*/
package org.jboss.bpm.model;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@@ -37,6 +42,40 @@
* @since 08-Jul-2008
*/
@XmlType(name="ItermediateEvent")
-public class ItermediateEvent extends Event
+public class ItermediateEvent extends AbstractItermediateEvent
{
+ @XmlTransient
+ protected List<Flow> inFlows = new ArrayList<Flow>();
+
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ItermediateEvent()
+ {
+ }
+
+ /**
+ * Construct an anonymous StartEvent.
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ItermediateEvent(String name)
+ {
+ super(name);
+ }
+
+ public void addOutFlow(Flow flow)
+ {
+ outFlows.add(flow);
+ }
+
+ public List<Flow> getInFlows()
+ {
+ return Collections.unmodifiableList(inFlows);
+ }
+
+ public void addInFlow(Flow inFlow)
+ {
+ this.inFlows.add(inFlow);
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -36,14 +36,16 @@
public class MessageFlow extends Flow
{
/**
- * JAXB Constructer
+ * Construct a flow with no target
+ * Note, this MUST NOT leak into the public API.
*/
- public MessageFlow()
+ protected MessageFlow()
{
}
/**
* Construct a flow with a given target
+ * Note, this MUST NOT leak into the public API.
*/
public MessageFlow(String targetName)
{
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ObjectFactory.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ObjectFactory.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ObjectFactory.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,131 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.07.11 at 09:21:08 AM CEST
+//
+
+package org.jboss.bpm.model;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each Java content interface and Java element interface generated in the api.bpm.jboss.org package.
+ * <p>
+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. The Java representation of XML content can consist
+ * of schema derived interfaces and classes representing the binding of schema type definitions, element declarations and model groups. Factory methods for each of
+ * these are provided in this class.
+ *
+ */
+ at XmlRegistry
+public class ObjectFactory
+{
+ /**
+ * Create an instance of {@link ExclusiveGateway }
+ *
+ */
+ public ExclusiveGateway createExclusiveGateway()
+ {
+ return new ExclusiveGateway();
+ }
+
+ /**
+ * Create an instance of {@link Task }
+ *
+ */
+ public Task createTask()
+ {
+ return new Task();
+ }
+
+ /**
+ * Create an instance of {@link Process }
+ *
+ */
+ public Process createProcess()
+ {
+ return new Process();
+ }
+
+ /**
+ * Create an instance of {@link ParallelGateway }
+ *
+ */
+ public ParallelGateway createParallelGateway()
+ {
+ return new ParallelGateway();
+ }
+
+ /**
+ * Create an instance of {@link MessageFlow }
+ *
+ */
+ public MessageFlow createMessageFlow()
+ {
+ return new MessageFlow();
+ }
+
+ /**
+ * Create an instance of {@link EndEvent }
+ *
+ */
+ public EndEvent createEndEvent()
+ {
+ return new EndEvent();
+ }
+
+ /**
+ * Create an instance of {@link SubProcess }
+ *
+ */
+ public SubProcess createSubProcess()
+ {
+ return new SubProcess();
+ }
+
+ /**
+ * Create an instance of {@link SequenceFlow }
+ *
+ */
+ public SequenceFlow createSequenceFlow()
+ {
+ return new SequenceFlow();
+ }
+
+ /**
+ * Create an instance of {@link ComplexGateway }
+ *
+ */
+ public ComplexGateway createComplexGateway()
+ {
+ return new ComplexGateway();
+ }
+
+ /**
+ * Create an instance of {@link InclusiveGateway }
+ *
+ */
+ public InclusiveGateway createInclusiveGateway()
+ {
+ return new InclusiveGateway();
+ }
+
+ /**
+ * Create an instance of {@link ItermediateEvent }
+ *
+ */
+ public ItermediateEvent createItermediateEvent(String name)
+ {
+ return new ItermediateEvent(name);
+ }
+
+ /**
+ * Create an instance of {@link StartEvent }
+ *
+ */
+ public StartEvent createStartEvent()
+ {
+ return new StartEvent();
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -35,4 +35,25 @@
@XmlType(name="ParallelGateway")
public class ParallelGateway extends Gateway
{
+ /**
+ * Construct an anonymous Task
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ParallelGateway()
+ {
+ }
+
+ /**
+ * Construct a Task with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected ParallelGateway(String name)
+ {
+ super(name);
+ }
+
+ public String toString()
+ {
+ return "ParallelGateway[" + getName() + "]";
+ }
}
\ No newline at end of file
Deleted: 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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -1,319 +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.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-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;
-
-// $Id$
-
-/**
- * A Process is any Activity performed within a company or organization.
- *
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name = "Process", propOrder = { "startEvent", "flowObjects", "endEvents" })
- at XmlRootElement(name = "process")
-public class Process extends Activity
-{
- private StartEvent startEvent;
- private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
- private List<EndEvent> endEvents = new ArrayList<EndEvent>();
-
- @XmlTransient
- public enum ProcessState { CREATED, INITIALIZED, STARTED, ENDED };
- private ProcessState processState = ProcessState.CREATED;
-
- /**
- * 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)
- {
- ProcessManager pdm = ProcessManager.locateProcessManager();
- name = "AnonymousProcess#" + pdm.getProcesses().size();
- setName(name);
- }
- }
-
- /**
- * Add a flow object. Note, this MUST NOT leak into the public API.
- */
- protected void addFlowObject(FlowObject flowObject)
- {
- if (flowObject instanceof NamedFlowObject)
- {
- String name = ((NamedFlowObject)flowObject).getName();
- if (name != null && findFlowObject(name) != null)
- throw new NameNotUniqueException("NamedFlowObject: " + name);
- }
-
- if (flowObject instanceof StartEvent)
- {
- setStartEvent((StartEvent)flowObject);
- }
- else if (flowObject instanceof EndEvent)
- {
- endEvents.add((EndEvent)flowObject);
- }
- else
- {
- flowObjects.add(flowObject);
- }
- }
-
- /**
- * Get the start event
- */
- public StartEvent getStartEvent()
- {
- if (startEvent == null)
- throw new InvalidProcessException("Process does not have a start event");
-
- return startEvent;
- }
-
- /**
- * Set the start event Note, this MUST NOT leak into the public API.
- */
- @XmlElement(name = "start-event")
- protected void setStartEvent(StartEvent startEvent)
- {
- if (this.startEvent != null)
- throw new InvalidProcessException("Process cannot have multiple start events: " + startEvent);
-
- this.startEvent = startEvent;
- }
-
- /**
- * Get the set of end events
- */
- public List<EndEvent> getEndEvents()
- {
- if (processState == ProcessState.CREATED)
- return endEvents;
-
- return Collections.unmodifiableList(endEvents);
- }
-
- /**
- * Set the start event Note, this MUST NOT leak into the public API.
- */
- @XmlElement(name = "end-event")
- protected void setEndEvents(List<EndEvent> endEvents)
- {
- this.endEvents = endEvents;
- }
-
- /**
- * Get the list of flow objects, excluding start and end states
- */
- @XmlElement(name = "node")
- public List<FlowObject> getFlowObjects()
- {
- if (processState == ProcessState.CREATED)
- return 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)
- {
- if (processState != ProcessState.INITIALIZED)
- throw new IllegalStateException("Cannot start process in state: " + processState);
-
- processState = ProcessState.STARTED;
- execute(new InitialToken(this, att));
- return new ResultFuture();
- }
-
- /**
- * Find a flow object by name
- *
- * @return null if not found
- */
- public NamedFlowObject findFlowObject(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Cannot find flow object with name: null");
-
- List<FlowObject> allFlowObjects = new ArrayList<FlowObject>();
- allFlowObjects.add(startEvent);
- allFlowObjects.addAll(flowObjects);
- allFlowObjects.addAll(endEvents);
-
- NamedFlowObject nfo = null;
- for (FlowObject aux : allFlowObjects)
- {
- if (aux instanceof NamedFlowObject && name.equals(((NamedFlowObject)aux).getName()))
- {
- 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);
- }
-
-
- /**
- * Get the process state
- */
- public ProcessState getProcessState()
- {
- return processState;
- }
-
- /**
- * Set the process state
- */
- public void initialize()
- {
- if (processState != ProcessState.CREATED)
- throw new IllegalStateException("Cannot initialize process in state: " + processState);
-
- if (startEvent == null)
- throw new InvalidProcessException("Process does not have a start event");
-
- if (endEvents.size() == 0)
- throw new InvalidProcessException("Process does not have end events");
-
- // Set the associated process
- startEvent.setProcess(this);
- for (FlowObject aux : flowObjects)
- aux.setProcess(this);
- for (FlowObject aux : endEvents)
- aux.setProcess(this);
-
- processState = ProcessState.INITIALIZED;
- }
-
-
- @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()
- {
- boolean isDone = getResult() != null;
- if (isDone)
- processState = ProcessState.ENDED;
-
- return isDone;
- }
-
- private Result getResult()
- {
- if (result == null)
- {
- for (EndEvent aux : endEvents)
- {
- result = aux.getResult();
- if (result != null)
- {
- processState = ProcessState.ENDED;
- break;
- }
- }
- }
- return result;
- }
- }
-}
\ No newline at end of file
Added: 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 (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -0,0 +1,289 @@
+/*
+ * 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.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+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.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;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "Process")
+ at XmlRootElement(name = "process")
+public class Process extends AbstractProcess
+{
+ public enum ProcessState
+ {
+ CREATED, INITIALIZED, STARTED, ENDED
+ };
+
+ private ProcessState processState = ProcessState.CREATED;
+
+ /**
+ * Construct an anonymous process
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected Process()
+ {
+ }
+
+ /**
+ * Construct a process with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected 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)
+ {
+ ProcessManager pdm = ProcessManager.locateProcessManager();
+ name = "AnonymousProcess#" + pdm.getProcesses().size();
+ setName(name);
+ }
+ }
+
+ /**
+ * Add a flow object. Note, this MUST NOT leak into the public API.
+ */
+ protected void addFlowObject(FlowObject flowObject)
+ {
+ if (flowObject instanceof NamedFlowObject)
+ {
+ NamedFlowObject nfo = (NamedFlowObject)flowObject;
+ String name = nfo.getName();
+ if (name != null && findFlowObject(name) != null)
+ throw new NameNotUniqueException("NamedFlowObject: " + name);
+ }
+
+ flowObjects.add(flowObject);
+ }
+
+ /**
+ * Get the start event
+ */
+ public StartEvent getStartEvent()
+ {
+ StartEvent start = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof StartEvent)
+ {
+ start = (StartEvent)aux;
+ break;
+ }
+ }
+ return start;
+ }
+
+ /**
+ * Get the set of end events
+ */
+ public List<EndEvent> getEndEvents()
+ {
+ List<EndEvent> ends = new ArrayList<EndEvent>();
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof EndEvent)
+ {
+ ends.add((EndEvent)aux);
+ }
+ }
+ return Collections.unmodifiableList(ends);
+ }
+
+ /**
+ * Get the list of flow objects
+ */
+ public List<FlowObject> getFlowObjects()
+ {
+ if (processState == ProcessState.CREATED)
+ return 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)
+ {
+ if (processState != ProcessState.INITIALIZED)
+ throw new IllegalStateException("Cannot start process in state: " + processState);
+
+ processState = ProcessState.STARTED;
+ execute(new InitialToken(this, att));
+ return new ResultFuture();
+ }
+
+ /**
+ * Find a flow object by name
+ *
+ * @return null if not found
+ */
+ public NamedFlowObject findFlowObject(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Cannot find flow object with name: null");
+
+ NamedFlowObject nfo = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof NamedFlowObject && name.equals(((NamedFlowObject)aux).getName()))
+ {
+ 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);
+ }
+
+ /**
+ * Get the process state
+ */
+ public ProcessState getProcessState()
+ {
+ return processState;
+ }
+
+ /**
+ * Set the process state
+ */
+ public void initialize()
+ {
+ if (processState != ProcessState.CREATED)
+ throw new IllegalStateException("Cannot initialize process in state: " + processState);
+
+ if (getStartEvent() == null)
+ throw new InvalidProcessException("Process does not have a start event");
+
+ if (getEndEvents().size() == 0)
+ throw new InvalidProcessException("Process does not have end events");
+
+ // Set the associated process
+ for (FlowObject aux : flowObjects)
+ aux.setProcess(this);
+
+ processState = ProcessState.INITIALIZED;
+ }
+
+ @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()
+ {
+ boolean isDone = getResult() != null;
+ if (isDone)
+ processState = ProcessState.ENDED;
+
+ return isDone;
+ }
+
+ private Result getResult()
+ {
+ if (result == null)
+ {
+ for (EndEvent aux : getEndEvents())
+ {
+ result = aux.getResult();
+ if (result != null)
+ {
+ processState = ProcessState.ENDED;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+
// $Id$
/**
@@ -99,32 +100,46 @@
public ProcessBuilder addExclusiveGateway(String name)
{
- flowObject = new ExclusiveGateway();
+ flowObject = new ExclusiveGateway(name);
proc.addFlowObject(flowObject);
return this;
}
public ProcessBuilder addInclusiveGateway(String name)
{
- flowObject = new InclusiveGateway();
+ flowObject = new InclusiveGateway(name);
proc.addFlowObject(flowObject);
return this;
}
public ProcessBuilder addComplexGateway(String name)
{
- flowObject = new ComplexGateway();
+ flowObject = new ComplexGateway(name);
proc.addFlowObject(flowObject);
return this;
}
public ProcessBuilder addParallelGateway(String name)
{
- flowObject = new ParallelGateway();
+ flowObject = new ParallelGateway(name);
proc.addFlowObject(flowObject);
return this;
}
+ public ProcessBuilder addSubProcess(String name)
+ {
+ flowObject = new SubProcess(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addItermediateEvent(String name)
+ {
+ flowObject = new ItermediateEvent(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
public ProcessBuilder addEndEvent(String name)
{
flowObject = new EndEvent(name);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -36,14 +36,16 @@
public class SequenceFlow extends Flow
{
/**
- * JAXB Constructer
+ * Construct a flow with no target
+ * Note, this MUST NOT leak into the public API.
*/
- public SequenceFlow()
+ protected SequenceFlow()
{
}
/**
* Construct a flow with a given target
+ * Note, this MUST NOT leak into the public API.
*/
public SequenceFlow(String targetName)
{
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -24,6 +24,7 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+
//$Id$
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -23,58 +23,42 @@
//$Id$
-import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * A Start Event indicates where a particular Process will start.
+ * A Start Event indicates where a particular Process will start.
*
- * In terms of Sequence Flow, the Start Event starts the Flow of the Process, and thus, will not have any incoming Sequence Flow.
- * A Start Event can have a Trigger that indicates how the Process starts: Message, Timer, Rule, Link, or Multiple.
+ * In terms of Sequence Flow, the Start Event starts the Flow of the Process, and thus, will not have any incoming Sequence Flow. A Start Event can have a Trigger that
+ * indicates how the Process starts: Message, Timer, Rule, Link, or Multiple.
*
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
- at XmlType(name="StartEvent")
-public class StartEvent extends Event implements SingleOutFlowSupport
+ at XmlType(name = "StartEvent")
+public class StartEvent extends AbstractStartEvent implements SingleOutFlowSupport
{
- private Flow outFlow;
-
- /**
- * Get signal for enter
+ /**
+ * Construct a StartEvent with a constant name: 'start'
+ * Note, this MUST NOT leak into the public API.
*/
- public Signal getEnterSignal()
+ protected StartEvent()
{
- 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);
- }
/**
- * Get the out flow
+ * Get signal for enter
*/
- public Flow getOutFlow()
+ public Signal getEnterSignal()
{
- return outFlow;
+ return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
}
/**
- * Set the out flow
- * Note, this MUST NOT leak into the public API.
+ * Get signal for exit
*/
- @XmlElement(name = "flow", required = true)
- public void setOutFlow(Flow outFlow)
+ public Signal getExitSignal()
{
- if (this.outFlow != null)
- throw new IllegalStateException("Cannot reassign out flow");
- this.outFlow = outFlow;
+ return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
}
public String toString()
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.model;
+//$Id$
+
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-// $Id$
-
/**
* A Sub-Process is Process that is included within another Process.
*
@@ -33,11 +33,28 @@
* @since 08-Jul-2008
*/
@XmlType(name="SubProcess")
-public class SubProcess extends Process
+public class SubProcess extends AbstractSubProcess
{
@XmlTransient
private Process parentProcess;
+ /**
+ * Construct an anonymous process
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected SubProcess()
+ {
+ }
+
+ /**
+ * Construct a process with a given name
+ * Note, this MUST NOT leak into the public API.
+ */
+ protected SubProcess(String name)
+ {
+ super(name);
+ }
+
/** Get the parent process */
public Process getParentProcess()
{
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 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -21,73 +21,51 @@
*/
package org.jboss.bpm.model;
-import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
//$Id$
/**
- * A Task is an Atomic Activity that is included within a Process.
+ * A Task is an Atomic Activity that is included within a Process.
*
- * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail.
- * Generally, an end-user and/or an application are used to perform the Task when it is executed.
+ * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
+ * perform the Task when it is executed.
*
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
- at XmlType(name="Task")
-public class Task extends Activity implements SingleOutFlowSupport
+ at XmlType(name = "Task")
+public class Task extends AbstractTask implements SingleOutFlowSupport
{
- private Flow outFlow;
-
/**
* Construct an anonymous Task
+ * Note, this MUST NOT leak into the public API.
*/
- public Task()
+ protected Task()
{
}
/**
* Construct a Task with a given name
+ * Note, this MUST NOT leak into the public API.
*/
- public Task(String name)
+ protected Task(String name)
{
super(name);
}
-
- /**
- * Get the out flow
- */
- public Flow getOutFlow()
- {
- return outFlow;
- }
- /**
- * Set the out flow
- * Note, this MUST NOT leak into the public API.
- */
- @XmlElement(name = "flow", required = true)
- public void setOutFlow(Flow outFlow)
- {
- if (this.outFlow != null)
- throw new IllegalStateException("Cannot reassign out flow");
-
- this.outFlow = outFlow;
- }
-
/** 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());
}
-
+
public String toString()
{
return "Task[" + getName() + "]";
Modified: 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 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/package-info.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
- at XmlSchema(namespace="http://org.jboss.bpm.api")
+ at XmlSchema(namespace="urn:api.bpm.jboss:jpdl-0.1")
package org.jboss.bpm.model;
import javax.xml.bind.annotation.XmlSchema;
Modified: 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 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -31,6 +31,7 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
+import org.jboss.bpm.model.ObjectFactory;
import org.jboss.bpm.model.Process;
/**
@@ -43,7 +44,7 @@
{
public void marshallProcess(Process proc, Writer out) throws JAXBException, IOException
{
- JAXBContext jaxbContext = JAXBContext.newInstance(Process.class.getPackage().getName());
+ JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
Modified: 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 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -28,6 +28,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
+import org.jboss.bpm.model.ObjectFactory;
import org.jboss.bpm.model.Process;
/**
@@ -40,8 +41,9 @@
{
public Process unmarshallProcess(Reader xml) throws Exception
{
- JAXBContext jaxbContext = JAXBContext.newInstance(Process.class.getPackage().getName());
+ JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ unmarshaller.setProperty("com.sun.xml.bind.ObjectFactory",new ObjectFactory());
Process proc = (Process)unmarshaller.unmarshal(xml);
proc.initialize();
return proc;
Modified: 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 2008-07-10 19:41:52 UTC (rev 1581)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-11 11:23:42 UTC (rev 1582)
@@ -40,8 +40,11 @@
public class ProcessMarshallerTest extends TestCase
{
public void testProcess() throws Exception
- {
- Process inProc = new ProcessBuilder("myproc").addStartEvent().addSequenceFlow("taskA").addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
+ {
+ Process inProc = new ProcessBuilder("myproc").addStartEvent().addSequenceFlow("task").addTask("taskA").
+ addSequenceFlow("split").addParallelGateway("split").addSequenceFlow("subproc").addSequenceFlow("event").
+ addSubProcess("subproc").addSequenceFlow("join").addItermediateEvent("event").addSequenceFlow("join").
+ addParallelGateway("join").addSequenceFlow("end").addEndEvent("end").getProcess();
StringWriter strwr = new StringWriter();
ProcessMarshaller marshaller = new ProcessMarshaller();
More information about the jbpm-commits
mailing list