0 Replies Latest reply on Sep 18, 2015 4:48 PM by mmartinezespichan

    Jbpm: WF Event history issues

    mmartinezespichan

      Hello,

       

      I'm develop a functionality to track all the user history and automatic steps on process, for this task I had identified two candidate tables(find below our issues/doubts):

      Audit table: NodeInstanceLog

      SELECT NN.NODENAME, NN.NODETYPE, NN.LOG_DATE, NN.TYPE FROM NodeInstanceLog NN

      WHERE NN.PROCESSINSTANCEID = 143 and NODETYPE in ('WorkItemNode','HumanTaskNode')

      order by nodeinstanceid,NN.type;

       

      Audit table: TaskEvent

      SELECT T.PROCESSINSTANCEID,T.ID, TE.ID,T.NAME,T.STATUS TASKSTATUS, T.FAULTTYPE,TE.TYPE TASKEVENT_TYPE,TE.LOGTIME,TE.USERID

      FROM TaskEvent TE,TASK T

      WHERE TE.PROCESSINSTANCEID = 143

      AND T.ID=TE.TASKID

      ORDER BY TE.ID;

       

      For this tables, I need to obtain the following data:

       

      Value required

      TaskEvent, Task

      NodeInstanceLog

      Observation

      User

      1. TE.USERID

      Missing

      Only on TaskEvent and Task table

      Activity

      1. T.NAME
      2. NN.NODENAME

      We had the values

      State

      1. T.STATUS

      Missing

      Assume complete on NodeInstance Log, if exit encounter

      Start Date

       

      LOG_DATE

      Calculated from previous task

      End date

      LOG_TIME

      LOG_DATE

       

       

      • Any can give me a suggest to complete this task?
      • Also, the documentation for TaskEvent is not online, any can tell us if this is a good table to perform the query?

       

      Also, we can’t use TaskEvent, because some time the information is incomplete. You can see below the data from these tables:

       

      Example for TaskEvent:

      Inconsistence state:

       

      PROCESSINSTANCEID

      ID

      ID1

      NAME

      TASKSTATUS

      FAULTTYPE

      TASKEVENT_TYPE

      LOGTIME

      USERID

      143

      169

      302

      Enter new request

      Completed

      ADDED

      2015-09-18-09.41.36.675000

      ProcessId

      143

      170

      304

      Manage conditions

      Reserved

      ADDED

      2015-09-18-09.43.18.080000

      ProcessId

       

      Consistence status:

      PROCESSINSTANCEID

      ID

      ID1

      NAME

      TASKSTATUS

      FAULTTYPE

      TASKEVENT_TYPE

      LOGTIME

      USERID

      142

      167

      297

      Enter new request

      Completed

      ADDED

      2015-09-18-09.40.24.975000

      ProcessId

      142

      167

      299

      Enter new request

      Completed

      STARTED

      2015-09-18-09.40.36.777000

      UserId

      142

      168

      300

      Manage conditions

      Created

      ADDED

      2015-09-18-09.40.37.988000

      ProcessId

      142

      167

      301

      Enter new request

      Completed

      COMPLETED

      2015-09-18-09.40.38.139000

      UserId

       

      NOTE: the inconsistent scenario happens because the org.jbpm.runtime.manager.impl.PerRequestRuntimeManager, local variable sometime is empty, because the WAS assign a different thread to the RuntimeManager. The scope of local variable is Thread:

       

      public class PerRequestRuntimeManager extends AbstractRuntimeManager {

             private SessionFactory factory;

             private TaskServiceFactory taskServiceFactory;

             private static ThreadLocal<RuntimeEngine> local = new ThreadLocal();

       

      • Any can comment if this is an real inconsistency or it is a normal behavior?

       

      Example for NodeInstanceLog:

      NODENAME

      NODETYPE

      LOG_DATE

      TYPE

      Enter new request

      HumanTaskNode

      2015-09-18-09.41.36.471000

      0

      Enter new request

      HumanTaskNode

      2015-09-18-09.43.18.247000

      1

      Automatic Evaluation

      WorkItemNode

      2015-09-18-09.43.17.494000

      0

      Automatic Evaluation

      WorkItemNode

      2015-09-18-09.43.18.180000

      1

      Manage conditions

      HumanTaskNode

      2015-09-18-09.43.17.826000

      0

       

      Thanks if advance,

       

      Miguel Angel