How to retrive Task object in custom implementation of TaskEventListener ?

Solution Unverified - Updated -

Issue

  • The requirement is to access the process variables inside the custom implementation of TaskEventListener upon TaskClaimedEvent is generated. By default the TaskClaimedEvent gives us taskId and userId it doesn't gives the Task object associated with it. Is there a way to retrieve the Task object from within the implementation of TaskEventListener?
  • Additionally, while trying to fetch the associated Task object for the taskId in the DB from within the TaskEventListener implementation it throws NoEntityFound exception. So is it like jBPM engine has not yet committed the Task record in the Task table while the TaskClaimedEvent has been generated?
javax.persistence.NoResultException: No entity found for query

Environment

  • JBoss Enterprise Business Rules Management System Platform (BRMS)
    • 5.3.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In