2 Replies Latest reply on Feb 21, 2013 1:13 AM by ashu.itbhu

    How to get results form Work Item handler

    ashu.itbhu

      I want to impl db handler and my dbhandler.wid file is like this...

      ------------------------------------------------------------

      import org.drools.process.core.datatype.impl.type.StringDataType;

      import org.drools.process.core.datatype.impl.type.ObjectDataType;

      [

      // the Notification work item

      [

      "name" : "Database",

      "parameters" : [

      "GET_OR_UPDATE" : new StringDataType(),

      "SQL" : new StringDataType(),

      "ReturnMode" : new StringDataType(),

      ],

      "results" : [

      "DB_OPS" : new ObjectDataType(),

      ],

      "displayName" : "Database",

      "icon" : "icons/dbops.png"

      ]

      ]

       

      ----------------------------------------

      In my WorkItemHandler impl class i have code like this

       

      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {

      Map<String, Object> outputMap = new HashMap<String, Object>();
      outputMap.put("results", emps);
      manager.completeWorkItem(workItem.getId(), outputMap);

       

      and in porcess i have

      WI impl like

      Result Mapping----->DB_OPS ---> map(java.util.HashMap)

       

      but his is returning nothing from handler calss.... please let me know what wrong i am doing here.

       

      Thanks....Ashutosh

        • 1. Re: How to get results form Work Item handler
          ashu.itbhu

          Hi Guys,

           

          I got this issue resolved with help of one of community member... reolution in like we have to add

           

          Map<String, Object> outputMap = new HashMap<String, Object>();
          outputMap.put("DB_OPS", emps);
          manager.completeWorkItem(workItem.getId(), outputMap);

           

          In our WI handler class......

          • 2. Re: How to get results form Work Item handler
            ashu.itbhu

            The above approach is working fine when i am running the process from IED(read as eclipse) but when i put same code in Guvnor and do a deployment the process is not able to execute the step.

             

            Can anyone give some pointer what could be the reason of this. In my WI handler i am also using an external jar and i am using this jar also as pert of deployment package