[jbpm-commits] JBoss JBPM SVN: r4303 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/model and 8 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Mar 20 17:08:31 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-03-20 17:08:31 -0400 (Fri, 20 Mar 2009)
New Revision: 4303
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/SignalExecutionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/AvgDurationTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/BasicVariablesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableBasicTypesTest.java
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Log:
JBPM-2054 rest friendly ids
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -129,7 +129,7 @@
protected void checkId(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment, PvmDbSession pvmDbSession) {
String id = processDefinition.getId();
if (id==null) {
- id = processDefinition.getKey()+":"+processDefinition.getVersion();
+ id = processDefinition.getKey()+"-"+processDefinition.getVersion();
log.trace("created id '"+id+"' for "+processDefinition);
processDefinition.setId(id);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -61,7 +61,7 @@
executionPart = Long.toString(executionImpl.getDbid());
}
- String executionId = base+"/"+executionPart;
+ String executionId = base+"."+executionPart;
if (log.isDebugEnabled()) log.debug("generated execution id "+executionId);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -29,7 +29,6 @@
import org.jbpm.Execution;
import org.jbpm.ExecutionQuery;
import org.jbpm.ExecutionService;
-import org.jbpm.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.DeleteProcessInstance;
import org.jbpm.pvm.internal.cmd.EndProcessInstance;
import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
@@ -100,19 +99,19 @@
public Execution signalExecutionByKey(String processDefinitionKey, String executionKey) {
- return signalExecutionById(processDefinitionKey+"/"+executionKey, null, null);
+ return signalExecutionById(processDefinitionKey+"."+executionKey, null, null);
}
public Execution signalExecutionByKey(String processDefinitionKey, String executionKey, String signalName) {
- return signalExecutionById(processDefinitionKey+"/"+executionKey, signalName, null);
+ return signalExecutionById(processDefinitionKey+"."+executionKey, signalName, null);
}
public Execution signalExecutionByKey(String processDefinitionKey, String executionKey, String signalName, Map<String, Object> parameters) {
- return signalExecutionById(processDefinitionKey+"/"+executionKey, signalName, parameters);
+ return signalExecutionById(processDefinitionKey+"."+executionKey, signalName, parameters);
}
public Execution signalExecutionByKey(String processDefinitionKey, String executionKey, Map<String, Object> parameters) {
- return signalExecutionById(processDefinitionKey+"/"+executionKey, null, parameters);
+ return signalExecutionById(processDefinitionKey+"."+executionKey, null, parameters);
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -60,13 +60,13 @@
public void testStartProcessInstance() {
JbpmConfiguration environmentFactory = (JbpmConfiguration) getEnvironmentFactory();
ExecutionService executionService = environmentFactory.get(ExecutionService.class);
- Execution execution = executionService.startProcessInstanceById("test:1", "request17");
+ Execution execution = executionService.startProcessInstanceById("test-1", "request17");
}
public void testResumeProcessInstance() {
JbpmConfiguration environmentFactory = (JbpmConfiguration) getEnvironmentFactory();
ExecutionService executionService = environmentFactory.get(ExecutionService.class);
- Execution execution = executionService.signalExecutionById("test/request17", "end");
+ Execution execution = executionService.signalExecutionById("test.request17", "end");
}
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -46,7 +46,7 @@
"</process>"
);
- Execution execution = executionService.startProcessInstanceById("ThreeStates:1");
+ Execution execution = executionService.startProcessInstanceById("ThreeStates-1");
assertEquals("b", execution.getActivityName());
String executionId = execution.getId();
@@ -77,15 +77,15 @@
Execution execution = executionService.startProcessInstanceByKey("p", "one");
assertEquals("ed", execution.getActivityName());
- execution = executionService.signalExecutionById("p/one", "left");
+ execution = executionService.signalExecutionById("p.one", "left");
assertEquals("b", execution.getActivityName());
- executionService.startProcessInstanceById("p:1", "two");
- execution = executionService.signalExecutionById("p/two", "middle");
+ executionService.startProcessInstanceById("p-1", "two");
+ execution = executionService.signalExecutionById("p.two", "middle");
assertEquals("c", execution.getActivityName());
- executionService.startProcessInstanceById("p:1", "three");
- execution = executionService.signalExecutionById("p/three", "right");
+ executionService.startProcessInstanceById("p-1", "three");
+ execution = executionService.signalExecutionById("p.three", "right");
assertEquals("d", execution.getActivityName());
}
@@ -108,7 +108,7 @@
executionService.startProcessInstanceByKey("p", "one");
try {
- executionService.signalExecutionById("p/one", "left");
+ executionService.signalExecutionById("p.one", "left");
} catch (JbpmException e) {
assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
}
@@ -132,7 +132,7 @@
);
executionService.startProcessInstanceByKey("p", "one");
- Execution execution = executionService.signalExecutionById("p/one", "up");
+ Execution execution = executionService.signalExecutionById("p.one", "up");
assertEquals("a", execution.getActivityName());
}
@@ -147,7 +147,7 @@
);
executionService.startProcessInstanceByKey("p", "one");
- Execution execution = executionService.signalExecutionById("p/one");
+ Execution execution = executionService.signalExecutionById("p.one");
assertEquals("a", execution.getActivityName());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/SignalExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/SignalExecutionTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/SignalExecutionTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -84,11 +84,11 @@
assertEquals("a", execution.getActivityName());
- execution = executionService.signalExecutionById("ICL/82436");
+ execution = executionService.signalExecutionById("ICL.82436");
assertEquals("b", execution.getActivityName());
- execution = executionService.signalExecutionById("ICL/82436");
+ execution = executionService.signalExecutionById("ICL.82436");
assertEquals("c", execution.getActivityName());
}
@@ -113,7 +113,7 @@
variables.put("type", "Accident");
variables.put("amount", new Float(763.74));
- execution = executionService.signalExecutionById("ICL/82436", variables);
+ execution = executionService.signalExecutionById("ICL.82436", variables);
assertNotNull(execution);
String executionId = execution.getId();
@@ -143,112 +143,4 @@
execution = executionService.signalExecutionById(execution.getId());
assertEquals("a", execution.getActivityName());
}
-
- /*
-
- public void testSetVariable()
- {
- Execution execution = startExecution();
-
- String executionId = execution.getId();
- // set variable a to value text
- executionService.setVariable(executionId, "a", "text");
- // check if we can read that value back
- assertEquals("text", executionService.getVariable(executionId, "a"));
-
- // overwrite the value of variable a with another text
- executionService.setVariable(executionId, "a", "another text");
- // see if we can read another text back from the variable
- assertEquals("another text", executionService.getVariable(executionId, "a"));
- }
-
- public void testSetVariables()
- {
- Execution execution = startExecution();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("a", new Integer(1));
- variables.put("b", "text");
-
- // set variables in bulk by providing a map
- executionService.setVariables(execution.getId(), variables);
-
- Map<String, Object> expected = new HashMap<String, Object>(variables);
-
- Set<String> variableNames = new HashSet<String>();
- variableNames.add("a");
- variableNames.add("b");
-
- // read the variables back and compare
- assertEquals(expected, executionService.getVariables(execution.getId(), variableNames));
-
- // now set variables b and c with a map
- variables = new HashMap<String, Object>();
- variables.put("b", new Integer(99));
- variables.put("c", "another text");
-
- // this should leave a untouched, overwrite b and create c
- executionService.setVariables(execution.getId(), variables);
-
- // update the expected map
- expected.put("b", new Integer(99));
- expected.put("c", "another text");
-
- // add c to the variable names that should be collected
- variableNames.add("c");
-
- // read the variables back and compare
- assertEquals(expected, executionService.getVariables(execution.getId(), variableNames));
- }
-
- // helper methods ///////////////////////////////////////////////////////////
-
- /**
- * deploys 3 versions of process with name 'nuclear fusion', 2 versions of the processes 'ultimate seduction' and
- * 'publish book'
- void deployMultipleVersionsOfProcesses()
- {
- ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
-
- ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(
- WaitState.class).done();
- DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- processDefinition = ProcessFactory.build("ultimate seduction").key("USD").activity("initial").initial().behaviour(WaitState.class).done();
- deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- processDefinition = ProcessFactory.build("ultimate seduction").key("USD").activity("initial").initial().behaviour(WaitState.class).done();
- deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(WaitState.class).done();
- deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- processDefinition = ProcessFactory.build("publish book").key("PBO").activity("initial").initial().behaviour(WaitState.class).done();
- deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(WaitState.class).done();
- deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
- }
-
- Execution startExecution()
- {
- ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
-
- ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").activity("initial").initial().behaviour(WaitState.class)
- .done();
- DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- ExecutionService executionService = getEnvironmentFactory().get(ExecutionService.class);
-
- return executionService.startExecutionByName("nuclear fusion");
- }
-
- */
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -116,7 +116,7 @@
assertEquals("text", executionService.getVariable(executionId, "b"));
// in the generated id, we can see if the right process definition version was taken
- assertTrue(execution.getId().startsWith("ICL/"));
+ assertTrue(execution.getId().startsWith("ICL."));
}
public void testStartNewProcessInstanceWithAKey() {
@@ -132,7 +132,7 @@
Execution execution = executionService.startProcessInstanceByKey("ICL", "one");
assertNotNull(execution);
- assertEquals("ICL/one", execution.getId());
+ assertEquals("ICL.one", execution.getId());
}
public void testStartNewProcessInstanceWithVariables() {
@@ -178,7 +178,7 @@
ProcessDefinition processDefinition = processService.findProcessDefinitionsByKey("ICL").get(0);
// start an execution for the process with the given id
- Execution execution = executionService.startProcessInstanceById("ICL:1");
+ Execution execution = executionService.startProcessInstanceById("ICL-1");
assertNotNull(execution);
// checking the state
@@ -189,7 +189,7 @@
assertNull(execution.getKey());
// if there is no user defined name or key specified in the execution,
// the default id generator will create a unique id like this: processDefinitionId/execution.dbid
- assertTrue(execution.getId().startsWith("ICL/"));
+ assertTrue(execution.getId().startsWith("ICL."));
// the last part of the execution key should be the dbid.
Long.parseLong(execution.getId().substring(4));
}
@@ -210,7 +210,7 @@
variables.put("b", "text");
// provide the variables in the start execution method
- Execution execution = executionService.startProcessInstanceById("ICL:1", variables);
+ Execution execution = executionService.startProcessInstanceById("ICL-1", variables);
String executionId = execution.getId();
assertEquals(new Integer(1), executionService.getVariable(executionId, "a"));
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/AvgDurationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/AvgDurationTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/AvgDurationTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -55,7 +55,7 @@
executeProcess();
executeProcess();
- Map<String, Long> avgDurations = historyService.avgDurationPerActivity("ICL:1");
+ Map<String, Long> avgDurations = historyService.avgDurationPerActivity("ICL-1");
Long avgDurationOne = avgDurations.get("one");
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -24,7 +24,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.Execution;
import org.jbpm.test.JbpmTestCase;
@@ -63,7 +62,7 @@
executionService.startProcessInstanceByKey("TRS", variables);
executionService.startProcessInstanceByKey("TRS", variables);
- Map<String, Integer> choiceDistribution = historyService.choiceDistribution("TRS:1", "How far?");
+ Map<String, Integer> choiceDistribution = historyService.choiceDistribution("TRS-1", "How far?");
assertEquals(1, (int)choiceDistribution.get("far"));
assertEquals(3, (int)choiceDistribution.get("nearby"));
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -50,7 +50,7 @@
List<HistoryProcessInstance> historyProcessInstances = historyService
.createHistoryProcessInstanceQuery()
- .processDefinitionId("ICL:1")
+ .processDefinitionId("ICL-1")
.orderAsc(HistoryProcessInstanceQuery.PROPERTY_STARTTIME)
.execute();
@@ -67,7 +67,7 @@
// runtime database
List<Execution> executions = executionService
.createExecutionQuery()
- .processDefinitionId("ICL:1")
+ .processDefinitionId("ICL-1")
.execute();
assertEquals(0, executions.size());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -131,9 +131,9 @@
.orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
.execute();
- assertEquals("make_friends:3", processDefinitions.get(0).getId());
- assertEquals("make_friends:2", processDefinitions.get(1).getId());
- assertEquals("make_friends:1", processDefinitions.get(2).getId());
- assertEquals("make_print:1", processDefinitions.get(3).getId());
+ assertEquals("make_friends-3", processDefinitions.get(0).getId());
+ assertEquals("make_friends-2", processDefinitions.get(1).getId());
+ assertEquals("make_friends-1", processDefinitions.get(2).getId());
+ assertEquals("make_print-1", processDefinitions.get(3).getId());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -46,7 +46,7 @@
assertEquals("Insurance claim", processDefinition.getName());
assertEquals("Insurance_claim", processDefinition.getKey());
assertEquals(1, processDefinition.getVersion());
- assertEquals("Insurance_claim:1", processDefinition.getId());
+ assertEquals("Insurance_claim-1", processDefinition.getId());
}
public void testProcessWithNameAndKey() {
@@ -62,7 +62,7 @@
assertEquals("Insurance claim", processDefinition.getName());
assertEquals("ICL", processDefinition.getKey());
assertEquals(1, processDefinition.getVersion());
- assertEquals("ICL:1", processDefinition.getId());
+ assertEquals("ICL-1", processDefinition.getId());
}
// interface methods ////////////////////////////////////////////////////////
@@ -93,7 +93,7 @@
assertEquals("Name with spaces", processDefinition.getName());
assertEquals("Name_with_spaces", processDefinition.getKey());
assertEquals(1, processDefinition.getVersion());
- assertEquals("Name_with_spaces:1", processDefinition.getId());
+ assertEquals("Name_with_spaces-1", processDefinition.getId());
}
public void testFindProcessDefinitions() {
@@ -132,7 +132,7 @@
);
// load it
- ProcessDefinition processDefinition = processService.findProcessDefinitionById("given:33");
+ ProcessDefinition processDefinition = processService.findProcessDefinitionById("given-33");
assertNotNull(processDefinition);
assertEquals("given", processDefinition.getName());
assertEquals(33, processDefinition.getVersion());
@@ -147,7 +147,7 @@
.deploy();
// delete it
- processService.deleteProcessDefinition("deleteme:33");
+ processService.deleteProcessDefinition("deleteme-33");
// check if the db is empty
assertEquals(0, processService.createProcessDefinitionQuery().execute().size());
@@ -170,7 +170,7 @@
executionService.startProcessInstanceByKey("deleteme");
// delete it all
- processService.deleteProcessDefinitionCascade("deleteme:33");
+ processService.deleteProcessDefinitionCascade("deleteme-33");
// check if the db is empty
assertEquals(0, processService.createProcessDefinitionQuery().execute().size());
@@ -194,10 +194,10 @@
// delete it all
try {
- processService.deleteProcessDefinition("deleteme:33");
+ processService.deleteProcessDefinition("deleteme-33");
fail("expected exception");
} catch (JbpmException e) {
- assertTextPresent("still 4 process instances for process definition deleteme:33", e.getMessage());
+ assertTextPresent("still 4 process instances for process definition deleteme-33", e.getMessage());
}
}
@@ -266,7 +266,7 @@
);
fail("expected exception");
} catch (JbpmException e) {
- assertTextPresent("process 'takethis:234' already exists", e.getMessage());
+ assertTextPresent("process 'takethis-234' already exists", e.getMessage());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/BasicVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/BasicVariablesTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/BasicVariablesTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -45,7 +45,7 @@
);
executionService.startProcessInstanceByKey("var", "one");
- Set<String> variableNames = executionService.getVariableNames("var/one");
+ Set<String> variableNames = executionService.getVariableNames("var.one");
assertNotNull(variableNames);
assertEquals(0, variableNames.size());
}
@@ -70,12 +70,12 @@
executionService.startProcessInstanceByKey("var", variables, "one");
- Set<String> variableNames = executionService.getVariableNames("var/one");
+ Set<String> variableNames = executionService.getVariableNames("var.one");
assertNotNull(variableNames);
assertEquals(expectedVariableNames, variableNames);
- variables = executionService.getVariables("var/one", variableNames);
+ variables = executionService.getVariables("var.one", variableNames);
assertEquals(expectedVariables, variables);
}
@@ -91,10 +91,10 @@
);
executionService.startProcessInstanceByKey("var", "one");
- executionService.setVariable("var/one", "msg", "hello");
- assertEquals("hello", executionService.getVariable("var/one", "msg"));
- executionService.setVariable("var/one", "msg", "world");
- assertEquals("world", executionService.getVariable("var/one", "msg"));
+ executionService.setVariable("var.one", "msg", "hello");
+ assertEquals("hello", executionService.getVariable("var.one", "msg"));
+ executionService.setVariable("var.one", "msg", "world");
+ assertEquals("world", executionService.getVariable("var.one", "msg"));
}
public void testUpdateVariableToDifferentType() {
@@ -108,9 +108,9 @@
);
executionService.startProcessInstanceByKey("var", "one");
- executionService.setVariable("var/one", "msg", "hello");
- assertEquals("hello", executionService.getVariable("var/one", "msg"));
- executionService.setVariable("var/one", "msg", new Integer(5));
- assertEquals(new Integer(5), executionService.getVariable("var/one", "msg"));
+ executionService.setVariable("var.one", "msg", "hello");
+ assertEquals("hello", executionService.getVariable("var.one", "msg"));
+ executionService.setVariable("var.one", "msg", new Integer(5));
+ assertEquals(new Integer(5), executionService.getVariable("var.one", "msg"));
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableBasicTypesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableBasicTypesTest.java 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/VariableBasicTypesTest.java 2009-03-20 21:08:31 UTC (rev 4303)
@@ -43,8 +43,8 @@
);
executionService.startProcessInstanceByKey("var", "one");
- executionService.setVariable("var/one", "msg", variableValue);
- assertEquals(variableValue, executionService.getVariable("var/one", "msg"));
+ executionService.setVariable("var.one", "msg", variableValue);
+ assertEquals(variableValue, executionService.getVariable("var.one", "msg"));
}
public void testVariableTypeString() {
@@ -123,8 +123,8 @@
// now check if an update still works ok
// updating a serialized object might fail when the blob is cached by hibernate
SerializeMe newValue = new SerializeMe(generateString("another text ", 500));
- executionService.setVariable("var/one", "msg", newValue);
- assertEquals(newValue, executionService.getVariable("var/one", "msg"));
+ executionService.setVariable("var.one", "msg", newValue);
+ assertEquals(newValue, executionService.getVariable("var.one", "msg"));
}
protected String generateString(String base, int multiplier) {
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-03-20 20:39:04 UTC (rev 4302)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-03-20 21:08:31 UTC (rev 4303)
@@ -74,7 +74,7 @@
</para>
<para>During deployment, an <literal>id</literal> is assigned to the process
definitions. The <literal>id</literal> will have format
- <literal>{key}:{version}</literal>
+ <literal>{key}-{version}</literal> with a dash between key and version
</para>
<para>If <literal>key</literal> is not provided, it is generated automatically
based on the name. All non alpha numeric characters in the name will be replaced
@@ -196,7 +196,7 @@
<para>If instead you want to start a new process instance in a very
specific version, you can use the id of the process definition like this:
</para>
- <programlisting>executionService.startProcessInstanceById("ICL:1");</programlisting>
+ <programlisting>executionService.startProcessInstanceById("ICL-1");</programlisting>
</section>
<section id="withakey">
@@ -209,9 +209,10 @@
</para>
<programlisting>executionService.startProcessInstanceByKey("ICL", "CL92837");</programlisting>
<para>The key is used to create the id of the process instance.
- The format used is <literal>{process-key}/{execution-id}</literal>.
+ The format used is <literal>{process-key}.{execution-id}</literal>.
+ With a dot between process-key and execution-id.
So execution created in the previous code snippet will have id
- <literal>ICL/CL92837</literal>.
+ <literal>ICL.CL92837</literal>.
</para>
<para>If no user defined key is provided, the DB primary key is taken
as the key. In that case, the id can be retrieved like this:
@@ -265,9 +266,9 @@
</para>
<programlisting>executionService.signalExecutionByKey("ICL", "82436");</programlisting>
<para>Alternatively, the execution that must be signaled can be referenced
- by a unique execution id. In the next snippet, <literal>ICL/82436</literal>
+ by a unique execution id. In the next snippet, <literal>ICL.82436</literal>
refers to the executionId.</para>
- <programlisting>executionService.signalExecutionById("ICL/82436");</programlisting>
+ <programlisting>executionService.signalExecutionById("ICL.82436");</programlisting>
<para>Optionally some data can be passed along with a signal: a <literal>signalName</literal>
and <literal>parameters</literal>. How the signalName gets used depends on
the execution's current activity. The parameters get stored as process variables.
More information about the jbpm-commits
mailing list