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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content