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);
map.put("x",channel.getName());
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
System.out.println(processInstance.getEventTypes());
System.out.println(processInstance.getId());
System.out.println(processInstance.getProcessId());
ksession.fireAllRules();
// fire all rules if there is a rule flow
}
AND i did this method in workItemHandler
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
System.out.println(workItem.getProcessInstanceId());
System.out.println(workItem.getState());
System.out.println(workItem.getId());
System.out.println(workItem.getName());
System.out.println("========= Executing registration
=============" + workItem);
setRegistration();
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
[
https://community.jboss.org/message/772279#772279]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]