[jboss-user] [jBPM] - Listener not call when complete a task

gardellajp do-not-reply at jboss.com
Thu Jan 19 14:36:07 EST 2012


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&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120119/bd249df7/attachment.html 


More information about the jboss-user mailing list