JBoss Community

Re: Example of simple process of executing a service task in JBPM Console.

created by Sumeru Saha in jBPM - View the full discussion

Hi David,

 

Was your problem resolved? I'm doing things similar to what you were doing ... i wanted to create a Domain Specific service task called "CallaJava" for that i wrote the below workietm definition (WID)

 

[

  "name" : "CallJava",

  "parameters" : [

    "Interface" : new StringDataType(),

    "Operation" : new StringDataType(),

    "ParameterType" : new StringDataType(),

    "Parameter" : new ObjectDataType("com.sample.service.Student")

  ],

  "results" : [

    "Result" : new ObjectDataType("java.util.Map")

  ],

  "displayName" : "CallJava",

  "icon" : "http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/java-icon/binary" ,

  "defaultHandler" : "com.sample.service.ExtendedServiceTaskHandler"

  ]

 

I've put the jar containing my custom WorkItemHandler, a class called "com.sample.service.ExtendedServiceTaskHandler" witin jbpm-gwt-console-server.war/WEB-INF/lib

 

I've added an entry in the jbpm-gwt-console-server.war/WEB-INF/classes/META-INF/CustomWorkItemHandlers.conf (like below)

 

[

  "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),

  "CallJava": new com.sample.service.ExtendedServiceTaskHandler(ksession),

]

 

Now i can get this handler invoked with parameters that i mentioned in the WID, i can have any java code invoked from within the handler, BUT my problem is that i can't pass any variables from the process flow (defined in the BPMN process in designer) into this handler - i can only pass literal values (of primitive types like String, int etc.). Have you been able to do that?

 

 

Thanks

Sumeru

---

Reply to this message by going to Community

Start a new discussion in jBPM at Community