JBoss Community

Re: Process output : Is there a way to get output from a process

created by nt2005 in jBPM - View the full discussion

Hello Lakshmi,

 

I do somthing like that and for me it works good:

 

Start the process with a own handler:

GuiProcessHandler handler = new GuiProcessHandler();

Map<String, Object> params = new HashMap<String, Object>();

params.put("handler", handler);

       

// start a new process instance

ksession.startProcess(processName, params);

 

...handler.getOutputs();

 

A workitem for imageoutput:

public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {    

   BufferedImage image ...

   GuiProcessHandler handler = (GuiProcessHandler) workItem.getParameter("handler");

   handler.addImage(image);

}

 

Please note BufferedImage is not serializable, so you must convert it to a byte array.

 

Good luck!

Reply to this message by going to Community

Start a new discussion in jBPM at Community