6 Replies Latest reply on Mar 9, 2012 9:06 AM by ous2k

    JBPM5 gateway constraint access to own Object attributes

    ous2k

      Hi all,

      I 'm new in JBPM i'm trying access my object attribute in a gateway constraint  does any one know about.

      i found this in JBPM5 samples but i don't sill how to use it

       

      getProcessProperty("x")/myDocument/chapter1/text()="BlaBla"

       


        • 1. Re: JBPM5 gateway constraint access to own Object attributes
          ous2k

          i still have the same gateway constaint  problem above the msg error, even i have added the package name like said in other post

           

          org.drools.RuntimeDroolsException: invalid package name

                    at org.jbpm.compiler.ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:173)

                    at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:252)

                    at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:564)

                    at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:608)

                    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)

                    at com.sample.MainTester.readKnowledgeBase(MainTester.java:49)

                    at com.sample.MainTester.testEDPBM(MainTester.java:29)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:601)

                    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

                    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

                    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

                    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

                    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

          [5,13]: [ERR 102] Line 5:13 mismatched input 'myLoan' in rule "RuleFlow-Split-com.sample.bpmn-5-3-DROOLS_DEFAULT" in pattern

          [12,13]: [ERR 102] Line 12:13 mismatched input 'myLoan' in rule "RuleFlow-Split-com.sample.bpmn-5-4-DROOLS_DEFAULT" in pattern

           

           

           

          [0,0]: Parser returned a null PackageScreenshot at 2012-03-08 16:58:49.png

           

          in attachement you can find the project file

          does any one can provide help???

          http://www.2shared.com/file/2loSNUHP/loanExampletar.html

          • 2. Re: JBPM5 gateway constraint access to own Object attributes
            swiderski.maciej

            try with this:

             

            <conditionExpression xsi:type="tFormalExpression" >return myLoan.isDeliveryStatus();</conditionExpression>
            

             

            HTH

            • 3. Re: JBPM5 gateway constraint access to own Object attributes
              ous2k

              Thx Maciej Swiderski i have tried that but there is some thing else wrong ,

              to in same wave i have added the process varibale myLoan as an object and className com.sample.Loan from using properties palette on eclipse

               

              ava.lang.RuntimeException: Exception when trying to evaluate constraint VIP in split Gateway

                        at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:79)

                        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)

                        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:185)

                        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:150)

                        at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

                        at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

                        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)

                        at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)

                        at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)

                        at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)

                        at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)

                        at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138)

                        at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1079)

                        at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)

                        at com.sample.CustomerSelection.main(CustomerSelection.java:32)

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

                        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:130)

                        at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:72)

                        ... 14 more

              Caused by: [Error: null pointer: loan.isDeliveryStatus()]

              [Near : {... return loan.isDeliveryStatus() ....}]

                           ^

              [Line: 1, Column: 1]

                        at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:434)

                        at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:141)

                        at org.mvel2.ast.ASTNode.optimize(ASTNode.java:157)

                        at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:113)

                        at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)

                        at org.mvel2.ast.ReturnNode.getReducedValueAccelerated(ReturnNode.java:50)

                        at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)

                        at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)

                        at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)

                        at org.mvel2.MVEL.executeExpression(MVEL.java:930)

                        at org.jbpm.process.instance.impl.MVELReturnValueEvaluator.evaluate(MVELReturnValueEvaluator.java:100)

                        at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:128)

                        ... 15 more

              Caused by: java.lang.NullPointerException

                        at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:395)

                        ... 26 more

              Best Regards

              • 4. Re: JBPM5 gateway constraint access to own Object attributes
                swiderski.maciej

                ous2k wrote:

                 

                Caused by: [Error: null pointer: loan.isDeliveryStatus()]

                [Near : {... return loan.isDeliveryStatus() ....}]

                maybe you reference wrong variable, as you said you defined variable with name myLoan?

                • 5. Re: JBPM5 gateway constraint access to own Object attributes
                  ous2k

                  i think the problem is in the evaluation or some thing like that  Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluatore do you agree

                  in attachement you can find the code

                  http://www.2shared.com/file/NqGr1flD/customerselection.html

                   

                  Best Regards

                   

                   


                  • 6. Re: JBPM5 gateway constraint access to own Object attributes
                    ous2k

                    @Maciej Swiderski you answer is correct,there was an other problem in identifier of variable injected from java testing class

                     

                    in attachement you can find the correct code, Thx For help Maciej

                    http://www.2shared.com/file/M251nied/customerselection.html