-
1. Re: How to call Java class from Script Task in JBPM
frenky1983 Apr 24, 2015 8:39 AM (in response to kalesha786)You must add the dependency from the artifact that contains the your class (e.g. TestService()) in project authoriting -> artifact repository (or add that dependency as a module in jboss)
than you can use the class in you script task as in a normal java program.
you must instantiate only your class and call your method
it.example.TestService service = new it.example.TestService(); \\all the package path is required for me, i don't know if is necessary
service.executeMethod();
.......
-
2. Re: How to call Java class from Script Task in JBPM
kalesha786 Apr 24, 2015 10:28 AM (in response to frenky1983)Thank You.. It worked for me..
One more query..
I started the process from a java class.
ProcessInstance processInstance = ksession.startProcess(processName,params); After this, it started executing my script task nodes.. Now, i want to send result from script task node to java class where i called startprocess()..
Can you tell me how to do this?
-
-
3. Re: How to call Java class from Script Task in JBPM
frenky1983 Apr 24, 2015 10:35 AM (in response to kalesha786)Someone will correct me if i wrong,
i think you can set a process variable in your script task, something like this
kcontext.getKnowledgeRuntime().setVariable("variable", "value");
and then recover that variable in your java class in similary manner
i hope this is helpful for you