[rules-users] Human Task Work Item

Todd Pagni todd.pagni at datacert.com
Tue Dec 8 12:57:29 EST 2009


Thanks for the info.  I was hoping there was a way to get the work item
via mina.  We have a client application that is communicating with the
TaskServer via mina and it would be nice if you could easily get a work
item that is associated with a  task instead of creating a separate
knowledgesession. 

 

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Vijay K Pandey
Sent: Tuesday, December 08, 2009 11:47 AM
To: Rules Users List
Subject: Re: [rules-users] Human Task Work Item

 

I guess first you have to get hold of the "workitemid" from the task
data i.e. task.getTaskData().getWorkItemId().

 

a)     Create a "Command" class which implements
GenericCommand<WorkItem>

b)    Implement the method "public WorkItem execute(Context context)"

c)     Based on the workitem id ( set this value in your command object
- constructor/setter) - get hold of the WorkItemInfo object through the
entity manager  and then its workItem ----- something like this

 

        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext)
context).getStatefulKnowledgesession();

                        if (workItemId==null) {

                                    return null;

                        }

                        EntityManager em = (EntityManager)
ksession.getEnvironment().get(EnvironmentName.ENTITY_MANAGER);

                        WorkItemInfo workItemInfo =
em.find(WorkItemInfo.class, workItemId);

                        if(workItemInfo==null){

                                    return null;

                        }else{

                              return workItemInfo.getWorkItem();

                         }

            

       d) Then call the execute method on the StatefulKnowledgeSession -
which should execute the above Command object and that returns you the
WorkItem object.

 

Vijay

 

________________________________

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Todd Pagni
Sent: Tuesday, December 08, 2009 11:16 AM
To: Rules Users List
Subject: [rules-users] Human Task Work Item

 

>From the Mina client, how do you get a work item associated with a human
task?

 

I see the Task.getTaskData(), but I don't see any easy way to get the
work item as I need the work item inparameters from the mina client
side.

 

Thanks,

Todd

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091208/ff56ee8b/attachment.html 


More information about the rules-users mailing list