Human Task Question on Mina client / server
by Todd Pagni
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
16 years, 5 months
Delivery failed
by Mail Delivery Subsystem
The original message was received at Fri, 20 Nov 2009 14:10:52 -0700 from 121.44.154.244
----- The following addresses had permanent fatal errors -----
rules-users(a)lists.jboss.org
16 years, 5 months
How to execute a Process API result?
by Scott Stevenson
I'm trying to execute the result of the Process API and running into
problems most likely stemming from my ignorance. I'm creating a new
process following the sample code from section 3.1.3.2 of the User
Guide. My sample process consists of:
1. StartNode
2. ActionNode that prints Hello World
3. EndNode
What I don't understand is how to get my new process into a
KnowledgeBase and KnowledgeSession for execution. I've tried the
following (Drools 4 method, I believe) as well:
AbstractRuleBase ruleBase = (AbstractRuleBase)
RuleBaseFactory.newRuleBase();
ruleBase.addProcess(createProcess());
InternalWorkingMemory workingMemory = new ReteooWorkingMemory(1,
ruleBase);
workingMemory.startProcess("org.drools.sample.workflow.dynamic");
The result of the previous code is a RuntimeException (unable to execute
Action). Inner exception is null pointer from inside the
ActionNodeInstance class. Where am going wrong in implementing the
Process API?
Thank you,
Scott Stevenson
16 years, 5 months
Drools Flow 5.1.0.M1 - Human Task - How to get the WorkItem change state after restart of MinaTaskServer
by Vijay K Pandey
Hi,
I have the following simple process having the WSHT 'HumanTask' (Drools Flow 5.1.0.M1)
Start Node--> Human Task --> End Node
Under the following scenario:
a) MinaTaskServer service is started
b) Drools Flow Process is started - as it reaches the Human Task ( having 'Wait for completion' as true) - following 4 commands are executed on the mina service
i. AddTaskRequest ---> This basically creates the task in the WSHT task tables
ii. RegisterForEventRequest --> This is called 3 times to register for following task events (TaskCompletedEvent, TaskFailedEvent, TaskSkippedEvent)
c) I guess the above 3 events (b ii) are registered for a callback to the Drools process so that the 'work item' (related to Human Task) state can be properly changed when the above 3 task event occurs - and the drools process can move forward.
Now my question is what if the Mina service has to be stopped in between (task has been created but not yet reached the completed status) - then we lose all the registered events (as these are not persistent events) - now when we restart the Mina service we query the task - and let's say we changed the state through "Reserved--> InProgress-->Completed". Now since the registered events are lost, how does the work item will be marked as "completed" (as the associated WSHT task has completed) so that the drools process can move forward - basically end in this case?
Any insight will be highly appreciated.
Thanks
Vijay
16 years, 5 months
Starting New Procss instance from outside of the GWT console
by ramram8
Hi all
I have the following question and I was wondering if someone can help me?
can we initiate a new process instance in the GWT console without using the
start button?
can we start this process from a call from outside of the application by
using a specific API and passing to it parameters?
I have the following process : START -> USER TASK -> MAIL -> END
i need to start this process from outside the application so that the used
when logging into the gwt console can see that he have a task to validate?
--
View this message in context: http://old.nabble.com/Starting-New-Procss-instance-from-outside-of-the-GW...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 5 months
Using DateFormat and getting today's date in drools5.0
by ABRA2
I need to compare date from java bean to system date for a rule. I referred
to previous posts, drools expert documentation and tried to come up with a
rule which is not yet working. Please help me for the same.
1. Which package should i import to use DateFactory? It is not in
org.drools.base.evaluators.DateFactory anymore i guess. Is there a better
way to get CurrentSystemDate other than using DateFactory?
2. In my JavaBean the date has format dd/MM/YYYY. So where do i set this
format to drools.dateformat? In my .drl file or in the java pgm where i load
the .drl file and do insertion of fact objects and fire the rules.
rule SetTktIssueDate
when
DateFactory($sysdate : today )
$br:BillingRecord(tktIssueDate==null || tktIssueDate > sysdate)
then
modify($br){setTktIssueDate(sysdate);}
thanks
ABRA2
--
View this message in context: http://old.nabble.com/Using-DateFormat-and-getting-today%27s-date-in-droo...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 5 months
test scenario in Guvnor
by Qian, Tony
All,
I followed an example and created test scenario in Guvnor. However, I always got 'no rule was fired ' even then I specified rule(s) in the test scenario. Am I missing something?
Btw, how to set java as default dialect in rules?
Appreciate your help.
Tony
<HR>
<font size="1" face="Arial"><B>CONFIDENTIALITY NOTICE: </B>The information in this electronic transmission and
any documents accompanying it may contain confidential and privileged
information intended for use by the individual or entity that is the intended
recipient. If you have received this message in error or due to an unauthorized
transmission or interception, please delete all copies from your system without
disclosing, copying, or transmitting this message and notify us by telephone
877TELLUS9 or by electronic mail <a href = "servicecomments(a)progressive-medical.com">servicecomments(a)progressive-medical.com</a>.</font>
16 years, 5 months
How do I resume a paused process?
by Scott Stevenson
I have a process that pauses after a few nodes are executed because it
reaches a Human Task node. I retrieve the persisted session with the
following code:
JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null,
getEnvironment());
Once I have this session object I'm not sure how to resume the paused
process? I want to signal the Human Task work item as complete and have
the process resume at that point. I've tried this code:
WorkItemManager wm = session.getWorkItemManager();
wm.registerWorkItemHandler("Approve", new WSHumanTaskHandler());
WorkflowProcessInstance pi = (WorkflowProcessInstance)
session.startProcess("processName");
Object[] nodes = pi.getNodeInstances().toArray();
WorkItem wi = ((HumanTaskNodeInstance) nodes[0]).getWorkItem();
wm.completeWorkItem(wi.getId(), null);
session.dispose();
The result of this is that the workflow restarts from the first node and
completes to the end. I expected that the workflow would start at the
persisted location. What am I missing here?
Scott Stevenson
16 years, 5 months
from clause in decision table.
by Swindells, Thomas
I've got a fact which contains a collection (a set of strings to be
precise). I want to write a rule which fires if there are any invalid
values (where the valid values are defined as a list).
What I'm trying to do is express this within a decision table.
Expressed as a drl rule the following works:
rule "ValidateList"
when
Fact(col : collection != null)
String(this not in ($param)) from col
Then
#generate error
End
Where $param = '"1", "3", "valid"'
The decision tables seem to assume that the fact type is the last
element in the line and then appends "( conditions... )" this means
there is no way to then insert a "from ..." after it.
Does anybody know either a different way to structure the rule so that I
don't need a from or a way to get the decision table to use it?
(unfortunately adding the collection directly as a fact isn't an
option).
Thanks,
Thomas
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
16 years, 5 months