[jboss-user] [jBPM] - How to get variable from WorkItemHandler class ??

rickylkl do-not-reply at jboss.com
Thu Oct 25 06:18:22 EDT 2012

rickylkl [https://community.jboss.org/people/rickylkl] created the discussion

"How to get variable from  WorkItemHandler class  ??"

To view the discussion, visit: https://community.jboss.org/message/772279#772279

Hi forum,

Anyone who can help or point me how can i *GET THE VARIABLE THAT I INSERT IN SESSION* or *STARTPROCESS(processId, VARIABLE) ?*

I got c controller with this method :

private void testDrlJbpm(Channel channel){
                    Map<String,Object> map = new HashMap<String,Object>();
                    map.put("channel", channel);
                    ksession.insert(channel);                                                  //          if there is a rule flow in workflow, need to insert obj to run rule
                    ksession.getWorkItemManager().registerWorkItemHandler("ShowRegPage", new RegistrationHandler());
                    ksession.getWorkItemManager().registerWorkItemHandler("ShowSubPage", new SubscribeHandler());
                    ksession.getWorkItemManager().registerWorkItemHandler("ShowPrintPage", new PrintPageHandler());
                    ProcessInstance processInstance = (ProcessInstance) ksession.startProcess("testflow-web", map);          //          passing map inside the process, and use kcontext.getvariable() to get obj on if else case
                    ksession.fireAllRules();                                                            // fire all rules if there is a rule flow

AND i did this method in workItemHandler

          public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
                    System.out.println("========= Executing registration =============" + workItem);
                    Map<String,Object> resultMap = new HashMap<String,Object>();
                    resultMap.put("reg", registration);
                    manager.completeWorkItem(workItem.getId(), resultMap);

At last, 
i have attache the jpg of flow.

I always get nothing ...

I would like to get the varaible and do variable passing between the workItemHandler and from rules, is there any way i can follow ?? Please Thanks

Thanks a lot to all.
Please Help  :(  !!

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121025/caa3e5fb/attachment-0001.html 

More information about the jboss-user mailing list