JBoss Community

Re: getting process variables available in service task

created by Thomas Colditz in jBPM - View the full discussion

Hi,

 

thanks for your replies. I dont know how to change "=" to "->" since using the editor(eclipse-plugin) doesn't offer this ability. You can just type parameter and variable. And the xml(service task) looks like:

 

<serviceTask id="_4" name="Service Task" operationRef="_4_ServiceOperation" implementation="Other" >
     <ioSpecification>          <dataInput id="_4_param" name="Parameter" />
          <dataOutput id="_4_result" name="Result" />
          <inputSet>
               <dataInputRefs>_4_param</dataInputRefs>
          </inputSet>
          <outputSet>
               <dataOutputRefs>_4_result</dataOutputRefs>
          </outputSet>
     </ioSpecification>
</serviceTask>

So there is no mapping with my variable "s" visible here.    

 

@Maciej: What do you mean with how/when i read from workItem? Here the sample code:

public class SampleServiceTask implements WorkItemHandler{
     public void executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
          System.out.println(workItem.getParameter("param"));
          workItemManager.completeWorkItem(workItem.getId(), null);
    }
    public void abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
          System.out.println("Service task aborted.");
    }
}

It makes no difference if I set "param" as precess variable on start or not ("s" ofc is set). I think I'm doing something very basic wrong atm.


Greeting,

Tom

Reply to this message by going to Community

Start a new discussion in jBPM at Community