Hi,
Simple process definition( with a taskform ) when run using jbPM APIS is not getting
stopped at task form node but it completes its execution.
I am trying to test the process using jBPM APIs not console.
Code attached below for reference.
Process should wait for user inputs through a form which is attached to "review"
task. I also tried removing line " taskService.completeTask(task.getId());"
from jbpm test case but no sucsess.
Can anybody guide me in this regard ?
Process definition :
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="FormDynamic"
xmlns="http://jbpm.org/4.0/jpdl">
|
| <start g="20,20,48,48">
| <transition to="review"/>
| </start>
|
| <task assignee="peter"
form="org/jbpm/examples/formdynamic/givedetails.ftl" g="96,16,127,52"
name="review">
| <transition to="wait"/>
| </task>
| <state g="268,24,96,31" name="wait"/>
|
| </process>
|
jbpm test case :
| package org.jbpm.examples.formdynamic;
|
| import java.util.HashMap;
| import java.util.List;
| import java.util.Map;
|
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.task.Task;
| import org.jbpm.test.JbpmTestCase;
|
| public class FormDynamicTest extends JbpmTestCase {
| String deploymentId;
|
| protected void setUp() throws Exception {
| super.setUp();
|
| deploymentId = repositoryService.createDeployment()
|
.addResourceFromClasspath("org/jbpm/examples/formdynamic/FormDynamic.jpdl.xml")
| .deploy();
| }
|
| protected void tearDown() throws Exception {
| repositoryService.deleteDeploymentCascade(deploymentId);
|
| super.tearDown();
| }
|
| public void testTaskAssignee() {
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("order", "johndoe");
| ProcessInstance processInstance =
executionService.startProcessInstanceByKey("FormDynamic", variables);
| String pid = processInstance.getId();
| //ProcessInstance processInstance =
executionService.startProcessInstanceByKey("FormDynamic");
| List<Task> taskList=taskService.findPersonalTasks("peter");
| Task task=taskList.get(0);
|
| taskService.completeTask(task.getId());
|
| System.out.println("List is"+taskList);
|
| // verify that process moved to the next state
| processInstance = executionService.findProcessInstanceById(pid);
| assertTrue(processInstance.isActive("wait"));
|
|
|
| }
| }
|
jbpm test case result :
| 14:31:37,940 FIN | [BaseJbpmTestCase] === starting testTaskAssignee
=============================
| 14:31:38,231 INF | [Environment] Hibernate 3.3.1.GA
| 14:31:38,231 INF | [Environment] hibernate.properties not found
| 14:31:38,231 INF | [Environment] Bytecode provider name : javassist
| 14:31:38,231 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
| 14:31:38,271 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
| 14:31:38,271 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
| 14:31:38,321 INF | [Configuration] Reading mappings from resource :
jbpm.repository.hbm.xml
| 14:31:38,441 INF | [Configuration] Reading mappings from resource :
jbpm.execution.hbm.xml
| 14:31:38,541 INF | [Configuration] Reading mappings from resource :
jbpm.history.hbm.xml
| 14:31:38,591 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
| 14:31:38,621 INF | [Configuration] Reading mappings from resource :
jbpm.identity.hbm.xml
| 14:31:38,631 INF | [Configuration] Configured SessionFactory: null
| 14:31:38,651 INF | [DriverManagerConnectionProvider] Using Hibernate built-in
connection pool (not for production use!)
| 14:31:38,651 INF | [DriverManagerConnectionProvider] Hibernate connection pool size:
20
| 14:31:38,651 INF | [DriverManagerConnectionProvider] autocommit mode: false
| 14:31:38,651 INF | [DriverManagerConnectionProvider] using driver:
org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.
| 14:31:38,651 INF | [DriverManagerConnectionProvider] connection properties: {user=sa,
password=****}
| 14:31:38,791 INF | [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
| 14:31:38,791 INF | [TransactionFactoryFactory] Using default transaction strategy
(direct JDBC transactions)
| 14:31:38,801 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup
configured (in JTA environment, use of read-write or transactional second-level cache is
not recommended)
| 14:31:38,801 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
| 14:31:38,831 INF | [SessionFactoryImpl] building session factory
| 14:31:39,322 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI
name configured
| 14:31:39,332 INF | [SchemaExport] Running hbm2ddl schema export
| 14:31:39,332 INF | [SchemaExport] exporting generated schema to database
| 14:31:39,362 INF | [SchemaExport] schema export complete
| 14:31:39,793 FIN | [ProcessDefinitionImpl] creating new execution for process
'FormDynamic'
| 14:31:39,793 FIN | [DefaultIdGenerator] generated execution id FormDynamic.1
| 14:31:39,813 FIN | [ScopeInstanceImpl] create variable 'order' in
'execution[FormDynamic.1]' with value 'johndoe'
| 14:31:39,813 FIN | [ExecuteActivity] executing activity(17872448)
| 14:31:39,813 FIN | [ExecuteActivity] executing activity(review)
| 14:31:39,843 FIN | [TaskQueryImpl] select task from
org.jbpm.pvm.internal.task.TaskImpl as task where task.assignee = :assignee order by
task.priority desc
| 14:31:39,853 FIN | [TaskQueryImpl] setting parameter assignee: peter
| 14:31:39,863 FIN | [Signal] signalling activity(review), signalName=completed
| 14:31:39,863 FIN | [ExecuteActivity] executing activity(wait)
| List is[Task(review)]
| 14:31:39,903 FIN | [DbSessionImpl] deleting history process instance FormDynamic.1
| 14:31:39,923 FIN | [DbSessionImpl] deleting process instance FormDynamic.1
| 14:31:39,923 FIN | [DeleteDeploymentCmd] deleting deployment 1
| 14:31:39,953 FIN | [BaseJbpmTestCase] === ending testTaskAssignee
=============================
|
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258605#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...