[jbpm-commits] JBoss JBPM SVN: r4578 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/concurrency/graphbased and 38 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Apr 18 13:43:49 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-04-18 13:43:48 -0400 (Sat, 18 Apr 2009)
New Revision: 4578
Added:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/choice/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/IdentityServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
Log:
JBPM-2162 revert process archive deployment in examples
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -44,16 +44,18 @@
List<User> findUsers();
/** delete the given user.
- * No effect (no exception) if the user does not exist. */
+ * No effect (no exception) if the user does not exist.
+ * Deletes also the memberships related to the given user, but does not delete the
+ * associated groups. */
void deleteUser(String userId);
/** create a group new group
* @return the generated id for this group. */
- String createGroup(String string);
+ String createGroup(String groupId);
/** create a group new group
* @return the generated id for this group. */
- String createGroup(String string, String groupType);
+ String createGroup(String groupId, String groupType);
/** create a group new group
* @return the generated id for this group. */
@@ -76,7 +78,9 @@
List<String> findGroupIdsByUser(String userId);
/** deletes the given group.
- * No effect (no exception) if the group does not exist. */
+ * No effect (no exception) if the group does not exist.
+ * Deleting a group also deletes all the memberships associated to that group,
+ * but not the associated users. */
void deleteGroup(String groupId);
/** makes the given user a member of the given group with the given role.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -80,16 +80,16 @@
* transition in the process. */
void completeTask(long taskDbid, String outcome);
- /** Deletes the task.
+ /** Deletes the task without completing it.
* If this task was created in the context of a process execution, one
* of three things might happen depending on configurations of the task
* in the process definition:
* a) process executions resumes
* b) whole process execution is cancelled as well.
* c) exception is thrown */
- void cancelTask(long taskDbid);
+ void deleteTask(long taskDbid);
- /** Deletes the task providing an indication of the reason. Example reasons
+ /** Deletes the task without completing indicating the reason. Example reasons
* could be: "failed", "error", "exited", "obsolete" or "deleted".
* If this task was created in the context of a process execution, one
* of three things might happen depending on configurations of the task
@@ -97,7 +97,7 @@
* a) process executions resumes
* b) whole process execution is cancelled as well.
* c) exception is thrown */
- void cancelTask(long taskDbid, String reason);
+ void deleteTask(long taskDbid, String reason);
/** add a role to a given task.
* @param participation specifies the kind of involvement of the participatingUser
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -34,24 +34,24 @@
* @author Tom Baeyens
*/
public class ConcurrencyGraphBasedTest extends JbpmTestCase {
-
-
- protected void setUp() throws Exception
- {
+
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-ConcurrencyGraphBasedTest.jpdl");
-
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/concurrency/graphbased/process.jpdl.xml")
+ .deploy();
}
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ConcurrencyGraphBasedTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testConcurrencyGraphBased() {
-
ProcessInstance processInstance = executionService.startProcessInstanceByKey("ConcurrencyGraphBased");
String pid = processInstance.getId();
@@ -117,6 +117,4 @@
}
return activityNames;
}
-
}
-
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -32,17 +32,20 @@
* @author Tom Baeyens
*/
public class DecisionConditionsTest extends JbpmTestCase {
-
- protected void setUp() throws Exception
- {
+
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-DecisionConditionsTest.jpdl");
-
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/decision/conditions/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-DecisionConditionsTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,16 +33,19 @@
*/
public class DecisionExpressionTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-DecisionExpressionTest.jpdl");
-
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/decision/expression/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-DecisionExpressionTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
@@ -66,5 +69,4 @@
Execution execution = executionService.startProcessInstanceByKey("DecisionExpression", variables);
assertEquals("give up", execution.getActivityName());
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,15 +33,19 @@
*/
public class DecisionHandlerTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-DecisionHandlerTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/decision/handler/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-DecisionHandlerTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -30,16 +30,19 @@
*/
public class EndMultipleTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-EndMultipleTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/end/multiple/process.jpdl.xml")
+ .deploy();
}
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-EndMultipleTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
@@ -60,7 +63,6 @@
}
public void testEndMultipleInternalServerError() {
-
Execution execution = executionService.startProcessInstanceByKey("EndMultiple");
String executionId = execution.getId();
execution = executionService.signalExecutionById(executionId, "500");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -30,20 +30,23 @@
*/
public class EndProcessInstanceTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-EndProcessInstanceTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/end/processinstance/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-EndProcessInstanceTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testEndProcessInstance() {
-
Execution execution = executionService.startProcessInstanceByKey("EndProcessInstance");
assertTrue(execution.isEnded());
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -28,19 +28,21 @@
/**
* @author Tom Baeyens
*/
-public class EndStateTest extends JbpmTestCase
-{
+public class EndStateTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-EndStateTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/end/state/process.jpdl.xml")
+ .deploy();
}
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-EndStateTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
@@ -53,7 +55,6 @@
}
public void testEndStateErrorBadRequest() {
-
Execution execution = executionService.startProcessInstanceByKey("EndState");
String executionId = execution.getId();
execution = executionService.signalExecutionById(executionId, "400");
@@ -62,7 +63,6 @@
}
public void testEndStateErrorInternalServerError() {
-
Execution execution = executionService.startProcessInstanceByKey("EndState");
String executionId = execution.getId();
execution = executionService.signalExecutionById(executionId, "500");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -30,7 +30,6 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
-import org.jbpm.api.Execution;
import org.jbpm.test.JbpmTestCase;
@@ -39,6 +38,7 @@
*/
public class EsbTest extends JbpmTestCase {
+ long deploymentDbid;
public JbpmMockCourier courier;
public void setUp() throws Exception {
@@ -49,24 +49,23 @@
EPR epr = new EPR(new URI("epr"));
courier = new JbpmMockCourier();
MockRegistry.register("orderProcessing", "bookSold", epr, courier);
-
- deploy("jbpm-EsbTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/esb/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-EsbTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ MockRegistry.uninstall();
+ MockCourierFactory.uninstall();
+
super.tearDown();
}
+
public void testEsb() {
-
- if(isIntegrationTest())
- {
- System.out.println("FIXME JBPM-2137: Implement and execute esb integration tests");
- return;
- }
-
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("title", "Internetworking with TCP/IP");
@@ -77,5 +76,4 @@
assertEquals("Internetworking with TCP/IP", body.get("bookTitle"));
assertEquals("deliver asap", body.get("goal"));
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -9,9 +9,23 @@
public class EventListenerTest extends JbpmTestCase {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/eventlistener/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ super.tearDown();
+ }
+
public void testEventListener() {
- deployJpdlResource("org/jbpm/examples/eventlistener/process.jpdl.xml");
-
LogListener.logs = new ArrayList<String>();
Execution execution = executionService.startProcessInstanceByKey("EventListener");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -35,35 +35,46 @@
*/
public class HqlTest extends JbpmTestCase {
+ long deploymentDbid;
- protected void setUp() throws Exception
- {
+ long taskLaundryDbid;
+ long taskDishesDbid;
+ long taskIronDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-HqlTest.jpdl");
- }
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-HqlTest.jpdl");
- super.tearDown();
- }
-
- public void testHql() {
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/hql/process.jpdl.xml")
+ .deploy();
+
// add task laundry
Task task = taskService.newTask();
task.setName("laundry");
- saveAndRegisterTask(task);
-
+ taskLaundryDbid = taskService.saveTask(task);
+
// add task dishes
task = taskService.newTask();
task.setName("dishes");
- saveAndRegisterTask(task);
-
+ taskDishesDbid = taskService.saveTask(task);
+
// add task iron
task = taskService.newTask();
task.setName("iron");
- saveAndRegisterTask(task);
+ taskIronDbid = taskService.saveTask(task);
+ }
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ taskService.deleteTask(taskLaundryDbid);
+ taskService.deleteTask(taskDishesDbid);
+ taskService.deleteTask(taskIronDbid);
+
+ super.tearDown();
+ }
+
+ public void testHql() {
Execution execution = executionService.startProcessInstanceByKey("Hql");
String executionId = execution.getId();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -30,15 +30,19 @@
*/
public class JavaInstantiateTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-JavaInstantiateTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/java/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-JavaInstantiateTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -25,7 +25,6 @@
import java.util.Map;
import org.jbpm.api.Execution;
-import org.jbpm.examples.script.text.Person;
import org.jbpm.test.JbpmTestCase;
@@ -34,21 +33,23 @@
*/
public class ScriptExpressionTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-ScriptExpressionTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/script/expression/process.jpdl.xml")
+ .deploy();
}
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ScriptExpressionTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testScriptText() {
-
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("order", new Order("Berlin"));
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,19 +33,22 @@
*/
public class ScriptTextTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-ScriptTextTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/script/text/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ScriptTextTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
-
public void testScriptText() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("person", new Person("Honolulu"));
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -9,7 +9,6 @@
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
-import org.jbpm.test.JbpmTestCase;
/** shows explicitely the part of the API that is
* provided by JbpmTestCase as a convenience.
@@ -19,13 +18,6 @@
public class ServicesTest extends TestCase {
public void testObtainServicesAndDeployProcess() {
-
- if(JbpmTestCase.isIntegrationTest())
- {
- // Not part of the integration test suite
- return;
- }
-
// create a configuration
Configuration configuration = new Configuration();
// build a process engine from a configuration
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -22,7 +22,6 @@
package org.jbpm.examples.sql;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
@@ -36,34 +35,46 @@
*/
public class SqlTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ long taskLaundryDbid;
+ long taskDishesDbid;
+ long taskIronDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-SqlTest.jpdl");
- }
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-SqlTest.jpdl");
- super.tearDown();
- }
-
- public void testSql() {
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/sql/process.jpdl.xml")
+ .deploy();
+
// add task laundry
Task task = taskService.newTask();
task.setName("laundry");
- saveAndRegisterTask(task);
+ taskLaundryDbid = taskService.saveTask(task);
// add task dishes
task = taskService.newTask();
task.setName("dishes");
- saveAndRegisterTask(task);
+ taskDishesDbid = taskService.saveTask(task);
// add task iron
task = taskService.newTask();
task.setName("iron");
- saveAndRegisterTask(task);
+ taskIronDbid = taskService.saveTask(task);
+ }
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ taskService.deleteTask(taskLaundryDbid);
+ taskService.deleteTask(taskDishesDbid);
+ taskService.deleteTask(taskIronDbid);
+
+ super.tearDown();
+ }
+
+ public void testSql() {
Execution execution = executionService.startProcessInstanceByKey("Sql");
String executionId = execution.getId();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -21,7 +21,7 @@
*/
package org.jbpm.examples.state.choice;
-import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmTestCase;
@@ -30,29 +30,45 @@
*/
public class StateChoiceTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-StateChoiceTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/state/choice/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-StateChoiceTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testStateChoiceAccept() {
- Execution execution = executionService.startProcessInstanceByKey("StateChoice");
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId, "accept");
- assertEquals("submit document", execution.getActivityName());
+ ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("StateChoice");
+
+ String executionId = processInstance
+ .findActiveExecutionIn("wait for response")
+ .getId();
+
+ processInstance = executionService.signalExecutionById(executionId, "accept");
+
+ assertEquals("submit document", processInstance.getActivityName());
}
public void testStateChoiceReject() {
- Execution execution = executionService.startProcessInstanceByKey("StateChoice");
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId, "reject");
- assertEquals("try again", execution.getActivityName());
+ ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("StateChoice");
+
+ String executionId = processInstance
+ .findActiveExecutionIn("wait for response")
+ .getId();
+
+ processInstance = executionService.signalExecutionById(executionId, "reject");
+
+ assertEquals("try again", processInstance.getActivityName());
}
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -22,6 +22,7 @@
package org.jbpm.examples.state.sequence;
import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmTestCase;
@@ -30,28 +31,33 @@
*/
public class StateSequenceTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-StateSequenceTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/state/sequence/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-StateSequenceTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testWaitStatesSequence() {
- Execution execution = executionService.startProcessInstanceByKey("StateSequence");
- assertEquals("a", execution.getActivityName());
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("StateSequence");
+ Execution executionInA = processInstance.findActiveExecutionIn("a");
+ assertNotNull(executionInA);
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId);
- assertEquals("b", execution.getActivityName());
+ processInstance = executionService.signalExecutionById(executionInA.getId());
+ Execution executionInB = processInstance.findActiveExecutionIn("b");
+ assertNotNull(executionInB);
- execution = executionService.signalExecutionById(executionId);
- assertEquals("c", execution.getActivityName());
+ processInstance = executionService.signalExecutionById(executionInB.getId());
+ Execution executionInC = processInstance.findActiveExecutionIn("c");
+ assertNotNull(executionInC);
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -35,15 +35,19 @@
*/
public class TaskAssigneeTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-TaskAssigneeTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/task/assignee/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-TaskAssigneeTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
@@ -70,5 +74,4 @@
execution = executionService.findExecutionById(executionId);
assertEquals("wait", execution.getActivityName());
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -31,20 +31,23 @@
*/
public class TaskAssignmentHandlerTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-TaskAssignmentHandlerTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-TaskAssignmentHandlerTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
public void testTaskAssignmentHandler() {
-
executionService.startProcessInstanceByKey("TaskAssignmentHandler");
List<Task> taskList = taskService.findAssignedTasks("johndoe");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,28 +33,35 @@
*/
public class TaskCandidatesTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-TaskCandidatesTest.jpdl");
+ // create identities
+ identityService.createGroup("sales-dept");
- if(identityService.findGroupById("sales-dept")==null)
- {
- // create johndoe and joesmoe as members of the sales group
- identityService.createGroup("sales-dept");
+ identityService.createUser("johndoe", "johndoe", "John", "Doe");
+ identityService.createMembership("johndoe", "sales-dept");
- identityService.createUser("johndoe", "johndoe", "John", "Doe");
- identityService.createMembership("johndoe", "sales-dept");
+ identityService.createUser("joesmoe", "joesmoe", "Joe", "Smoe");
+ identityService.createMembership("joesmoe", "sales-dept");
- identityService.createUser("joesmoe", "joesmoe", "Joe", "Smoe");
- identityService.createMembership("joesmoe", "sales-dept");
- }
+ // deploy process
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/task/candidates/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-TaskCandidatesTest.jpdl");
+ protected void tearDown() throws Exception {
+ // delete process deployment
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ // delete identities
+ identityService.deleteGroup("sales-dept");
+ identityService.deleteUser("johndoe");
+ identityService.deleteUser("joesmoe");
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -32,24 +32,32 @@
*/
public class TaskSwimlaneTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-TaskSwimlaneTest.jpdl");
+
+ // create identities
+ identityService.createGroup("sales-dept");
- if(identityService.findGroupById("sales-dept")==null)
- {
- // create johndoe and joesmoe as members of the sales group
- identityService.createGroup("sales-dept");
-
- identityService.createUser("johndoe", "johndoe", "John", "Doe");
- identityService.createMembership("johndoe", "sales-dept");
- }
+ identityService.createUser("johndoe", "johndoe", "John", "Doe");
+ identityService.createMembership("johndoe", "sales-dept");
+
+ // deploy process
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/task/swimlane/process.jpdl.xml")
+ .deploy();
+
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-TaskSwimlaneTest.jpdl");
+ protected void tearDown() throws Exception {
+ // delete process deployment
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ // delete identities
+ identityService.deleteGroup("sales-dept");
+ identityService.deleteUser("johndoe");
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -38,15 +38,19 @@
*/
public class TaskVariablesTest extends JbpmTestCase {
- protected void setUp() throws Exception
- {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
super.setUp();
- deploy("jbpm-TaskVariablesTest.jpdl");
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/task/variables/process.jpdl.xml")
+ .deploy();
}
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-TaskVariablesTest.jpdl");
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,9 +33,23 @@
static long HOUR_IN_MILLIS = 60*60*100;
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/timer/businesstime/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ super.tearDown();
+ }
+
public void testBusinessTime() {
- deployJpdlResource("org/jbpm/examples/timer/businesstime/process.jpdl.xml");
-
long now = System.currentTimeMillis();
ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerBusinessTime");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -36,9 +36,23 @@
*/
public class TimerEventTest extends JbpmTestCase {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/timer/event/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ super.tearDown();
+ }
+
public void testTimerEventTimerFires() {
- deployJpdlResource("org/jbpm/examples/timer/event/process.jpdl.xml");
-
ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerEvent");
Job job = managementService.createJobQuery()
@@ -57,8 +71,6 @@
}
public void testTimerEventContinueBeforeTimerFires() {
- deployJpdlResource("org/jbpm/examples/timer/event/process.jpdl.xml");
-
ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerEvent");
String executionId = processInstance.findActiveExecutionIn("guardedWait").getId();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -31,9 +31,23 @@
*/
public class TimerRepeatTest extends JbpmTestCase {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/timer/repeat/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ super.tearDown();
+ }
+
public void testTimerRepeat() {
- deployJpdlResource("org/jbpm/examples/timer/repeat/process.jpdl.xml");
-
ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerRepeat");
Job job = managementService.createJobQuery()
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -33,9 +33,23 @@
*/
public class TimerTransitionTest extends JbpmTestCase {
+ long deploymentDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/timer/transition/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ super.tearDown();
+ }
+
public void testTimerTransitionTimerFires() {
- deployJpdlResource("org/jbpm/examples/timer/transition/process.jpdl.xml");
-
Execution processInstance = executionService.startProcessInstanceByKey("TimerTransition");
Job job = managementService.createJobQuery()
@@ -51,8 +65,6 @@
}
public void testTimerTransitionContinueBeforeTimerFires() {
- deployJpdlResource("org/jbpm/examples/timer/transition/process.jpdl.xml");
-
Execution processInstance = executionService.startProcessInstanceByKey("TimerTransition");
String executionId = processInstance.findActiveExecutionIn("guardedWait").getId();
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/choice/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/choice/process.jpdl.xml 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/choice/process.jpdl.xml 2009-04-18 17:43:48 UTC (rev 4578)
@@ -2,16 +2,16 @@
<process name="StateChoice" xmlns="http://jbpm.org/4/jpdl">
- <start g="16,60,48,48">
- <transition to="wait for response" name=""/>
+ <start g="16,60,48,48">
+ <transition to="wait for response"/>
</start>
- <state g="96,58,109,52" name="wait for response">
- <transition g="151,41:-48,0" name="accept" to="submit document"/>
- <transition g="151,125:-47,-17" name="reject" to="try again"/>
+ <state name="wait for response" g="96,58,109,52">
+ <transition name="accept" to="submit document" g="151,41:-48,0" />
+ <transition name="reject" to="try again" g="151,125:-47,-17" />
</state>
- <state g="237,16,114,52" name="submit document"/>
- <state g="237,100,114,52" name="try again"/>
+ <state name="submit document" g="237,16,114,52" />
+ <state name="try again" g="237,100,114,52" />
</process>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateBinding.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateBinding.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -21,8 +21,6 @@
*/
package org.jbpm.jpdl.internal.activity;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessActivity extends JpdlExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Map<String, String> inSwimlaneMappings;
+ protected List<VariableDefinitionImpl> inDefinitions;
+ protected List<VariableDefinitionImpl> outDefinitions;
+ protected Map<String, String> outcomeStateMappings;
+ protected Map<String, String> outcomeVariableMappings;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
+ }
+
+ public void setInSwimlaneMappings(Map<String, String> inSwimlaneMappings) {
+ this.inSwimlaneMappings = inSwimlaneMappings;
+ }
+ public void setInDefinitions(List<VariableDefinitionImpl> inDefinitions) {
+ this.inDefinitions = inDefinitions;
+ }
+ public void setOutDefinitions(List<VariableDefinitionImpl> outDefinitions) {
+ this.outDefinitions = outDefinitions;
+ }
+ public void setOutcomeStateMappings(Map<String, String> outcomeStateMappings) {
+ this.outcomeStateMappings = outcomeStateMappings;
+ }
+ public void setOutcomeVariableMappings(Map<String, String> outcomeVariableMappings) {
+ this.outcomeVariableMappings = outcomeVariableMappings;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,49 @@
+/*
+ * 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.jbpm.jpdl.internal.activity;
+
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessBinding extends JpdlBinding {
+
+ public SubProcessBinding() {
+ super("sub-process");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+
+ String subProcessKey = XmlUtil.attribute(element, "process-key");
+ String subProcessId = XmlUtil.attribute(element, "process-id");
+
+
+
+ return null;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -44,11 +44,13 @@
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.ScopeElementImpl;
import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.operation.Operation;
import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -206,13 +208,13 @@
return processDefinition;
}
- private void resolveTransitionDestinations(Parse parse, JpdlProcessDefinition processDefinition, UnresolvedTransitions unresolvedTransitions) {
+ protected void resolveTransitionDestinations(Parse parse, JpdlProcessDefinition processDefinition, UnresolvedTransitions unresolvedTransitions) {
for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
unresolvedTransition.resolve(processDefinition, parse);
}
}
- private void parseActivities(Element documentElement, Parse parse, JpdlProcessDefinition processDefinition) {
+ public void parseActivities(Element documentElement, Parse parse, JpdlProcessDefinition processDefinition) {
List<Element> elements = XmlUtil.elements(documentElement);
for (Element element: elements) {
if ( !"on".equals(XmlUtil.getTagLocalName(element))
@@ -369,6 +371,9 @@
String taskName = XmlUtil.attribute(element, "name");
taskDefinition.setName(taskName);
+
+ String form = XmlUtil.attribute(element, "form");
+ taskDefinition.setForm(form);
ProcessDefinitionImpl processDefinition = parse.findObject(ProcessDefinitionImpl.class);
if (processDefinition.getTaskDefinition(taskName)!=null) {
@@ -430,4 +435,41 @@
}
return objectDescriptor;
}
+
+
+ public static List<VariableDefinitionImpl> parseVariableDefinitions(Element element, Parse parse, boolean initRequired) {
+ List<VariableDefinitionImpl> variableDefinitions = new ArrayList<VariableDefinitionImpl>();
+
+ for (Element inElement: XmlUtil.elements(element, "variable")) {
+ VariableDefinitionImpl variableDefinition = new VariableDefinitionImpl();
+
+ String name = XmlUtil.attribute(inElement, "name", true, parse);
+ variableDefinition.setName(name);
+
+ int sources = 0;
+
+ String initExpr = XmlUtil.attribute(inElement, "init");
+ if (initExpr!=null) {
+ variableDefinition.setInExpression(initExpr);
+ sources++;
+ }
+
+ Element initElement = XmlUtil.element(inElement, "init");
+ if (initElement!=null) {
+ Descriptor initValueDescriptor = (Descriptor) WireParser.getInstance().parseElement(initElement, parse);
+ variableDefinition.setInDescriptor(initValueDescriptor);
+ sources++;
+ }
+
+ if (initRequired && sources==0) {
+ parse.addProblem("no init specified", inElement);
+ }
+ if (sources>1) {
+ parse.addProblem("init attribute and init element are mutually exclusive on element variable", inElement);
+ }
+ }
+
+ return variableDefinitions;
+ }
+
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -63,11 +63,6 @@
return this;
}
- public VariableBuilder outVariable(String outVariable) {
- variableDefinition.setOutVariableName(outVariable);
- return this;
- }
-
public CompositeBuilder endVariable() {
return compositeBuilder;
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,50 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CreateGroup implements Command<String> {
-
- private static final long serialVersionUID = 1L;
-
- protected String groupName;
- protected String groupType;
- protected String parentGroupId;
-
- public CreateGroup(String groupName, String groupType, String parentGroupId) {
- this.groupName = groupName;
- this.groupType = groupType;
- this.parentGroupId = parentGroupId;
- }
-
- public String execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.createGroup(groupName, groupType, parentGroupId);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,50 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateGroupCmd implements Command<String> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String groupName;
+ protected String groupType;
+ protected String parentGroupId;
+
+ public CreateGroupCmd(String groupName, String groupType, String parentGroupId) {
+ this.groupName = groupName;
+ this.groupType = groupType;
+ this.parentGroupId = parentGroupId;
+ }
+
+ public String execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.createGroup(groupName, groupType, parentGroupId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,51 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CreateMembership implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userId;
- protected String groupId;
- protected String role;
-
- public CreateMembership(String userId, String groupId, String role) {
- this.userId = userId;
- this.groupId = groupId;
- this.role = role;
- }
-
- public Object execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.createMembership(userId, groupId, role);
- return null;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,51 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateMembershipCmd implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String groupId;
+ protected String role;
+
+ public CreateMembershipCmd(String userId, String groupId, String role) {
+ this.userId = userId;
+ this.groupId = groupId;
+ this.role = role;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.createMembership(userId, groupId, role);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUser.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUser.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CreateUser implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userId;
- protected String password;
- protected String givenName;
- protected String familyName;
-
- public CreateUser(String userId, String password, String givenName, String familyName) {
- this.userId = userId;
- this.password = password;
- this.givenName = givenName;
- this.familyName = familyName;
- }
-
-
- public Void execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.createUser(userId, password, givenName, familyName);
- return null;
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUser.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,55 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateUserCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String password;
+ protected String givenName;
+ protected String familyName;
+
+ public CreateUserCmd(String userId, String password, String givenName, String familyName) {
+ this.userId = userId;
+ this.password = password;
+ this.givenName = givenName;
+ this.familyName = familyName;
+ }
+
+
+ public Void execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.createUser(userId, password, givenName, familyName);
+ return null;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,47 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeleteGroup implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String groupId;
-
- public DeleteGroup(String groupId) {
- this.groupId = groupId;
- }
-
- public Void execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.deleteGroup(groupId);
- return null;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeleteGroupCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String groupId;
+
+ public DeleteGroupCmd(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.deleteGroup(groupId);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,52 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeleteMembership implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userId;
- protected String groupId;
- protected String role;
-
- public DeleteMembership(String userId, String groupId, String role) {
- this.userId = userId;
- this.groupId = groupId;
- this.role = role;
- }
-
- public Object execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.deleteMembership(userId, groupId, role);
- return null;
- }
-
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeleteMembershipCmd implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String groupId;
+ protected String role;
+
+ public DeleteMembershipCmd(String userId, String groupId, String role) {
+ this.userId = userId;
+ this.groupId = groupId;
+ this.role = role;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.deleteMembership(userId, groupId, role);
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUser.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUser.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,48 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeleteUser implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userId;
-
- public DeleteUser(String userId) {
- this.userId = userId;
- }
-
- public Void execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.deleteUser(userId);
- return null;
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUser.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeleteUserCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+
+ public DeleteUserCmd(String userId) {
+ this.userId = userId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.deleteUser(userId);
+ return null;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,47 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindGroup implements Command<Group> {
-
- private static final long serialVersionUID = 1L;
-
- String groupId;
-
- public FindGroup(String groupId) {
- this.groupId = groupId;
- }
-
- public Group execute(Environment environment) {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.findGroupById(groupId);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.identity.Group;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindGroupCmd implements Command<Group> {
+
+ private static final long serialVersionUID = 1L;
+
+ String groupId;
+
+ public FindGroupCmd(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public Group execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findGroupById(groupId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,58 +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.jbpm.pvm.internal.identity.cmd;
-
-import java.util.List;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindGroups implements Command<List<Group>> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userId;
- protected String groupType;
-
- public FindGroups(String userId) {
- this.userId = userId;
- }
-
- public FindGroups(String userId, String groupType) {
- this.userId = userId;
- this.groupType = groupType;
- }
-
- public List<Group> execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- if (groupType!=null) {
- return identitySession.findGroupsByUserAndGroupType(userId, groupType);
- }
- return identitySession.findGroupsByUser(userId);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,58 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import java.util.List;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.identity.Group;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindGroupsCmd implements Command<List<Group>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String groupType;
+
+ public FindGroupsCmd(String userId) {
+ this.userId = userId;
+ }
+
+ public FindGroupsCmd(String userId, String groupType) {
+ this.userId = userId;
+ this.groupType = groupType;
+ }
+
+ public List<Group> execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ if (groupType!=null) {
+ return identitySession.findGroupsByUserAndGroupType(userId, groupType);
+ }
+ return identitySession.findGroupsByUser(userId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,47 +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.jbpm.pvm.internal.identity.cmd;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.identity.User;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindUser implements Command<User> {
-
- private static final long serialVersionUID = 1L;
-
- String userId;
-
- public FindUser(String userId) {
- this.userId = userId;
- }
-
- public User execute(Environment environment) {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.findUserById(userId);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.identity.User;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindUserCmd implements Command<User> {
+
+ private static final long serialVersionUID = 1L;
+
+ String userId;
+
+ public FindUserCmd(String userId) {
+ this.userId = userId;
+ }
+
+ public User execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findUserById(userId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -1,43 +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.jbpm.pvm.internal.identity.cmd;
-
-import java.util.List;
-
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.identity.User;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindUsers implements Command<List<User>> {
-
- private static final long serialVersionUID = 1L;
-
- public List<User> execute(Environment environment) {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.findUsers();
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java (from rev 4573, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,43 @@
+/*
+ * 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.jbpm.pvm.internal.identity.cmd;
+
+import java.util.List;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.identity.User;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindUsersCmd implements Command<List<User>> {
+
+ private static final long serialVersionUID = 1L;
+
+ public List<User> execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findUsers();
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -66,7 +66,23 @@
}
public void deleteUser(String userId) {
+ // lookup the user
User user = findUserById(userId);
+
+ // cascade the deletion to the memberships
+ Query query = session.createQuery(
+ "from "+MembershipImpl.class.getName()+" as m "+
+ "where m.user is :user"
+ );
+ query.setEntity("user", user);
+ List<MembershipImpl> memberships = query.list();
+
+ // delete the related memberships
+ for (MembershipImpl membership: memberships) {
+ session.delete(membership);
+ }
+
+ // delete the user
session.delete(user);
}
@@ -128,7 +144,23 @@
}
public void deleteGroup(String groupId) {
+ // look up the group
GroupImpl group = findGroupById(groupId);
+
+ // cascade the deletion to the memberships
+ Query query = session.createQuery(
+ "from "+MembershipImpl.class.getName()+" as m "+
+ "where m.group is :group"
+ );
+ query.setEntity("group", group);
+ List<MembershipImpl> memberships = query.list();
+
+ // delete the related memberships
+ for (MembershipImpl membership: memberships) {
+ session.delete(membership);
+ }
+
+ // delete the group
session.delete(group);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -22,6 +22,7 @@
package org.jbpm.pvm.internal.identity.impl;
import java.io.Serializable;
+import java.util.Set;
import org.jbpm.api.identity.User;
@@ -41,7 +42,7 @@
protected String familyName;
protected String emailAddress;
protected String password;
-
+
public UserImpl() {
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -252,7 +252,6 @@
public ExecutionImpl destroyScope(CompositeElementImpl scope) {
destroyTimers(scope);
- destroyVariables(scope, parent);
// copy the current state from the child execution to the parent execution
getParent().setActivity(getActivity());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -34,22 +34,26 @@
private static final long serialVersionUID = 1L;
- protected boolean hasVariableDefinitions;
protected List<VariableDefinitionImpl> variableDefinitions;
- protected boolean hasTimerDefinitions;
protected Set<TimerDefinitionImpl> timerDefinitions;
public boolean isLocalScope() {
- return hasVariableDefinitions || hasTimerDefinitions;
+ return hasVariableDefinitions() || hasTimerDefinitions();
}
// variable definitions /////////////////////////////////////////////////////
+ public boolean hasVariableDefinitions() {
+ return ( (variableDefinitions!=null)
+ && (!variableDefinitions.isEmpty())
+ );
+ }
+
public List<VariableDefinitionImpl> getVariableDefinitions() {
- if (!hasVariableDefinitions) {
+ if (!hasVariableDefinitions()) {
return Collections.EMPTY_LIST;
}
- return (List) variableDefinitions;
+ return variableDefinitions;
}
public VariableDefinitionImpl createVariableDefinition() {
@@ -58,14 +62,19 @@
variableDefinitions = new ArrayList<VariableDefinitionImpl>();
}
variableDefinitions.add(variableDefinition);
- hasVariableDefinitions = true;
return variableDefinition;
}
// timer definitions ////////////////////////////////////////////////////////
-
+
+ public boolean hasTimerDefinitions() {
+ return ( (timerDefinitions!=null)
+ && (!timerDefinitions.isEmpty())
+ );
+ }
+
public Set<TimerDefinitionImpl> getTimerDefinitions() {
- if (!hasTimerDefinitions) {
+ if (!hasTimerDefinitions()) {
return Collections.EMPTY_SET;
}
return timerDefinitions;
@@ -77,7 +86,6 @@
timerDefinitions = new HashSet<TimerDefinitionImpl>();
}
timerDefinitions.add(timerDefinition);
- hasTimerDefinitions = true;
return timerDefinition;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -83,26 +83,6 @@
}
}
- protected void destroyVariables(ScopeElementImpl scope, ExecutionImpl outerExecution) {
- // loop over all variable definitions
- List<VariableDefinitionImpl> variableDefinitions = scope.getVariableDefinitions();
- if (variableDefinitions!=null) {
- if (log.isTraceEnabled()) {
- log.trace("destroying var scope "+scope);
- }
-
- for (VariableDefinitionImpl variableDefinition: variableDefinitions) {
- String destination = variableDefinition.getOutVariableName();
- if (destination!=null) {
- String key = variableDefinition.getName();
- Object value = variableDefinition.getOutValue(this);
- outerExecution.setVariable(key, value);
- }
- }
- }
- }
-
-
public void createVariable(String key, Object value) {
createVariable(key, value, null);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -39,9 +39,6 @@
private static final long serialVersionUID = 1L;
- protected long dbid;
- protected int dbversion;
-
protected String name;
protected String typeName;
@@ -49,9 +46,6 @@
protected String inExpression;
protected Descriptor inDescriptor;
- protected String outVariableName;
- protected String outExpression;
-
public Object getInValue(ExecutionImpl execution) {
if (inDescriptor!=null) {
return WireContext.create(inDescriptor);
@@ -65,19 +59,6 @@
return null;
}
- public Object getOutValue(ScopeInstanceImpl scopeInstanceImpl) {
- if (outExpression!=null) {
- throw new UnsupportedOperationException("TODO add variable out expression resolution");
- }
- if (name!=null) {
- return scopeInstanceImpl.getVariable(name);
- }
- return null;
- }
-
- public long getDbid() {
- return dbid;
- }
public String getName() {
return name;
}
@@ -102,18 +83,6 @@
public void setInDescriptor(Descriptor inDescriptor) {
this.inDescriptor = inDescriptor;
}
- public String getOutVariableName() {
- return outVariableName;
- }
- public void setOutVariableName(String outVariableName) {
- this.outVariableName = outVariableName;
- }
- public String getOutExpression() {
- return outExpression;
- }
- public void setOutExpression(String outExpression) {
- this.outExpression = outExpression;
- }
public String getTypeName() {
return typeName;
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,64 @@
+/*
+ * 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.jbpm.pvm.internal.model;
+
+import java.io.Serializable;
+
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableOutDefinitionImpl implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String variableName;
+ protected String expression;
+ protected String language;
+
+ public Object getOutValue(ExecutionImpl execution) {
+ ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ return scriptManager.evaluateExpression(expression, execution, language);
+ }
+
+ public String getVariableName() {
+ return variableName;
+ }
+ public void setVariableName(String variableName) {
+ this.variableName = variableName;
+ }
+ public String getExpression() {
+ return expression;
+ }
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+ public String getLanguage() {
+ return language;
+ }
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -0,0 +1,72 @@
+/*
+ * 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.jbpm.pvm.internal.model;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableOutDefinitionSet implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected List<VariableOutDefinitionImpl> variableOutDefinitions;
+
+ protected void destroy(ExecutionImpl outerExecution) {
+ // loop over all variable definitions
+ if (hasVariableOutDefinitions()) {
+ for (VariableOutDefinitionImpl variableOutDefinition: variableOutDefinitions) {
+ String destination = variableOutDefinition.getVariableName();
+ if (destination!=null) {
+ Object value = variableOutDefinition.getOutValue(outerExecution);
+ outerExecution.setVariable(destination, value);
+ }
+ }
+ }
+ }
+
+ public boolean hasVariableOutDefinitions() {
+ return ( (variableOutDefinitions==null)
+ || (variableOutDefinitions.isEmpty())
+ );
+ }
+
+ public List<VariableOutDefinitionImpl> getVariableOutDefinitions() {
+ if (variableOutDefinitions==null) {
+ return Collections.EMPTY_LIST;
+ }
+ return variableOutDefinitions;
+ }
+
+ public VariableOutDefinitionImpl createVariableOutDefinition() {
+ VariableOutDefinitionImpl variableOutDefinition = new VariableOutDefinitionImpl();
+ if (variableOutDefinitions==null) {
+ variableOutDefinitions = new ArrayList<VariableOutDefinitionImpl>();
+ }
+ variableOutDefinitions.add(variableOutDefinition);
+ return variableOutDefinition;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -6,7 +6,7 @@
import org.jbpm.api.cmd.Command;
import org.jbpm.api.env.Environment;
import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.identity.cmd.FindGroups;
+import org.jbpm.pvm.internal.identity.cmd.FindGroupsCmd;
public class FindGroupIds implements Command<List<String>> {
@@ -22,7 +22,7 @@
public List<String> execute(Environment environment) throws Exception {
List<String> groupIds = new ArrayList<String>();
- FindGroups findGroupsCmd = new FindGroups(userId);
+ FindGroupsCmd findGroupsCmd = new FindGroupsCmd(userId);
List<Group> groups = findGroupsCmd.execute(environment);
for (Group group: groups) {
groupIds.add(group.getId());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/IdentityServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/IdentityServiceImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/IdentityServiceImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -27,16 +27,16 @@
import org.jbpm.api.cmd.CommandService;
import org.jbpm.api.identity.Group;
import org.jbpm.api.identity.User;
-import org.jbpm.pvm.internal.identity.cmd.CreateGroup;
-import org.jbpm.pvm.internal.identity.cmd.CreateMembership;
-import org.jbpm.pvm.internal.identity.cmd.CreateUser;
-import org.jbpm.pvm.internal.identity.cmd.DeleteGroup;
-import org.jbpm.pvm.internal.identity.cmd.DeleteMembership;
-import org.jbpm.pvm.internal.identity.cmd.DeleteUser;
-import org.jbpm.pvm.internal.identity.cmd.FindGroup;
-import org.jbpm.pvm.internal.identity.cmd.FindGroups;
-import org.jbpm.pvm.internal.identity.cmd.FindUser;
-import org.jbpm.pvm.internal.identity.cmd.FindUsers;
+import org.jbpm.pvm.internal.identity.cmd.CreateGroupCmd;
+import org.jbpm.pvm.internal.identity.cmd.CreateMembershipCmd;
+import org.jbpm.pvm.internal.identity.cmd.CreateUserCmd;
+import org.jbpm.pvm.internal.identity.cmd.DeleteGroupCmd;
+import org.jbpm.pvm.internal.identity.cmd.DeleteMembershipCmd;
+import org.jbpm.pvm.internal.identity.cmd.DeleteUserCmd;
+import org.jbpm.pvm.internal.identity.cmd.FindGroupCmd;
+import org.jbpm.pvm.internal.identity.cmd.FindGroupsCmd;
+import org.jbpm.pvm.internal.identity.cmd.FindUserCmd;
+import org.jbpm.pvm.internal.identity.cmd.FindUsersCmd;
/**
@@ -47,35 +47,35 @@
protected CommandService commandService;
public void createUser(String userId, String password, String givenName, String familyName) {
- commandService.execute(new CreateUser(userId, password, givenName, familyName));
+ commandService.execute(new CreateUserCmd(userId, password, givenName, familyName));
}
public User findUserById(String userId) {
- return commandService.execute(new FindUser(userId));
+ return commandService.execute(new FindUserCmd(userId));
}
public List<User> findUsers() {
- return commandService.execute(new FindUsers());
+ return commandService.execute(new FindUsersCmd());
}
public void deleteUser(String userId) {
- commandService.execute(new DeleteUser(userId));
+ commandService.execute(new DeleteUserCmd(userId));
}
public String createGroup(String groupName) {
- return commandService.execute(new CreateGroup(groupName, null, null));
+ return commandService.execute(new CreateGroupCmd(groupName, null, null));
}
public String createGroup(String groupName, String groupType) {
- return commandService.execute(new CreateGroup(groupName, groupType, null));
+ return commandService.execute(new CreateGroupCmd(groupName, groupType, null));
}
public String createGroup(String groupName, String groupType, String parentGroupId) {
- return commandService.execute(new CreateGroup(groupName, groupType, parentGroupId));
+ return commandService.execute(new CreateGroupCmd(groupName, groupType, parentGroupId));
}
public Group findGroupById(String groupId) {
- return commandService.execute(new FindGroup(groupId));
+ return commandService.execute(new FindGroupCmd(groupId));
}
public List<String> findGroupIdsByUser(String userId) {
@@ -83,27 +83,27 @@
}
public List<Group> findGroupsByUser(String userId) {
- return commandService.execute(new FindGroups(userId));
+ return commandService.execute(new FindGroupsCmd(userId));
}
public List<Group> findGroupsByUserAndGroupType(String userId, String groupType) {
- return commandService.execute(new FindGroups(userId, groupType));
+ return commandService.execute(new FindGroupsCmd(userId, groupType));
}
public void deleteGroup(String groupId) {
- commandService.execute(new DeleteGroup(groupId));
+ commandService.execute(new DeleteGroupCmd(groupId));
}
public void createMembership(String userId, String groupId) {
- commandService.execute(new CreateMembership(userId, groupId, null));
+ commandService.execute(new CreateMembershipCmd(userId, groupId, null));
}
public void createMembership(String userId, String groupId, String role) {
- commandService.execute(new CreateMembership(userId, groupId, role));
+ commandService.execute(new CreateMembershipCmd(userId, groupId, role));
}
public void deleteMembership(String userId, String groupId, String role) {
- commandService.execute(new DeleteMembership(userId, groupId, role));
+ commandService.execute(new DeleteMembershipCmd(userId, groupId, role));
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -52,11 +52,11 @@
return commandService.execute(new SaveTaskCmd((TaskImpl) task));
}
- public void cancelTask(long taskDbid) {
+ public void deleteTask(long taskDbid) {
commandService.execute(new CancelTaskCmd(taskDbid));
}
- public void cancelTask(long taskDbid, String reason) {
+ public void deleteTask(long taskDbid, String reason) {
commandService.execute(new CancelTaskCmd(taskDbid, reason));
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -29,7 +29,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
@@ -43,7 +42,7 @@
public Document document;
protected String lineAttributeName = "line";
- protected String columnAttributeName = null;
+ protected String columnAttributeName = "column";
/** Current activity */
protected Node currentNode = null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -37,6 +37,7 @@
import org.jbpm.pvm.internal.stream.StringStreamInput;
import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXParseException;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -29,6 +29,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.w3c.dom.Element;
/** list of problems. Base class for {@link Parse}
* and {@link DeploymentImpl}.
@@ -43,6 +44,51 @@
protected List<ProblemImpl> problems;
+ // problem constructor method ///////////////////////////////////////////////
+
+ public void addProblem(String msg, Exception e, String severity, Element element) {
+ ProblemImpl problem = new ProblemImpl(msg, e, severity);
+
+ if (element!=null) {
+ Integer line = (Integer) element.getUserData("line");
+ if (line!=null) {
+ problem.setLine(line);
+ }
+ Integer column = (Integer) element.getUserData("column");
+ if (column!=null) {
+ problem.setColumn(column);
+ }
+ }
+
+ addProblem(problem);
+ }
+
+ // problem constructor methods with default values //////////////////////////
+
+ /** add a problem with {@link ProblemImpl#TYPE_ERROR the default severity}.*/
+ public void addProblem(String msg) {
+ addProblem(msg, null, ProblemImpl.TYPE_ERROR, null);
+ }
+
+ /** add a problem with an exception cause and
+ * {@link ProblemImpl#TYPE_ERROR the default severity}.*/
+ public void addProblem(String msg, Exception e) {
+ addProblem(msg, e, ProblemImpl.TYPE_ERROR, null);
+ }
+
+ /** add a problem with {@link ProblemImpl#TYPE_ERROR the default severity}.*/
+ public void addProblem(String msg, Element element) {
+ addProblem(msg, null, ProblemImpl.TYPE_ERROR, element);
+ }
+
+ /** add a problem with an exception cause and
+ * {@link ProblemImpl#TYPE_ERROR the default severity}.*/
+ public void addProblem(String msg, Exception e, Element element) {
+ addProblem(msg, e, ProblemImpl.TYPE_ERROR, element);
+ }
+
+ // problem mgmt methods /////////////////////////////////////////////////////
+
/** all problems encountered */
public List<Problem> getProblems() {
if (problems==null) {
@@ -59,17 +105,6 @@
problems.add(problem);
}
- /** add a problem with {@link ProblemImpl#TYPE_ERROR the default severity}.*/
- public void addProblem(String msg) {
- addProblem(msg, null);
- }
-
- /** add a problem with an exception cause and
- * {@link ProblemImpl#TYPE_ERROR the default severity}.*/
- public void addProblem(String msg, Exception e) {
- addProblem(msg, e, ProblemImpl.TYPE_ERROR);
- }
-
/** add all problems */
public void addProblems(List<Problem> problems) {
if (this.problems==null) {
@@ -78,22 +113,6 @@
this.problems.addAll((List)problems);
}
- /** adds a problem with {@link ProblemImpl#TYPE_WARNING severity warning}.*/
- public void addWarning(String msg) {
- addWarning(msg, null);
- }
-
- /** adds a problem with {@link ProblemImpl#TYPE_WARNING severity warning}
- * and an exception as the cause.*/
- public void addWarning(String msg, Exception e) {
- addProblem(msg, e, ProblemImpl.TYPE_WARNING);
- }
-
- /** adds a problem given message, exception cause and severity */
- public void addProblem(String msg, Exception e, String severity) {
- addProblem(new ProblemImpl(msg, e, severity));
- }
-
/** indicates presence of problems */
public boolean hasProblems() {
return ((problems != null) && (problems.size() > 0));
@@ -104,7 +123,7 @@
public void setProblems(List<Problem> problems) {
this.problems = (List)problems;
}
-
+
public JbpmException getJbpmException() {
if (! hasProblems()) {
return null;
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -21,19 +21,20 @@
*/
package org.jbpm.test;
-import org.jbpm.api.*;
-import org.jbpm.api.cmd.CommandService;
-import org.jbpm.api.job.Job;
-import org.jbpm.api.task.Task;
-import org.jbpm.test.enterprise.IntegrationTestHelper;
-
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.zip.ZipInputStream;
-import java.net.URL;
-import java.io.IOException;
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.HistoryService;
+import org.jbpm.api.IdentityService;
+import org.jbpm.api.ManagementService;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.cmd.CommandService;
+import org.jbpm.api.task.Task;
+
/** base class for persistent jBPM tests.
*
* This class exposes a lot of extra convenience methods for testing
@@ -49,13 +50,6 @@
* empty. If not, that is logged with a F I X M E and the DB tables
* are cleaned.
*
- * Convenience method {@link #deployJpdlResource(String)} will automatically keep track
- * of the deployed process and delete it (and all the related executions)
- * before the check is done.
- *
- * Similarly, the {@link #saveAndRegisterTask(Task)} will delete
- * the task before the check is done in the tearDown.
- *
* @author Tom Baeyens
* @author Heiko Braun
*/
@@ -75,12 +69,7 @@
/** registered deployments. registered deployments will be deleted automatically
* in the tearDown. This is a convenience function as each test is expected to clean up the DB. */
protected List<Long> registeredDeployments = new ArrayList<Long>();
- /** registered tasks will be deleted automatically in the tearDown.
- * This is a convenience function as each test is expected to clean up the DB. */
- protected List<Long> registeredTaskIds = new ArrayList<Long>();
- private IntegrationTestHelper testHelper = null;
-
protected void setUp() throws Exception {
super.setUp();
initialize();
@@ -110,77 +99,19 @@
}
protected void tearDown() throws Exception {
-
for (Long deploymentDbid : registeredDeployments) {
repositoryService.deleteDeploymentCascade(deploymentDbid);
}
- for (Long taskDbid : registeredTaskIds) {
- taskService.cancelTask(taskDbid);
- }
-
Db.verifyClean(processEngine);
super.tearDown();
}
- @Deprecated
- protected void deploy(String archive) {
- if (isIntegrationTest())
- remoteDeploy(archive);
- else
- localDeploy(archive);
- }
+ // deployment helper methods ////////////////////////////////////////////////
- @Deprecated
- private void remoteDeploy(String archive) {
- try {
- getTestHelper().deploy(archive);
- } catch (Exception e) {
- throw new RuntimeException("Failed to deploy " + archive, e);
- }
- }
-
- @Deprecated
- protected void undeploy(String archive) {
- if (isIntegrationTest())
- remoteUndeploy(archive);
-
- // TODO: localUndeploy() happens in tearDown()
- }
-
- @Deprecated
- private void localUndeploy(String archive) {
- // TODO: Match archive with dbId, but for now undeploy any
- for (Long deploymentDbid : registeredDeployments) {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
- }
- }
-
- @Deprecated
- private void remoteUndeploy(String archive) {
- try {
- getTestHelper().undeploy(archive);
- } catch (Exception e) {
- throw new RuntimeException("Failed to undeploy " + archive, e);
- }
- }
-
- protected IntegrationTestHelper getTestHelper() {
- if(!isIntegrationTest())
- throw new IllegalArgumentException("'jboss.bind.address' system property is missing");
-
- if(null==testHelper)
- testHelper = new IntegrationTestHelper();
-
- return testHelper;
- }
-
- @Deprecated
- public static boolean isIntegrationTest() {
- return System.getProperty("jboss.bind.address")!=null;
- }
-
+ /** deploys the process, keeps a reference to the deployment and
+ * automatically deletes the deployment in the tearDown */
public long deployJpdlXmlString(String jpdlXmlString) {
long deploymentDbid =
repositoryService.createDeployment()
@@ -192,45 +123,25 @@
return deploymentDbid;
}
- public void deployJpdlResource(String resource) {
- long deploymentDbid =
- repositoryService.createDeployment()
- .addResourceFromClasspath(resource)
- .deploy();
-
- registerDeployment(deploymentDbid);
+ /** registered deployments will be deleted in the tearDown */
+ protected void registerDeployment(long deploymentDbid) {
+ registeredDeployments.add(deploymentDbid);
}
- @Deprecated
- public void localDeploy(String archive) {
-
- URL archiveUrl = IntegrationTestHelper.getTestArchiveURL(archive);
-
- try
- {
- long deploymentDbid =
- repositoryService.createDeployment()
- .addResourcesFromZipInputStream(new ZipInputStream(archiveUrl.openStream()))
- .deploy();
-
- registerDeployment(deploymentDbid);
+ // task helper methods //////////////////////////////////////////////////////
+
+ public static void assertContainsTask(List<Task> taskList, String taskName) {
+ if (getTask(taskList, taskName)==null) {
+ fail("tasklist doesn't contain task '"+taskName+"': "+taskList);
}
- catch (IOException e)
- {
- throw new RuntimeException("local deploy failed", e);
- }
}
- protected void registerDeployment(long deploymentDbid) {
- registeredDeployments.add(deploymentDbid);
+ public static void assertContainsTask(List<Task> taskList, String taskName, String assignee) {
+ if (getTask(taskList, taskName, assignee)==null) {
+ fail("tasklist doesn't contain task '"+taskName+"' for assignee '"+assignee+"': "+taskList);
+ }
}
- public long saveAndRegisterTask(Task task) {
- long taskDbid = taskService.saveTask(task);
- registeredTaskIds.add(taskDbid);
- return taskDbid;
- }
-
public static Task getTask(List<Task> taskList, String taskName) {
for (Task task : taskList) {
if (taskName.equals(task.getName())) {
@@ -239,13 +150,7 @@
}
return null;
}
-
- public static void assertContainsTask(List<Task> taskList, String taskName) {
- if (getTask(taskList, taskName)==null) {
- fail("tasklist doesn't contain task '"+taskName+"': "+taskList);
- }
- }
-
+
public static Task getTask(List<Task> taskList, String taskName, String assignee) {
for (Task task : taskList) {
if (taskName.equals(task.getName())) {
@@ -262,28 +167,4 @@
}
return null;
}
-
- public void executeAsyncMessage(Execution execution) {
- List<Job> jobs = managementService
- .createJobQuery()
- .messages()
- .processInstanceId(execution.getId())
- .list();
-
- if (jobs.isEmpty()) {
- fail("no async message");
- }
-
- if (jobs.size()>1) {
- fail("more then one async message");
- }
-
- managementService.executeJob(jobs.get(0).getDbid());
- }
-
- public static void assertContainsTask(List<Task> taskList, String taskName, String assignee) {
- if (getTask(taskList, taskName, assignee)==null) {
- fail("tasklist doesn't contain task '"+taskName+"' for assignee '"+assignee+"': "+taskList);
- }
- }
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -11,6 +11,38 @@
public class HqlEventListenerTest extends JbpmTestCase {
+ long taskLaundryDbid;
+ long taskDishesDbid;
+ long taskIronDbid;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // add task laundry
+ Task task = taskService.newTask();
+ task.setName("laundry");
+ taskLaundryDbid = taskService.saveTask(task);
+
+ // add task dishes
+ task = taskService.newTask();
+ task.setName("dishes");
+ taskDishesDbid = taskService.saveTask(task);
+
+ // add task iron
+ task = taskService.newTask();
+ task.setName("iron");
+ taskIronDbid = taskService.saveTask(task);
+ }
+
+ protected void tearDown() throws Exception {
+ taskService.deleteTask(taskLaundryDbid);
+ taskService.deleteTask(taskDishesDbid);
+ taskService.deleteTask(taskIronDbid);
+
+ super.tearDown();
+ }
+
+
public void testHql() {
deployJpdlXmlString(
"<process name='HqlEventListener' xmlns='http://jbpm.org/4/jpdl'>" +
@@ -34,21 +66,6 @@
"</process>"
);
- // add task laundry
- Task task = taskService.newTask();
- task.setName("laundry");
- saveAndRegisterTask(task);
-
- // add task dishes
- task = taskService.newTask();
- task.setName("dishes");
- saveAndRegisterTask(task);
-
- // add task iron
- task = taskService.newTask();
- task.setName("iron");
- saveAndRegisterTask(task);
-
Execution execution = executionService.startProcessInstanceByKey("HqlEventListener");
String executionId = execution.getId();
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -39,13 +39,6 @@
public class DeploymentResourcesTest extends JbpmTestCase {
public void testProcessWithNameOnly() {
-
- if(isIntegrationTest())
- {
- // Not part of the integration test suite
- return;
- }
-
byte[] lotOfBytes = generateString("a lot of bytes ", 5000).getBytes();
byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -41,7 +41,7 @@
Task task = taskService.newTask();
task.setName("clean da house");
- long taskDbid = saveAndRegisterTask(task);
+ long taskDbid = taskService.saveTask(task);
// create 3 sub tasks:
// * clean da house
@@ -116,7 +116,7 @@
assertEquals(expectedTaskNames, subTaskNames);
// delete task dishes
- taskService.cancelTask(dishesTaskDbid);
+ taskService.deleteTask(dishesTaskDbid);
// verify all the sub tasks of 'clean da house' and 'sweep floor'
@@ -139,8 +139,8 @@
// delete laundry and delete sweep floor
// NOTE: deleting sweep floor should recursively delete the subtasks
- taskService.cancelTask(laundryTaskDbid);
- taskService.cancelTask(sweepFloorTaskDbid);
+ taskService.deleteTask(laundryTaskDbid);
+ taskService.deleteTask(sweepFloorTaskDbid);
subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
@@ -151,6 +151,8 @@
expectedTaskNames = new HashSet<String>();
assertEquals(expectedTaskNames, subTaskNames);
+
+ taskService.deleteTask(taskDbid);
}
private Set<String> getTaskNames(List<Task> tasks) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -67,6 +67,6 @@
// the following should delete the remaining comment. if not, this
// will show up as a fixme.
- taskService.cancelTask(taskDbid);
+ taskService.deleteTask(taskDbid);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -41,7 +41,7 @@
public void testSaveTask() {
Task task = taskService.newTask();
- long taskDbid = saveAndRegisterTask(task);
+ long taskDbid = taskService.saveTask(task);
// task was made persistent
task = taskService.getTask(taskDbid);
assertNotNull("expected non-null task", task);
@@ -55,6 +55,8 @@
// task.getDueDate() return an java.sql.Timestamp
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
assertEquals(df.format(dueDate), df.format(task.getDueDate()));
+
+ taskService.deleteTask(taskDbid);
}
public void testDeleteTask() {
@@ -64,7 +66,7 @@
// task was made persistent
assertNotNull("expected non-null task", taskService.getTask(taskDbid));
// delete task and verify it does not exist
- taskService.cancelTask(taskDbid);
+ taskService.deleteTask(taskDbid);
task = taskService.getTask(taskDbid);
assertNull("expected null, but was " + task, task);
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -138,7 +138,7 @@
Task task = taskService.createTaskQuery().list().get(0);
long taskDbid = task.getDbid();
- taskService.cancelTask(taskDbid);
+ taskService.deleteTask(taskDbid);
assertTrue(isTaskCancelCalled);
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -40,22 +40,22 @@
Task task = taskService.newTask();
task.setName("do laundry");
task.setAssignee("johndoe");
- saveAndRegisterTask(task);
+ long laundryTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("get good idea");
task.setAssignee("joesmoe");
- saveAndRegisterTask(task);
+ long ideaTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setAssignee("joesmoe");
- saveAndRegisterTask(task);
+ long capitalTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
- saveAndRegisterTask(task);
+ long startBusinessTaskDbid = taskService.saveTask(task);
List<Task> taskList = taskService.findAssignedTasks("johndoe");
assertNotNull(taskList);
@@ -71,6 +71,11 @@
assertContainsTask(taskList, "find venture capital");
assertEquals(3, taskList.size());
+
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(ideaTaskDbid);
+ taskService.deleteTask(laundryTaskDbid);
}
public void testPersonalTaskListDefaultSortOrder() {
@@ -78,31 +83,31 @@
task.setName("get good idea");
task.setAssignee("joesmoe");
task.setPriority(3);
- saveAndRegisterTask(task);
+ long ideaTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setAssignee("joesmoe");
task.setPriority(2);
- saveAndRegisterTask(task);
+ long capitalTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(1);
- saveAndRegisterTask(task);
+ long startBusinessTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("take a day off");
task.setAssignee("joesmoe");
task.setPriority(-5);
- saveAndRegisterTask(task);
+ long dayOffTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("make profit");
task.setAssignee("joesmoe");
task.setPriority(10);
- saveAndRegisterTask(task);
+ long profitTaskDbid = taskService.saveTask(task);
List<Task> taskList = taskService.findAssignedTasks("joesmoe");
assertNotNull(taskList);
@@ -115,5 +120,11 @@
assertEquals("take a day off", taskList.get(4).getName());
assertEquals(5, taskList.size());
+
+ taskService.deleteTask(profitTaskDbid);
+ taskService.deleteTask(dayOffTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(ideaTaskDbid);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -38,7 +38,7 @@
public void testTaskParticipants() {
Task task = taskService.newTask();
task.setName("do laundry");
- long taskDbid = saveAndRegisterTask(task);
+ long taskDbid = taskService.saveTask(task);
taskService.addTaskParticipatingUser(taskDbid, "johndoe", Participation.CANDIDATE);
taskService.addTaskParticipatingUser(taskDbid, "joesmoe", Participation.CANDIDATE);
@@ -92,6 +92,8 @@
expectedIds.add("dummies");
assertEquals(expectedIds, candidateGroupIds);
+
+ taskService.deleteTask(taskDbid);
}
public Set<String> extractParticipatingUserIds(List<Participation> taskParticipations, String participationType) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java 2009-04-17 20:12:41 UTC (rev 4577)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java 2009-04-18 17:43:48 UTC (rev 4578)
@@ -38,24 +38,24 @@
task.setName("do laundry");
task.setAssignee("johndoe");
task.setPriority(3);
- saveAndRegisterTask(task);
+ long laudryTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("change dyper");
task.setAssignee("johndoe");
task.setPriority(1);
- saveAndRegisterTask(task);
+ long dyperTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(4);
- saveAndRegisterTask(task);
+ long startBusinessTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setPriority(4);
- saveAndRegisterTask(task);
+ long capitalTaskDbid = taskService.saveTask(task);
List<Task> taskList = taskService
.createTaskQuery()
@@ -68,6 +68,11 @@
assertContainsTask(taskList, "find venture capital");
assertEquals(4, taskList.size());
+
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(dyperTaskDbid);
+ taskService.deleteTask(laudryTaskDbid);
}
public void testSimplestTaskQuerySortBy() {
@@ -75,24 +80,24 @@
task.setName("do laundry");
task.setAssignee("johndoe");
task.setPriority(3);
- saveAndRegisterTask(task);
+ long laudryTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("change dyper");
task.setAssignee("johndoe");
task.setPriority(1);
- saveAndRegisterTask(task);
+ long dyperTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(4);
- saveAndRegisterTask(task);
+ long startBusinessTaskDbid = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setPriority(7);
- saveAndRegisterTask(task);
+ long capitalTaskDbid = taskService.saveTask(task);
List<Task> taskList = taskService
.createTaskQuery()
@@ -106,6 +111,11 @@
assertEquals("start new business", taskList.get(3).getName());
assertEquals(4, taskList.size());
+
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(dyperTaskDbid);
+ taskService.deleteTask(laudryTaskDbid);
}
}
More information about the jbpm-commits
mailing list