milnauf [http://community.jboss.org/people/milnauf] created the discussion
"Re: Transition rule EL Expression fails [Solved]" To view the discussion, visit: http://community.jboss.org/message/583448#583448 -------------------------------------------------------------- Hello, I running into problems when I try evaluating an expression during runtime (yeah - using internal APIs :s ). What I'm doing is essentially try to find possible execution path using transition's condition. The problem is that the method org.jbpm.pvm.internal.model.ExpressionCondition.evaluate(OpenExecution execution) - invokes evaluate() on created expression - rather than evaluate(execution). The problem is that the execution variables are not found - because in the subsequent call to JbpmElFactoryImpl.createCompositeResolver - if the scopeInstance is null - which it is in this case - the JbpmVariableElResolver is not added. So a cosmetic change of the org.jbpm.pvm.internal.model.ExpressionCondition evaluate to invoke evaluate with execution parameter rather than without it - should fix the problem. Unless of course there's a good reason for not passing current execution. At the bottom I attach a stacktrace for the error that I'm getting -> resulting directly from not using the OpenExecution to evaluate the expression. The resulting code would be similar to the below: public class org.jbpm.pvm.internal.model.ExpressionCondition { public boolean evaluate(OpenExecution execution) { Object result = Expression.create(expression, language).evaluate(execution); if (result instanceof Boolean) { return ((Boolean) result).booleanValue(); } throw new JbpmException("expression condition '" + expression + "' did not return a boolean: "+result); } ... } Stack trace: javax.el.PropertyNotFoundException: Cannot resolve identifier 'task1' at de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:86) at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:51) at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:28) at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:122) at org.jbpm.pvm.internal.el.UelValueExpression.evaluateInScope(UelValueExpression.java:52) at org.jbpm.pvm.internal.el.Expression.evaluate(Expression.java:108) at org.jbpm.pvm.internal.model.ExpressionCondition.evaluate(ExpressionCondition.java:41) at com.wfi.base.service.util.WorkItemQuery.findFutureItemNames(WorkItemQuery.java:59) at com.wfi.base.service.util.WorkItemQuery.findFutureItemNames(WorkItemQuery.java:63) at com.wfi.base.service.util.WorkItemQuery.execute(WorkItemQuery.java:50) at com.wfi.base.service.util.WorkItemQuery.execute(WorkItemQuery.java:1) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56) at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43) at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.execute(ProcessEngineImpl.java:300) at com.wfi.ec.workflow.WorkflowService.findCurrentWorkItem(WorkflowService.java:303) at com.wfi.ec.workflow.WorkflowServiceTest.testFutureSteps(WorkflowServiceTest.java:392) 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:597) 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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) 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) -------------------------------------------------------------- Reply to this message by going to Community [http://community.jboss.org/message/583448#583448] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
_______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
