Instead of "Approve" it should be "Human Task" in the below code
wm.registerWorkItemHandler("Approve", approveTask);
________________________________
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Todd Pagni
Sent: Friday, November 20, 2009 3:11 PM
To: Rules Users List
Subject: Re: [rules-users] Human Task Question on Mina client / server
Starting the server first does not fix the issue. I still see the following error in the
log also: [STDERR] Could not find work item handler for Human Task
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Salaboy
Sent: Friday, November 20, 2009 2:03 PM
To: Rules Users List
Cc: <rules-users(a)lists.jboss.org>
Subject: Re: [rules-users] Human Task Question on Mina client / server
You need to start the Mina server before starting the process
- Ing. Mauricio Salatino -
On Nov 20, 2009, at 6:45 PM, "Todd Pagni"
<todd.pagni@datacert.com<mailto:todd.pagni@datacert.com>> wrote:
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
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users