10 Replies Latest reply on Jun 9, 2014 8:33 AM by mateuszadamiak

    Business rule task creating issue through JBPM6

    lakshjee

      Hi Maciej Swiderski,

      I have created a business rule task following your tutorial blog;

      http://mswiderski.blogspot.com/2013/11/jbpm-6-first-steps.html

       

      But at when i creating the task i get the following error message. Please assist me.  your prompt response is highly appreciated.

      rule.jpg

       

      Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator:

              at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluat

      e(ReturnValueConstraintEvaluator.java:131) [jbpm-flow-6.0.1.Final.jar:6.0.1.Fina

      l]

              at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitIn

      1. stance.java:86) [jbpm-flow-6.0.1.Final.jar:6.0.1.Final]

              ... 123 more

      Caused by: java.lang.NullPointerException

              at org.jbpm.Process_org$u46$jbpm$u46$rule799893165.returnValueEvaluator1

      (Process_org$u46$jbpm$u46$rule799893165.java:15)

              at org.jbpm.Process_org$u46$jbpm$u46$rule799893165ReturnValueEvaluator1I

      1. nvoker.evaluate(Process_org$u46$jbpm$u46$rule799893165ReturnValueEvaluator1Invok
      2. er.java:15)

              at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluat

      e(ReturnValueConstraintEvaluator.java:129) [jbpm-flow-6.0.1.Final.jar:6.0.1.Fina

      l]

              ... 124 more

        • 1. Re: Business rule task creating issue through JBPM6
          salaboy21

          There seems to be an issue with a split (gateway node) in your process, can you share the expressions that you use to decide between two (or more branches)?

           

          Regards

          • 2. Re: Business rule task creating issue through JBPM6
            lakshjee

            Hi,

            This is what i used for the split node.

             

            return KieFunctions.isTrue(Person.getAdult())==true;

            and

            return KieFunctions.isTrue(Person.getAdult())==false;

             

            and adult is a boolean data type that i use.

             

            thank you.

            • 3. Re: Business rule task creating issue through JBPM6
              swiderski.maciej

              the NPE is most likely caused by Person process variable is not set, make sure that the variable is properly set before it is used on gateway conditions.

               

              HTH

              1 of 1 people found this helpful
              • 4. Re: Business rule task creating issue through JBPM6
                lakshjee

                I have set the process variable and it built successfully.  but the error occurred when i functioning the task.

                variable.jpg

                Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator:

                        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluat

                e(ReturnValueConstraintEvaluator.java:131) [jbpm-flow-6.0.1.Final.jar:6.0.1.Fina

                l]

                        at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitIn

                1. stance.java:86) [jbpm-flow-6.0.1.Final.jar:6.0.1.Final]

                        ... 127 more

                Caused by: java.lang.NullPointerException

                        at org.jbpm.Process_org$u46$jbpm$u46$rule799893165.returnValueEvaluator1

                (Process_org$u46$jbpm$u46$rule799893165.java:15)

                        at org.jbpm.Process_org$u46$jbpm$u46$rule799893165ReturnValueEvaluator1I

                1. nvoker.evaluate(Process_org$u46$jbpm$u46$rule799893165ReturnValueEvaluator1Invok
                2. er.java:15)

                        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluat

                e(ReturnValueConstraintEvaluator.java:129) [jbpm-flow-6.0.1.Final.jar:6.0.1.Fina

                l]

                        ... 128 more

                • 5. Re: Business rule task creating issue through JBPM6
                  lakshjee

                  Thanks all for your guidance..I could be able to run the business rule task. I have done a mistake on Data input and the Output set on the Rule Task.

                  Now it is working fine.

                  • 6. Re: Business rule task creating issue through JBPM6
                    swiderski.maciej

                    please mark your question as answered so others can benefit from it.

                    • 7. Re: Business rule task creating issue through JBPM6
                      lakshjee

                      Hi Maciej Swiderski,

                      I have a four scenario for one rule.  Those are as follows,

                      import org.jbpm.capex.Capex

                      (1) rule "set as cao_approval" ruleflow-group "capexrule"

                      no-loop

                      when $p: Capex(budget>=10000) && Capex(budget<=50000)

                      then modify($p) { setCao_approval(true); } end

                      (2) rule "set as coo_approval" ruleflow-group "capexrule"

                      no-loop

                      when $p: Capex(budget>=50001) && Capex(budget<=100000)

                      then modify($p) { setCoo_approval(true); } end

                      (3) rule "set as gmd_approval" ruleflow-group "capexrule"

                      no-loop

                      when $p: Capex(budget>=100001) && Capex(budget<=1000000)

                      then modify($p) { setGmd_approval(true); } end

                      (4) rule "" ruleflow-group "capexrule"

                      no-loop when $p: Capex(budget>=1000001) then end

                       

                      and the process diagram also attached herewith.  But i have no idea how to include fourth rule to the flow. at the gateway split node how to define the condition?


                      for CAO Approval: return Capex.getCao_approval()==true;

                      for COO Approval: return Capex.getCoo_approval()==true;

                      for GMD Approval:return Capex.getGmd_approval()==true;

                      but Capex(budget>=1000001) how to define it?

                      bs.jpg

                      • 8. Re: Business rule task creating issue through JBPM6
                        swiderski.maciej

                        here you can find an example how to include drools rule condition in gateway condition. Please not it should not be in the drl file any more but simply i the conditionExpression.

                         

                        HTH

                        1 of 1 people found this helpful
                        • 9. Re: Business rule task creating issue through JBPM6
                          lakshjee

                          Hi

                          i am getting following error when i run the task.  Please assist me.

                           

                          Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement

                                 at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:74) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:136) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:58) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3081) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3523) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:393) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:385) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:301) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1240) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                                 ... 60 more

                          Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (JBPMDEV.SYS_C00215232) violated

                           

                                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)

                                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)

                                 at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)

                                 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)

                                 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)

                                 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)

                                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)

                                 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046)

                                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)

                                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)

                                 at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3694)

                                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1354)

                                 at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)

                          at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133) [hibernate-core-4.2.7.SP1-redhat-3.jar:4.2.7.SP1-redhat-3]

                          • 10. Re: Business rule task creating issue through JBPM6
                            mateuszadamiak

                            Maybe you need to check your settings of knowledge base/session (look at here https://www.youtube.com/watch?v=TM9cuL_Mfnk). I had similar issue and this was the cause.