-
1. Re: Jbpm Executors for handling long running tasks
swiderski.maciej Jun 23, 2014 1:19 AM (in response to lauradp)1 of 1 people found this helpfulit certainly is suitable for long running asynchronous tasks, see this article for more details.
HTH
-
2. Re: Jbpm Executors for handling long running tasks
lauradp Jun 23, 2014 3:22 AM (in response to swiderski.maciej)Thanks for your answer Maciej.
So I can't use it for handling task B in a process like A -> B -> C if task C needs results of task B to be executed, isn't it?
Laura
-
3. Re: Jbpm Executors for handling long running tasks
swiderski.maciej Jun 23, 2014 4:20 AM (in response to lauradp)of course you can, it will not signal the process to move forward unless task has been completed by the executor. It's just it will not keep the process instance and transaction locked while the task is being executed. It will get hold of process instance when task is completed and signal it to move to the next task.
HTH
-
4. Re: Jbpm Executors for handling long running tasks
lauradp Jun 23, 2014 12:21 PM (in response to swiderski.maciej)Thanks, Maciej.
Now I have to code a WorkitemHandler that for my command. Cann you provide any example (or explain how to register commands)?
-
5. Re: Jbpm Executors for handling long running tasks
swiderski.maciej Jun 24, 2014 1:35 AM (in response to lauradp)an example is in that article, commands are configured on as data input of an async task - dedicated work item handler. Take a look at async-examples of jbpm-playground repo where you find couple of samples on how they can be used.
HTH
-
6. Re: Jbpm Executors for handling long running tasks
lauradp Jun 24, 2014 8:55 AM (in response to swiderski.maciej)Hi,
I tryed to use async task with a this Command:
public class CommandLineCommand implements Command {
private static Logger trace = Logger.getLogger(CommandLineCommand.class);
@Override
public ExecutionResults execute(CommandContext arg0) throws Exception {
trace.info("I'm doing stuffs");
ExecutionResults results = new ExecutionResults();
results.setData("RunTaskExitValue", 0);
return results;
}
}
but RunTaskExitValue is not set.
UPDATE. It looks like a class clast problem: java.lang.String cannot be cast to java.lang.Integer.
this is async wid:
[
"name" : "async",
"parameters" : [
"CommandClass" : new StringDataType()
],
"results" : [
"RunTaskExitValue" : new IntegerDataType()
],
"displayName" : "async",
"icon" : "defaultservicenodeicon.png"
]
Laura