Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, you need to use jbpm_log table if you need to get transitions. To get all proceeded nodes you only need jbpm_taskInstance table. We use HQL to get all user's transition in process. I had a task about "to know wich transition user choosed for given taskInstance". It's not a obvious way to do such thing, but i cannot invent something more clear. In my case it's not a very common action in app so it's realized in "fastest-to-code-it" way. Obviously 3 queries for single task instance in your case is not a good choose. The only docs i needed were: <a href="http://docs.jboss.org/jbpm/v3/javadoc/" rel="nofollow noreferrer">http://docs.jboss.org/jbpm/v3/javadoc/</a> for help on Jbpm classes and packages and discriminator's class list: jbpm-jpdl.jar/org.jbpm.logging.log/ProcessLog.hbm.xml (has desciption about jbpm objects - DB table mapping) This is the method's code. CriteriaSQL is our CriteriaParams wrapper. As i said it isn't best example but I also have saved plain sql queries for oracle DB if you needs it.</p> <pre><code> private String getTaskTransition(LFTaskInstance instance) { CriteriaSQL csql = new CriteriaSQL(new CriteriaParams()); String query = "SELECT l " + " FROM org.jbpm.taskmgmt.log.TaskCreateLog l " + " WHERE l.taskInstance = " + instance.getId(); Query c =((HibernateSession)em).getHibernateSession().createQuery(csql.getQueryString(query)); TaskCreateLog logEntry = (TaskCreateLog) c.uniqueResult(); int index = logEntry.getIndex(); Long token = logEntry.getToken().getId(); //Find bottom log index of transition which greater then log index of current instance creation String subQuery = "SELECT min(jbpmLog.index) " + " FROM org.jbpm.graph.log.TransitionLog as jbpmLog " + " where jbpmLog.token = trLog.token AND " + //reference to query below " jbpmLog.index &gt; " + index; //Find transition name from its Definition by log index of made transition query = " SELECT trans.name FROM org.jbpm.graph.def.Transition as trans " + " WHERE trans.id = " + " (SELECT min(transition.id) " + " FROM org.jbpm.graph.log.TransitionLog trLog " + " WHERE trLog.token = " + token + " and trLog.index = (" + subQuery + "))"; c =((HibernateSession)em).getHibernateSession().createQuery(csql.getQueryString(query)); return (String) c.uniqueResult(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload