12 Replies Latest reply on May 29, 2006 8:07 AM by mohan514

    TaskAssignment works but findTaskInstances fails

    sps100

      Using 3.1, DB2 8.x

      I created an assignment handler and assigned a task to the user "guest" using Assignable.setActorId("guest") method. This creates a task instance in JBPM_TASKINSTANCE with ACTORID_ as guest. This thorws following warning:

      13:15:06,068 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
      13:15:06,088 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==

      When jContext.getTaskMgmtSession().findTaskInstances("guest") is used to find tasks assigned, it throws following exception. I tried using swimlanes but same result.
      Before I get into more debugging:
      (1) Is there a known issue?
      (2) Am I doing something wrong?
      Thank you.
      --------------------------------------------------------------------------------------

      15:49:06,850 [main] DEBUG AbstractBatcher : select processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from VTSC.JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desC
      15:49:06,860 [main] DEBUG NullableType : binding 'simple' to parameter: 1
      15:49:06,871 [main] DEBUG NullableType : returning '510' as column: ID1_4_
      15:49:06,881 [main] DEBUG NullableType : returning 'simple' as column: NAME2_4_
      15:49:06,881 [main] DEBUG NullableType : returning '1' as column: VERSION3_4_
      15:49:06,881 [main] DEBUG NullableType : returning 'false' as column: ISTERMIN4_4_
      15:49:06,881 [main] DEBUG NullableType : returning '572' as column: STARTSTATE5_4_
      15:49:07,001 [main] DEBUG AbstractBatcher : select processins0_.ID_ as ID1_20_, processins0_.VERSION_ as VERSION2_20_, processins0_.START_ as START3_20_, processins0_.END_ as END4_20_, processins0_.ISSUSPENDED_ as ISSUSPEN5_20_, processins0_.PROCESSDEFINITION_ as PROCESSD6_20_, processins0_.ROOTTOKEN_ as ROOTTOKEN7_20_, processins0_.SUPERPROCESSTOKEN_ as SUPERPRO8_20_ from VTSC.JBPM_PROCESSINSTANCE processins0_ where processins0_.PROCESSDEFINITION_=? order by processins0_.START_ desc
      15:49:07,001 [main] DEBUG NullableType : binding '510' to parameter: 1
      15:49:07,001 [main] DEBUG NullableType : returning '46' as column: ID1_20_
      15:49:07,011 [main] DEBUG NullableType : returning '1' as column: VERSION2_20_
      15:49:07,011 [main] DEBUG NullableType : returning '2006-04-05 12:59:51' as column: START3_20_
      15:49:07,011 [main] DEBUG NullableType : returning null as column: END4_20_
      15:49:07,011 [main] DEBUG NullableType : returning 'false' as column: ISSUSPEN5_20_
      15:49:07,011 [main] DEBUG NullableType : returning '510' as column: PROCESSD6_20_
      15:49:07,021 [main] DEBUG NullableType : returning '46' as column: ROOTTOKEN7_20_
      15:49:07,021 [main] DEBUG NullableType : returning null as column: SUPERPRO8_20_
      15:49:07,021 [main] DEBUG NullableType : returning '45' as column: ID1_20_
      15:49:07,021 [main] DEBUG NullableType : returning '1' as column: VERSION2_20_
      15:49:07,021 [main] DEBUG NullableType : returning '2006-04-05 12:59:51' as column: START3_20_
      15:49:07,021 [main] DEBUG NullableType : returning null as column: END4_20_
      15:49:07,021 [main] DEBUG NullableType : returning 'false' as column: ISSUSPEN5_20_
      15:49:07,021 [main] DEBUG NullableType : returning '510' as column: PROCESSD6_20_
      15:49:07,021 [main] DEBUG NullableType : returning '45' as column: ROOTTOKEN7_20_
      15:49:07,021 [main] DEBUG NullableType : returning null as column: SUPERPRO8_20_
      15:49:07,061 [main] DEBUG AbstractBatcher : select instances0_.PROCESSINSTANCE_ as PROCESSI3_1_, instances0_.ID_ as ID1_1_, instances0_.NAME_ as NAME5_1_, instances0_.ID_ as ID1_23_0_, instances0_.PROCESSINSTANCE_ as PROCESSI3_23_0_, instances0_.TASKMGMTDEFINITION_ as TASKMGMT4_23_0_, instances0_.CLASS_ as CLASS2_23_0_ from VTSC.JBPM_MODULEINSTANCE instances0_ where instances0_.PROCESSINSTANCE_=?
      15:49:07,061 [main] DEBUG NullableType : binding '46' to parameter: 1
      15:49:07,061 [main] DEBUG NullableType : returning '71' as column: ID1_23_0_
      15:49:07,061 [main] DEBUG NullableType : returning 'T' as column: CLASS2_23_0_
      15:49:07,061 [main] DEBUG NullableType : returning '46' as column: PROCESSI3_23_0_
      15:49:07,071 [main] DEBUG NullableType : returning '540' as column: TASKMGMT4_23_0_
      15:49:07,071 [main] DEBUG NullableType : returning '46' as column: PROCESSI3_1_
      15:49:07,071 [main] DEBUG NullableType : returning '71' as column: ID1_1_
      15:49:07,071 [main] DEBUG NullableType : returning 'org.jbpm.taskmgmt.exe.TaskMgmtInstance' as column: NAME5_1_
      15:49:07,071 [main] DEBUG NullableType : returning '72' as column: ID1_23_0_
      15:49:07,071 [main] DEBUG NullableType : returning 'C' as column: CLASS2_23_0_
      15:49:07,071 [main] DEBUG NullableType : returning '46' as column: PROCESSI3_23_0_
      15:49:07,071 [main] DEBUG NullableType : returning '46' as column: PROCESSI3_1_
      15:49:07,081 [main] DEBUG NullableType : returning '72' as column: ID1_1_
      15:49:07,081 [main] DEBUG NullableType : returning 'org.jbpm.context.exe.ContextInstance' as column: NAME5_1_
      15:49:07,091 [main] DEBUG AbstractBatcher : select tokenvaria0_.CONTEXTINSTANCE_ as CONTEXTI3_1_, tokenvaria0_.ID_ as ID1_1_, tokenvaria0_.TOKEN_ as TOKEN2_1_, tokenvaria0_.ID_ as ID1_24_0_, tokenvaria0_.TOKEN_ as TOKEN2_24_0_, tokenvaria0_.CONTEXTINSTANCE_ as CONTEXTI3_24_0_ from VTSC.JBPM_TOKENVARIABLEMAP tokenvaria0_ where tokenvaria0_.CONTEXTINSTANCE_=?
      15:49:07,091 [main] DEBUG NullableType : binding '72' to parameter: 1
      15:49:07,101 [main] DEBUG NullableType : returning '10' as column: ID1_24_0_
      15:49:07,101 [main] DEBUG NullableType : returning '46' as column: TOKEN2_24_0_
      15:49:07,101 [main] DEBUG NullableType : returning '72' as column: CONTEXTI3_24_0_
      15:49:07,101 [main] DEBUG NullableType : returning '72' as column: CONTEXTI3_1_
      15:49:07,101 [main] DEBUG NullableType : returning '10' as column: ID1_1_
      15:49:07,101 [main] DEBUG NullableType : returning '46' as column: TOKEN2_1_
      15:49:07,101 [main] DEBUG AbstractBatcher : select token0_.ID_ as ID1_21_0_, token0_.VERSION_ as VERSION2_21_0_, token0_.NAME_ as NAME3_21_0_, token0_.START_ as START4_21_0_, token0_.END_ as END5_21_0_, token0_.NODEENTER_ as NODEENTER6_21_0_, token0_.NEXTLOGINDEX_ as NEXTLOGI7_21_0_, token0_.ISABLETOREACTIVATEPARENT_ as ISABLETO8_21_0_, token0_.ISTERMINATIONIMPLICIT_ as ISTERMIN9_21_0_, token0_.ISSUSPENDED_ as ISSUSPE10_21_0_, token0_.NODE_ as NODE11_21_0_, token0_.PROCESSINSTANCE_ as PROCESS12_21_0_, token0_.PARENT_ as PARENT13_21_0_, token0_.SUBPROCESSINSTANCE_ as SUBPROC14_21_0_ from VTSC.JBPM_TOKEN token0_ where token0_.ID_=?
      15:49:07,101 [main] DEBUG NullableType : binding '46' to parameter: 1
      15:49:07,111 [main] DEBUG NullableType : returning '2' as column: VERSION2_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning null as column: NAME3_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning '2006-04-05 12:59:51' as column: START4_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning null as column: END5_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning '2006-04-05 13:15:06' as column: NODEENTER6_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning '7' as column: NEXTLOGI7_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning 'true' as column: ISABLETO8_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning 'false' as column: ISTERMIN9_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning 'false' as column: ISSUSPE10_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning '575' as column: NODE11_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning '46' as column: PROCESS12_21_0_
      15:49:07,111 [main] DEBUG NullableType : returning null as column: PARENT13_21_0_
      15:49:07,121 [main] DEBUG NullableType : returning null as column: SUBPROC14_21_0_
      15:49:07,141 [main] DEBUG AbstractBatcher : select variablein0_.TOKENVARIABLEMAP_ as TOKENVAR6_1_, variablein0_.ID_ as ID1_1_, variablein0_.NAME_ as NAME3_1_, variablein0_.ID_ as ID1_25_0_, variablein0_.NAME_ as NAME3_25_0_, variablein0_.CONVERTER_ as CONVERTER4_25_0_, variablein0_.TOKEN_ as TOKEN5_25_0_, variablein0_.TOKENVARIABLEMAP_ as TOKENVAR6_25_0_, variablein0_.PROCESSINSTANCE_ as PROCESSI7_25_0_, variablein0_.BYTEARRAYVALUE_ as BYTEARRA8_25_0_, variablein0_.DATEVALUE_ as DATEVALUE9_25_0_, variablein0_.DOUBLEVALUE_ as DOUBLEV10_25_0_, variablein0_.LONGIDCLASS_ as LONGIDC11_25_0_, variablein0_.LONGVALUE_ as LONGVALUE12_25_0_, variablein0_.STRINGIDCLASS_ as STRINGI13_25_0_, variablein0_.STRINGVALUE_ as STRINGV14_25_0_, variablein0_.CLASS_ as CLASS2_25_0_ from VTSC.JBPM_VARIABLEINSTANCE variablein0_ where variablein0_.TOKENVARIABLEMAP_=?
      15:49:07,141 [main] DEBUG NullableType : binding '10' to parameter: 1
      15:49:07,141 [main] DEBUG NullableType : returning '10' as column: ID1_25_0_
      15:49:07,141 [main] DEBUG NullableType : returning 'S' as column: CLASS2_25_0_
      15:49:07,151 [main] DEBUG NullableType : returning 'SRID' as column: NAME3_org.jbpm.JbpmException: couldn't get task instances list for actor 'guest'
      at org.jbpm.db.TaskMgmtSession.findTaskInstances(TaskMgmtSession.java:63)
      at com.inovant.bpm.JbpmProcessTest.testExecuteProcessInstances(JbpmProcessTest.java:104)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at junit.framework.TestCase.runTest(TestCase.java:154)25_0_
      15:49:07,161 [main] DEBUG NullableType : returning '46' as column: TOKEN5_25_0_
      15:49:07,161 [main] DEBUG NullableType : returning '10' as column: TOKENVAR6_25_0_
      15:49:07,161 [main] DEBUG NullableType : returning '46' as column: PROCESSI7_25_0_
      15:49:07,161 [main] DEBUG NullableType : returning '1' as column: STRINGV14_25_0_
      15:49:07,161 [main] DEBUG NullableType : returning '10' as column: TOKENVAR6_1_
      15:49:07,161 [main] DEBUG NullableType : returning '10' as column: ID1_1_
      15:49:07,161 [main] DEBUG NullableType : returning 'SRID' as column: NAME3_1_
      15:49:07,161 [main] INFO JbpmManager : Process Instance for variable: SRID : with value = 1: found
      Process instance found
      15:49:07,191 [main] DEBUG AbstractBatcher : select taskinstan0_.ID_ as ID1_27_, taskinstan0_.NAME_ as NAME3_27_, taskinstan0_.DESCRIPTION_ as DESCRIPT4_27_, taskinstan0_.ACTORID_ as ACTORID5_27_, taskinstan0_.CREATE_ as CREATE6_27_, taskinstan0_.START_ as START7_27_, taskinstan0_.END_ as END8_27_, taskinstan0_.DUEDATE_ as DUEDATE9_27_, taskinstan0_.PRIORITY_ as PRIORITY10_27_, taskinstan0_.ISCANCELLED_ as ISCANCE11_27_, taskinstan0_.ISSUSPENDED_ as ISSUSPE12_27_, taskinstan0_.ISOPEN_ as ISOPEN13_27_, taskinstan0_.ISSIGNALLING_ as ISSIGNA14_27_, taskinstan0_.ISBLOCKING_ as ISBLOCKING15_27_, taskinstan0_.TASK_ as TASK16_27_, taskinstan0_.TOKEN_ as TOKEN17_27_, taskinstan0_.SWIMLANINSTANCE_ as SWIMLAN18_27_, taskinstan0_.TASKMGMTINSTANCE_ as TASKMGM19_27_ from VTSC.JBPM_TASKINSTANCE taskinstan0_ where taskinstan0_.ACTORID_=? and taskinstan0_.ISOPEN_='Y'
      15:49:07,251 [main] DEBUG NullableType : binding 'guest' to parameter: 1
      15:49:07,321 [main] WARN JDBCExceptionReporter : SQL Error: -401, SQLState: 42818
      15:49:07,321 [main] ERROR JDBCExceptionReporter : [IBM][CLI Driver][DB2/NT] SQL0401N The data types of the operands for the operation "=" are not compatible. SQLSTATE=42818

      15:49:07,321 [main] ERROR TaskMgmtSession : org.hibernate.exception.SQLGrammarException: could not execute query

      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.doList(Loader.java:2148)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
      at org.hibernate.loader.Loader.list(Loader.java:2024)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
      at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
      at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1129)
      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      at org.jbpm.db.TaskMgmtSession.findTaskInstances(TaskMgmtSession.java:59)
      ... 16 more
      Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0401N The data types of the operands for the operation "=" are not compatible. SQLSTATE=42818
      at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
      at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
      at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
      at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(Unknown Source)
      at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(Unknown Source)
      at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
      at org.hibernate.loader.Loader.doQuery(Loader.java:662)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      at org.hibernate.loader.Loader.doList(Loader.java:2145)
      ... 24 more

        • 1. Re: TaskAssignment works but findTaskInstances fails
          sps100

          Found a workaround

          We have process instance (process instance id) so we can also use API:

          Collection taskCollection = processInstance.getTaskMgmtInstance().getTaskInstances();
          Then look for the given Actor Id.
          We don't have many Task Nodes so this should not cause any performance problem.

          Looks like there may be a problem in
          getTaskMgmtSession().findTaskInstances("user id") on JbpmContext.

          • 2. Re: TaskAssignment works but findTaskInstances fails
            kukeltje

            - The warnings can be ignored
            - taskinstan0_.ISOPEN_='Y' is the culprit I think. The ISOPEN column in the JBPM_TASKINSTANCE table is a numerical field. I cannot imagine that this is a generic bug in jBPM since everybody would have this problem. Could be an issue with the hibernate config for db2.

            hth,

            Ronald

            • 3. Re: TaskAssignment works but findTaskInstances fails
              sps100

              You are correct. There was a query substitution in our hibernate mapping file. This is not a jBPM problem.

              Thank you

              • 4. Re: TaskAssignment works but findTaskInstances fails
                kukeltje

                thanks for letting us know and glad we could help you

                • 5. Re: TaskAssignment works but findTaskInstances fails
                  aamonten

                   

                  "sps100" wrote:
                  Using 3.1, DB2 8.x

                  I created an assignment handler and assigned a task to the user "guest" using Assignable.setActorId("guest") method. This creates a task instance in JBPM_TASKINSTANCE with ACTORID_ as guest. This thorws following warning:

                  13:15:06,068 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
                  13:15:06,088 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==


                  "kukeltje" wrote:
                  - The warnings can be ignored

                  Even if the warning could be ignored it would be nice to know what it's, any have an idea?

                  Regards Alejandro

                  • 6. Re: TaskAssignment works but findTaskInstances fails
                    saviola

                    Hi aamonten!
                    Here you can read more about the warnign:
                    http://opensource.atlassian.com/projects/hibernate/browse/HHH-1367
                    http://forums.hibernate.org/viewtopic.php?t=941507&view=next&sid=bcc76fb6a152498bed5a05c6f0cb1d4f
                    I had read a documentation (I think it was Hibernate's) with a very simple explanation of the issue but I can't find it at the moment. It was something that Hibernate extends the objects while quering the database. and this breaks the == operation.
                    Unfortunatelly I am not able to explain that in detail :(

                    Regards,
                    Saviola

                    • 7. Re: TaskAssignment works but findTaskInstances fails
                      kukeltje

                      Saviola,

                      Thanks, someone who knows how to use searchfunctionality. But..... The jbpm forum search functionality would have provided this link:

                      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73123

                      Ronald

                      • 8. Re: TaskAssignment works but findTaskInstances fails
                        saviola

                        Hi, kukeltje!
                        This exactly was the document that I was talking about.
                        The jBPM forum was the last place where I would have searched for since the answer is quite technical oriented and concerning hibernate.
                        Anyway, thank you for the reminder and the advice!

                        Saviola

                        • 9. Re: TaskAssignment works but findTaskInstances fails
                          kukeltje

                          No problem, we're here to help eachother right ;-)

                          • 10. Re: TaskAssignment works but findTaskInstances fails
                            mohan514

                            hi,
                            iam also getting the same problem while iam trying to create the new instance of the process then iam getitng this problem and when i tried to instantiate it is showing the task list for the user but when ever i restart the server then iam not able to find the task list for the user.
                            i think the data i have given is not persistign into the data base.

                            Below is the code that i used to instantiate the code.

                            jbpmContext = jbpmConfiguration.createJbpmContext();
                            GraphSession graphSession = jbpmContext.getGraphSession();
                            ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
                            ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinition.getName());
                            processInstance.signal();
                            jbpmContext.save(processInstance);
                            jbpmContext.close();



                            and iam getting the problem while persistign the task instance into the data base any one come accross thsi type of problem if so please guide me to resolve the problem.
                            Regards,
                            mohan chokkakula.

                            • 11. Re: TaskAssignment works but findTaskInstances fails
                              kukeltje

                              what do you mean with 'the same problem'? The subject or the stacktrace? If it is the former, try looking at your hibernate config. If it is the latter, you have to provide more info, since the code looks ok. Do you actually use a hibernate config?

                              • 12. Re: TaskAssignment works but findTaskInstances fails
                                mohan514

                                thanX for ur early reply,
                                if my configuration file is wrong then iam not able to get the task list and process definitions for the user after iam gettign the process definitions using the definition ID iam trying to instantiate the process definition then i am coming accross the problem of persistence. before restarting the server(JVM) iam able to see the task list of the user.
                                after restarting the server ima not able to see the task list.
                                if u want more details while helping me ill provide this makes one week for me, i tried to directly set the auto commit to true.then it is persisteing into the data bas. but the approach that iam using seems to me the not correct approach to instantiate the process.
                                please help me how to instantiate the process.
                                "any help regarding this will be appriciated"
                                Regards,
                                Mohan chokkakula.