[jboss-user] [jBPM] - Handling process state

David Jeeves do-not-reply at jboss.com
Sat May 29 19:59:53 EDT 2010


David Jeeves [http://community.jboss.org/people/jeevdav] replied to the discussion

"Handling process state"

To view the discussion, visit: http://community.jboss.org/message/545385#545385

--------------------------------------------------------------
*package

com.test;
*import

junit.framework.TestCase;
*import

org.jbpm.api.Configuration;*import

org.jbpm.api.Execution;*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.ProcessInstance;*import

org.jbpm.api.RepositoryService;*import

org.jbpm.api.TaskService;


*public

*class TestJBPM *extends TestCase{

*protected *static ProcessEngine +processEngine = *null;

*protected *static RepositoryService +repositoryService;
*protected *static ExecutionService +executionService;
*protected *static ManagementService +managementService;
*protected *static TaskService +taskService;
*protected *static HistoryService +historyService;
*protected *static IdentityService +identityService;

@Override
*protected *void setUp() *throws Exception {
*super.setUp();
*if (+processEngine==*null) {
+processEngine = Configuration.+getProcessEngine+();

+repositoryService = +processEngine.get(RepositoryService.*class);
+executionService = +processEngine.getExecutionService();
+historyService = +processEngine.getHistoryService();
+managementService = +processEngine.getManagementService();
+taskService = +processEngine.getTaskService();
+identityService = +processEngine.getIdentityService();}
}

*public *void testFindOne() {

+repositoryService.createDeployment().addResourceFromClasspath(
"com/test/Proc.jpdl.xml").deploy();

ProcessInstance processInstance =
+executionService.startProcessInstanceByKey("Proc","t");System.
+out.println("process id "+processInstance.getId());
Execution executionInA = processInstance.findActiveExecutionIn(
"a");+assertNotNull+(executionInA);


//processInstance = executionService.signalExecutionById(executionInA.getId());processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);
}

*public *void testFindTwo() {
ProcessInstance processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);

}

*public *void testFindThree() {
+repositoryService.createDeployment().addResourceFromClasspath(
"com/test/Proc.jpdl.xml").deploy();
ProcessInstance processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);

}




}
+

+
**
+
**
+


+
+

+
**
++
++
++
++
++
*++
+
*+*
*
***

+**
+**
+**
+**
+**
+**
*+**
**
*
*
*
*
*
*
*
*
*
*
*
*
*

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/545385#545385]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100529/59b4e243/attachment.html 


More information about the jboss-user mailing list