JBoss JBPM SVN: r3495 - projects/spec/tags and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:59:56 -0500 (Sat, 20 Dec 2008)
New Revision: 3495
Added:
legacy/jboss-bpm/jbpm-spec-1.0.0-Alpha1/
Removed:
projects/spec/tags/jbpm-spec-1.0.0-Alpha1/
Log:
Move jboss-bmp to legacy
Copied: legacy/jboss-bpm/jbpm-spec-1.0.0-Alpha1 (from rev 3494, projects/spec/tags/jbpm-spec-1.0.0-Alpha1)
17 years, 4 months
JBoss JBPM SVN: r3494 - legacy.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:58:18 -0500 (Sat, 20 Dec 2008)
New Revision: 3494
Added:
legacy/jboss-bpm/
Log:
mkdir jboss-bpm
17 years, 4 months
JBoss JBPM SVN: r3493 - in projects/gwt-console/trunk: server and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:16:11 -0500 (Sat, 20 Dec 2008)
New Revision: 3493
Modified:
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/server/pom.xml
Log:
Use bpm-spec-1.0.0-Alpha1
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2008-12-20 16:12:09 UTC (rev 3492)
+++ projects/gwt-console/trunk/pom.xml 2008-12-20 16:16:11 UTC (rev 3493)
@@ -15,21 +15,22 @@
</parent>
<properties>
+ <bpm.spec.version>1.0.0-Alpha1</bpm.spec.version>
+ <commons.fileupload.version>1.2.1</commons.fileupload.version>
+ <commons.io.version>1.3.2</commons.io.version>
<commons.logging.version>1.1.1</commons.logging.version>
+ <gson.version>1.2.2</gson.version>
<gwt.version>1.5.2</gwt.version>
<gwtext.version>2.0.5</gwtext.version>
<gwt-log.version>2.5.2</gwt-log.version>
- <stax-api.version>1.0-2</stax-api.version>
<jaf.version>1.1</jaf.version>
- <resteasy.version>1.0-beta-8</resteasy.version>
- <gson.version>1.2.2</gson.version>
- <commons.fileupload.version>1.2.1</commons.fileupload.version>
- <commons.io.version>1.3.2</commons.io.version>
- <jbpm.version>3.3.1-SNAPSHOT</jbpm.version>
+ <javax.ejb.version>3.0</javax.ejb.version>
<javax.jaxb.version>2.1</javax.jaxb.version>
- <javax.ejb.version>3.0</javax.ejb.version>
<jboss.common.version>2.2.7.GA</jboss.common.version>
+ <jbpm.version>3.3.1-SNAPSHOT</jbpm.version>
<junit.version>3.8.1</junit.version>
+ <resteasy.version>1.0-beta-8</resteasy.version>
+ <stax-api.version>1.0-2</stax-api.version>
</properties>
<modules>
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2008-12-20 16:12:09 UTC (rev 3492)
+++ projects/gwt-console/trunk/server/pom.xml 2008-12-20 16:16:11 UTC (rev 3493)
@@ -16,7 +16,6 @@
<!-- Properties -->
<properties>
- <bpm.spec.version>1.0.0-SNAPSHOT</bpm.spec.version>
<balalaika.version>1.0.0-SNAPSHOT</balalaika.version>
<json-lib.version>2.2.3</json-lib.version>
</properties>
17 years, 4 months
JBoss JBPM SVN: r3492 - jbpm3/trunk.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:12:09 -0500 (Sat, 20 Dec 2008)
New Revision: 3492
Modified:
jbpm3/trunk/pom.xml
Log:
Use bpm-spec-1.0.0-Alpha1
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-12-20 16:07:03 UTC (rev 3491)
+++ jbpm3/trunk/pom.xml 2008-12-20 16:12:09 UTC (rev 3492)
@@ -46,7 +46,7 @@
<apache.cactus.version>1.8.0</apache.cactus.version>
<apache.jackrabbit.version>1.4.5</apache.jackrabbit.version>
<birt.version>2.2.2</birt.version>
- <bpm.spec.version>1.0.0-SNAPSHOT</bpm.spec.version>
+ <bpm.spec.version>1.0.0-Alpha1</bpm.spec.version>
<bsh.version>1.3.0</bsh.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.4</commons.io.version>
17 years, 4 months
JBoss JBPM SVN: r3491 - in projects/spec: tags and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:07:03 -0500 (Sat, 20 Dec 2008)
New Revision: 3491
Added:
projects/spec/tags/bpm-spec-1.0.0.Alpha1/
Removed:
projects/spec/branches/bpm-spec-1.0.0.Alpha1/
Log:
Release bpm-spec-1.0.0.Alpha1
Copied: projects/spec/tags/bpm-spec-1.0.0.Alpha1 (from rev 3490, projects/spec/branches/bpm-spec-1.0.0.Alpha1)
17 years, 4 months
JBoss JBPM SVN: r3490 - in projects/spec/branches/bpm-spec-1.0.0.Alpha1: modules/api and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:06:15 -0500 (Sat, 20 Dec 2008)
New Revision: 3490
Modified:
projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/api/pom.xml
projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/cts/pom.xml
projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss42/pom.xml
projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss50/pom.xml
projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/pom.xml
projects/spec/branches/bpm-spec-1.0.0.Alpha1/pom.xml
Log:
version=1.0.0-Alpha1
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/api/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/api/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/api/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>bpm-spec</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/cts/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/cts/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/cts/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>bpm-spec</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss42/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss42/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss42/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>bpm-spec-integration</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss50/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss50/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/jboss50/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>bpm-spec-integration</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/modules/integration/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>bpm-spec</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: projects/spec/branches/bpm-spec-1.0.0.Alpha1/pom.xml
===================================================================
--- projects/spec/branches/bpm-spec-1.0.0.Alpha1/pom.xml 2008-12-20 16:02:26 UTC (rev 3489)
+++ projects/spec/branches/bpm-spec-1.0.0.Alpha1/pom.xml 2008-12-20 16:06:15 UTC (rev 3490)
@@ -22,7 +22,7 @@
<artifactId>bpm-spec</artifactId>
<packaging>pom</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-Alpha1</version>
<!-- Parent -->
<parent>
17 years, 4 months
JBoss JBPM SVN: r3489 - projects/spec/branches.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 11:02:26 -0500 (Sat, 20 Dec 2008)
New Revision: 3489
Added:
projects/spec/branches/bpm-spec-1.0.0.Alpha1/
Log:
Branch bpm-spec-1.0.0.Alpha1
Copied: projects/spec/branches/bpm-spec-1.0.0.Alpha1 (from rev 3488, projects/spec/trunk)
17 years, 4 months
JBoss JBPM SVN: r3488 - in projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm: incubator/startevent and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 10:51:48 -0500 (Sat, 20 Dec 2008)
New Revision: 3488
Modified:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java
Log:
cleanup warnings
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 15:47:24 UTC (rev 3487)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 15:51:48 UTC (rev 3488)
@@ -25,23 +25,15 @@
import java.io.IOException;
import java.net.URL;
-import java.util.List;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessInstance;
-import org.jboss.bpm.api.model.Signal;
import org.jboss.bpm.api.model.ProcessInstance.ProcessStatus;
import org.jboss.bpm.api.runtime.BasicAttachments;
import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Gateway;
-import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.incubator.model.builder.GatewayBuilder;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-import org.jboss.bpm.incubator.service.ProcessBuilderService;
/**
* Exclusive data-based gateway that has conditional outgoing sequence flows.
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java 2008-12-20 15:47:24 UTC (rev 3487)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java 2008-12-20 15:51:48 UTC (rev 3488)
@@ -128,8 +128,8 @@
{
if (nextSignal != null)
{
- SignalService sigService = null; //getProcessEngine().getService(SignalService.class);
- sigService.throwSignal(nextSignal);
+ //SignalService sigService = null; //getProcessEngine().getService(SignalService.class);
+ //sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
17 years, 4 months
JBoss JBPM SVN: r3487 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/graph/node and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 10:47:24 -0500 (Sat, 20 Dec 2008)
New Revision: 3487
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java
Log:
Choke if there is no default transition
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2008-12-20 15:46:33 UTC (rev 3486)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2008-12-20 15:47:24 UTC (rev 3487)
@@ -267,9 +267,17 @@
public Transition getDefaultLeavingTransition()
{
Transition defaultTransition = null;
- if ((leavingTransitions != null) && (leavingTransitions.size() > 0))
+ if (leavingTransitions != null)
{
- defaultTransition = (Transition)leavingTransitions.get(0);
+ // Select the first unconditional transition
+ for (Transition auxTransition : leavingTransitions)
+ {
+ if (auxTransition.getCondition() == null)
+ {
+ defaultTransition = auxTransition;
+ break;
+ }
+ }
}
else if (superState != null)
{
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-12-20 15:46:33 UTC (rev 3486)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-12-20 15:47:24 UTC (rev 3487)
@@ -41,8 +41,8 @@
/**
* decision node.
*/
-public class Decision extends Node implements Parsable {
-
+public class Decision extends Node implements Parsable
+{
static final String NEWLINE = System.getProperty("line.separator");
static final String DECISION_CONDITION_RESULT = "decision_condition_result";
static final long serialVersionUID = 1L;
@@ -51,10 +51,12 @@
Delegation decisionDelegation = null;
String decisionExpression = null;
- public Decision() {
+ public Decision()
+ {
}
- public Decision(String name) {
+ public Decision(String name)
+ {
super(name);
}
@@ -64,86 +66,110 @@
return NodeType.Decision;
}
- public void read(Element decisionElement, JpdlXmlReader jpdlReader) {
+ public void read(Element decisionElement, JpdlXmlReader jpdlReader)
+ {
String expression = decisionElement.attributeValue("expression");
Element decisionHandlerElement = decisionElement.element("handler");
- if (expression!=null) {
+ if (expression != null)
+ {
decisionExpression = expression;
- } else if (decisionHandlerElement!=null) {
+ }
+ else if (decisionHandlerElement != null)
+ {
decisionDelegation = new Delegation();
decisionDelegation.read(decisionHandlerElement, jpdlReader);
}
}
- public void execute(ExecutionContext executionContext) {
+ public void execute(ExecutionContext executionContext)
+ {
Transition transition = null;
ClassLoader surroundingClassLoader = Thread.currentThread().getContextClassLoader();
- try {
- // set context class loader correctly for delegation class (https://jira.jboss.org/jira/browse/JBPM-1448)
+ try
+ {
+ // set context class loader correctly for delegation class (https://jira.jboss.org/jira/browse/JBPM-1448)
Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition()));
- try {
- if (decisionDelegation != null) {
+ try
+ {
+ if (decisionDelegation != null)
+ {
DecisionHandler decisionHandler = (DecisionHandler)decisionDelegation.getInstance();
if (decisionHandler == null)
- decisionHandler = (DecisionHandler) decisionDelegation.instantiate();
-
+ decisionHandler = (DecisionHandler)decisionDelegation.instantiate();
+
String transitionName = decisionHandler.decide(executionContext);
transition = getLeavingTransition(transitionName);
- if (transition == null) {
+ if (transition == null)
+ {
throw new JbpmException("decision '" + name + "' selected non existing transition '" + transitionName + "'");
}
- } else if (decisionExpression != null) {
+ }
+ else if (decisionExpression != null)
+ {
Object result = JbpmExpressionEvaluator.evaluate(decisionExpression, executionContext);
- if (result == null) {
+ if (result == null)
+ {
throw new JbpmException("decision expression '" + decisionExpression + "' returned null");
}
String transitionName = result.toString();
transition = getLeavingTransition(transitionName);
- if (transition == null) {
+ if (transition == null)
+ {
throw new JbpmException("decision '" + name + "' selected non existing transition '" + transitionName + "'");
}
- } else if (decisionConditions != null && !decisionConditions.isEmpty()) {
+ }
+ else if (decisionConditions != null && !decisionConditions.isEmpty())
+ {
// backwards compatible mode based on separate DecisionCondition's
Iterator iter = decisionConditions.iterator();
- while (iter.hasNext() && (transition == null)) {
- DecisionCondition decisionCondition = (DecisionCondition) iter.next();
+ while (iter.hasNext() && (transition == null))
+ {
+ DecisionCondition decisionCondition = (DecisionCondition)iter.next();
Object result = JbpmExpressionEvaluator.evaluate(decisionCondition.getExpression(), executionContext);
- if (Boolean.TRUE.equals(result)) {
+ if (Boolean.TRUE.equals(result))
+ {
String transitionName = decisionCondition.getTransitionName();
transition = getLeavingTransition(transitionName);
- if (transition != null) {
+ if (transition != null)
+ {
transition.removeConditionEnforcement();
}
}
}
-
- } else {
+ }
+ else
+ {
// new mode based on conditions in the transition itself
Iterator iter = leavingTransitions.iterator();
- while (iter.hasNext() && (transition == null)) {
- Transition candidate = (Transition) iter.next();
+ while (iter.hasNext() && (transition == null))
+ {
+ Transition candidate = (Transition)iter.next();
String conditionExpression = candidate.getCondition();
- if (conditionExpression != null) {
+ if (conditionExpression != null)
+ {
Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, executionContext);
- if (Boolean.TRUE.equals(result)) {
+ if (Boolean.TRUE.equals(result))
+ {
transition = candidate;
}
}
}
-
}
- if (transition == null) {
+ if (transition == null)
transition = getDefaultLeavingTransition();
- log.debug("decision didn't select transition, taking default " + transition);
- }
+
+ if (transition == null)
+ throw new IllegalStateException("decision cannot select transition: " + this);
+
+ log.debug("decision didn't select transition, taking default " + transition);
// since the decision node evaluates condition expressions, the
// condition of the
@@ -153,25 +179,30 @@
// node.
transition.removeConditionEnforcement();
- } catch (Exception exception) {
+ }
+ catch (Exception exception)
+ {
raiseException(exception, executionContext);
}
}
- finally {
+ finally
+ {
Thread.currentThread().setContextClassLoader(surroundingClassLoader);
- }
- log.debug("decision "+name+" is taking '"+transition+"'");
+ }
+ log.debug("decision " + name + " is taking '" + transition + "'");
executionContext.leaveNode(transition);
}
- public List getDecisionConditions() {
+ public List getDecisionConditions()
+ {
return decisionConditions;
}
-
- public void setDecisionDelegation(Delegation decisionDelegation) {
+
+ public void setDecisionDelegation(Delegation decisionDelegation)
+ {
this.decisionDelegation = decisionDelegation;
}
-
+
private static Log log = LogFactory.getLog(Decision.class);
}
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java 2008-12-20 15:46:33 UTC (rev 3486)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java 2008-12-20 15:47:24 UTC (rev 3487)
@@ -27,6 +27,7 @@
import java.util.HashSet;
import java.util.Set;
+import org.jboss.bpm.api.NotImplementedException;
import org.jboss.bpm.api.runtime.Attachments;
import org.jbpm.context.exe.ContextInstance;
@@ -60,8 +61,8 @@
@SuppressWarnings("unchecked")
public <T> T addAttachment(Class<T> clazz, String name, Object value)
{
- Key key = new Key(clazz, name);
- context.createVariable(key.toString(), value, token.getDelegate());
+ validateAttachmentKey(clazz, name);
+ context.createVariable(name, value, token.getDelegate());
return (T)value;
}
@@ -78,8 +79,8 @@
@SuppressWarnings("unchecked")
public <T> T getAttachment(Class<T> clazz, String name)
{
- Key key = new Key(clazz, name);
- return (T)context.getVariable(key.toString(), token.getDelegate());
+ validateAttachmentKey(clazz, name);
+ return (T)context.getVariable(name, token.getDelegate());
}
@SuppressWarnings("unchecked")
@@ -89,18 +90,16 @@
Set<String> strKeys = context.getVariables(token.getDelegate()).keySet();
for (String strKey : strKeys)
{
- Key key = Key.valueOf(strKey);
- if (key != null)
- keys.add(key);
+ Key key = new Key(null, strKey);
+ keys.add(key);
}
return keys;
}
public <T> T removeAttachment(Class<T> clazz, String name)
{
- Key key = new Key(clazz, name);
T value = getAttachment(clazz, name);
- context.deleteVariable(key.toString(), token.getDelegate());
+ context.deleteVariable(name, token.getDelegate());
return value;
}
@@ -113,4 +112,13 @@
{
return removeAttachment(null, name);
}
+
+ private <T> void validateAttachmentKey(Class<T> clazz, String name)
+ {
+ if (clazz != null)
+ throw new NotImplementedException("Attachments keyed by Class not supported");
+
+ if (name == null)
+ throw new NotImplementedException("Attachments with null name not supported");
+ }
}
\ No newline at end of file
17 years, 4 months
JBoss JBPM SVN: r3486 - in projects/spec/trunk/modules/cts/src/test: java/org/jboss/bpm/cts/feature/gateway/exclusive and 9 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 10:46:33 -0500 (Sat, 20 Dec 2008)
New Revision: 3486
Added:
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/deployment/
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/deployment/simple-process-jbpm3.xml
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/
projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/exclusive-split-jbpm3.xml
projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/
projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/
projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/
projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/exclusive-choice-jbpm3.xml
Removed:
projects/spec/trunk/modules/cts/src/test/resources/cts/deployment/
Modified:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/deployment/DeploymentXMLTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
Log:
jbpm3 all good
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/deployment/DeploymentXMLTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/deployment/DeploymentXMLTest.java 2008-12-20 14:33:15 UTC (rev 3485)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/deployment/DeploymentXMLTest.java 2008-12-20 15:46:33 UTC (rev 3486)
@@ -43,7 +43,7 @@
{
public void testSimpleXMLDeploy() throws Exception
{
- URL pdURL = getResourceURL("cts/deployment/simple-process-" + getDialect() + ".xml");
+ URL pdURL = getResourceURL("cts/feature/deployment/simple-process-" + getDialect() + ".xml");
DeploymentService depService = getProcessEngine().getService(DeploymentService.class);
Deployment dep = depService.createDeployment(pdURL);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 14:33:15 UTC (rev 3485)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 15:46:33 UTC (rev 3486)
@@ -24,6 +24,7 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessInstance;
@@ -31,6 +32,7 @@
import org.jboss.bpm.api.runtime.BasicAttachments;
import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.runtime.Token.TokenStatus;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.test.CTSTestCase;
/**
@@ -40,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public abstract class ExclusiveGatewaySplitTest extends CTSTestCase
+public class ExclusiveGatewaySplitTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -53,7 +55,7 @@
Token tok = proc.startProcess(att);
String nodeName = tok.getNode().getName();
- assertEquals("EndA", nodeName);
+ assertEquals("endA", nodeName);
assertEquals(TokenStatus.Destroyed, tok.getTokenStatus());
assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
@@ -70,7 +72,7 @@
Token tok = proc.startProcess(att);
String nodeName = tok.getNode().getName();
- assertEquals("EndB", nodeName);
+ assertEquals("endB", nodeName);
assertEquals(TokenStatus.Destroyed, tok.getTokenStatus());
assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
@@ -97,6 +99,9 @@
protected ProcessDefinition getProcessDefinition() throws IOException
{
- return null;
+ URL pdURL = getResourceURL("cts/feature/gateway/exclusive/exclusive-split-" + getDialect() + ".xml");
+ ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessDefinition procDef = pdService.parseProcessDefinition(pdURL);
+ return procDef;
}
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 14:33:15 UTC (rev 3485)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 15:46:33 UTC (rev 3486)
@@ -24,11 +24,17 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import java.util.List;
import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.ProcessInstance.ProcessStatus;
import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.test.CTSTestCase;
import org.jboss.bpm.incubator.client.ProcessInstanceExt;
import org.jboss.bpm.incubator.model.Gateway;
@@ -44,49 +50,53 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public abstract class ExclusiveChoiceTest extends CTSTestCase
+public class ExclusiveChoiceTest extends CTSTestCase
{
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
- proc.startProcessAsync(att);
- proc.waitForEnd();
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(1, endSignals.size());
- assertEquals("EndA", endSignals.get(0).getFromRef().getKeyProperty("name"));
+ Token tok = proc.startProcess(att);
+
+ String nodeName = tok.getNode().getName();
+ assertEquals("endA", nodeName);
+
+ assertEquals(TokenStatus.Destroyed, tok.getTokenStatus());
+ assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
}
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
- proc.startProcessAsync(att);
- proc.waitForEnd();
+
+ Token tok = proc.startProcess(att);
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(1, endSignals.size());
- assertEquals("EndB", endSignals.get(0).getFromRef().getKeyProperty("name"));
+ String nodeName = tok.getNode().getName();
+ assertEquals("endB", nodeName);
+
+ assertEquals(TokenStatus.Destroyed, tok.getTokenStatus());
+ assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
}
public void testInvalidGate() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "10");
- proc.startProcessAsync(att);
+
try
{
- proc.waitForEnd();
+ proc.startProcess(att);
fail("No gate defined for foo==10");
}
catch (RuntimeException rte)
@@ -95,15 +105,11 @@
}
}
- public ProcessDefinition getProcessDefinition() throws IOException
+ protected ProcessDefinition getProcessDefinition() throws IOException
{
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split");
- GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Exclusive);
- gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
- gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo > 10");
- procBuilder.addEndEventExt("EndA").addEndEventExt("EndB");
- return procBuilder.getProcessDefinition();
+ URL pdURL = getResourceURL("cts/pattern/control/exclusivechoice/exclusive-choice-" + getDialect() + ".xml");
+ ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessDefinition procDef = pdService.parseProcessDefinition(pdURL);
+ return procDef;
}
}
Copied: projects/spec/trunk/modules/cts/src/test/resources/cts/feature/deployment/simple-process-jbpm3.xml (from rev 3474, projects/spec/trunk/modules/cts/src/test/resources/cts/deployment/simple-process-jbpm3.xml)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/resources/cts/feature/deployment/simple-process-jbpm3.xml (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/resources/cts/feature/deployment/simple-process-jbpm3.xml 2008-12-20 15:46:33 UTC (rev 3486)
@@ -0,0 +1,16 @@
+<process-definition name="simpleProcess" xmlns="urn:jbpm.org:jpdl-3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+ <start-state name='start'>
+ <transition to='a' />
+ </start-state>
+ <state name='a'>
+ <transition to='b' />
+ </state>
+ <state name='b'>
+ <transition to='c' />
+ </state>
+ <state name='c'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
Added: projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/exclusive-split-jbpm3.xml
===================================================================
--- projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/exclusive-split-jbpm3.xml (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/exclusive-split-jbpm3.xml 2008-12-20 15:46:33 UTC (rev 3486)
@@ -0,0 +1,17 @@
+<process-definition name="exclusiveSplit" xmlns="urn:jbpm.org:jpdl-3.2">
+
+ <start-state name='start'>
+ <transition to='gateway' />
+ </start-state>
+ <decision name="gateway">
+ <transition to="endA">
+ <condition>#{foo < 10}</condition>
+ </transition>
+ <transition to="endB">
+ <condition>#{foo > 10}</condition>
+ </transition>
+ </decision>
+ <end-state name='endA' />
+ <end-state name='endB' />
+
+</process-definition>
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/cts/src/test/resources/cts/feature/gateway/exclusive/exclusive-split-jbpm3.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/exclusive-choice-jbpm3.xml
===================================================================
--- projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/exclusive-choice-jbpm3.xml (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/exclusive-choice-jbpm3.xml 2008-12-20 15:46:33 UTC (rev 3486)
@@ -0,0 +1,17 @@
+<process-definition name="exclusiveSplit" xmlns="urn:jbpm.org:jpdl-3.2">
+
+ <start-state name='start'>
+ <transition to='gateway' />
+ </start-state>
+ <decision name="gateway">
+ <transition to="endA">
+ <condition>#{foo < 10}</condition>
+ </transition>
+ <transition to="endB">
+ <condition>#{foo > 10}</condition>
+ </transition>
+ </decision>
+ <end-state name='endA' />
+ <end-state name='endB' />
+
+</process-definition>
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/cts/src/test/resources/cts/pattern/control/exclusivechoice/exclusive-choice-jbpm3.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months