I am creating a human task in a flow, but I am unable to get
the human task in the Mina client. Should items that enter a humanTaskNode
go into the task table in addition to the workItemInfo table? Do I need
to do anything to get the work item set as a potential owner for Administrator
so it is returned to the Mina client?
I running drools 5.0.1 in JBoss:
1.
Create the human task node in the flow:
addActionStep(factory, 3).joinNode(4).type(Join.TYPE_XOR).done().humanTaskNode(5)
.name("Approve")
.actorId("Administrator")
.taskName("Approve")
.comment("hi")
.content("random
content")
2.
Start the flow process (after this step I a row in the
workItemInfo table):
StatefulKnowledgeSession
ksession = km.getSession(kb);
WSHumanTaskHandler
approveTask = new WSHumanTaskHandler();
/* Setup
workitemmanager here? */
org.drools.runtime.process.WorkItemManager
wm = ksession.getWorkItemManager();
wm.registerWorkItemHandler("Approve", approveTask);
ksession.setGlobal("entity", e);
ksession.startProcess(DuckFlowBuilder.PROCESS_NAME);
return ksession;
See the following in the log after this step:
14:37:15,349
INFO [STDOUT] Hibernate: insert into SessionInfo (dirty, lastModificationDate,
rulesByteArray, startDate) values (?, ?, ?, ?)
14:37:15,364
INFO [STDOUT] Hibernate: insert into ProcessInstanceInfo
(lastModificationDate, lastReadDate, processId, processInstanceByteArray,
startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)
14:37:15,364
INFO [STDOUT] Entity name: Mallardes, Step: 3
14:37:15,364
INFO [STDOUT] Hibernate: insert into WorkItemInfo (creationDate, name,
processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)
14:37:15,364
ERROR [STDERR] Could not find work item handler for Human Task
14:37:15,364
INFO [STDOUT] Hibernate: update ProcessInstanceInfo set
lastModificationDate=?, lastReadDate=?, processId=?,
processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where
processInstanceId=? and OPTLOCK=?
14:37:15,364
INFO [STDOUT] Hibernate: update WorkItemInfo set creationDate=?, name=?,
processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=?
and OPTLOCK=?
14:37:15,364 INFO [STDOUT] Hibernate: update SessionInfo set
dirty=?, lastModificationDate=?, rulesByteArray=?, startDate=? where id=?
3.
Start the mina server (don’t see anything in the
task table)
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.drools.task");
taskService = new
TaskService(emf,SystemEventListenerFactory.getSystemEventListener())
server = new MinaTaskServer(
taskService );
Thread thread = new Thread( server );
thread.start();
Thread.sleep( 500 );
System.out.println("Server
started ...");
4.
Run the mina client (no results returned)
BlockingTaskSummaryResponseHandler
summaryHandler =
new
BlockingTaskSummaryResponseHandler()
client.getTasksAssignedAsPotentialOwner("Administrator",
"en-UK",summaryHandler);
List<TaskSummary>
tasks = summaryHandler.getResults();
Thanks,
Todd