gardellajp [
https://community.jboss.org/people/gardellajp] created the discussion
"Listener not call when complete a task"
To view the discussion, visit:
https://community.jboss.org/message/647691#647691
--------------------------------------------------------------
Hi,
I have a problem related to loggers attached to a loaded session, they are not called when
I complete a task. There are the steps:
1) Start a process:
<<<< CODE >>>>
//Create the session
StatefulKnowledgeSession session =
JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, envoriment);
CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task",handler);
//add logger
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
//start a new process
session.startProcess("myprocess");
//close resources
logger.close();
session.dispose();
<<<< END CODE >>>>
At this point, console logger works and in console I see what are happening.
2) End some Task
Later, in the app, I choose a task and I want complete it.
<< CODE>>>
TaskClient client = obtainATaskClient();
client.getTask(taskId,handler);
Task task = handler.getTask();
//obtain the session
int sessionId = task.getTaskData().getProcessSessionId();
StatefulKnowledgeSession session =
JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId,knowledgeBase, null,
envoriment);
CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task",handler);
//add logger
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
//complete the task
client.complete(taskId, userId, outputData, responseHandler);
isDone = responseHandler.waitTillDone(time);
logger.close();
session.dispose();
<<< END CODE >>>>
The problem is that in the step 2, the logger never call. How can I make the step 2 works?
I see in console that the handler is call becouse I see the generated sql.
Thanks,
Juan
|
|
|
|
|
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/647691#647691]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]