[JBoss jBPM] - Expression Language not worked in JBPM-jpdl-3.2.2
by soumya_in
I used a back-end bean like this.
| public String strUser = "user";
| public String getStrUser() {
| return strUser;
| }
| public void setStrUser(String strUser) {
| this.strUser = strUser;
| }
|
I used a Expression Language to this Processdefinition.xml as follows.
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="loanProcess">
| <start-state name="start-state1">
| <task name="StartTask"></task>
| <transition to="task-node1"></transition>
| </start-state>
| <event type="task-create">
| <action class="com.sample.action.AssignUsr"></action>
| </event>
| <task-node name="task-node1">
| <task name="task1"> <assignment expression="user(#{obj[strUser]})"></assignment>
| </task>
| <transition to="End"></transition>
| </task-node>
| <end-state name="End"></end-state>
|
I set the back-end bean object to contextInstance in the following way in the JUnit
| processInstance.getContextInstance().setVariable("obj", obj);
|
Got a stack trace like this
| 14:28:27,401 [main] DEBUG ExpressionAssignmentHandler : resolving first term 'user(#{obj[strUser]})'
| Exception in thread "main" org.jbpm.graph.def.DelegationException: couldn't resolve assignment expression 'user(#{obj[strUser]})'
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:216)
| at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:204)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:154)
| at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:168)
| at org.jbpm.graph.def.Node.enter(Node.java:319)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$89d40aac.enter(<generated>)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.node.StartState.leave(StartState.java:70)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$89d40aac.leave(<generated>)
| at org.jbpm.graph.exe.Token.signal(Token.java:195)
| at org.jbpm.graph.exe.Token.signal(Token.java:140)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:271)
| at com.cts.client.TestClient.main(TestClient.java:30)
| Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't resolve assignment expression 'user(#{obj[strUser]})'
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:97)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:228)
| at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:201)
| ... 23 more
| Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: user '#{obj[strUser]}' couldn't be fetched from the user db
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.getUserByName(ExpressionAssignmentHandler.java:209)
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.resolveFirstTerm(ExpressionAssignmentHandler.java:147)
| at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:75)
| ... 25 more
|
Am i doing something wrong!!!!
Is there any way to do the following i.e. to access certain variable from a back-end bean using Expression...
NB:- My jpbm is not integrated with Seam and I used to assign the task to that user whichever I wish to set in my back-end bean
Thanks
Soumya
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122936#4122936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122936
18 years, 5 months
[JBossCache] - Re: JDBCacheLoader & hot redeploy
by lovelyliatroim
My config looks like so
| <attribute name="CacheLoaderConfig" replace="false">
| <config>
| <!-- are the cache loaders shared in a cluster? -->
| <shared>false</shared>
| <async>true</async>
| <fetchPersistentState>false</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| <purgeOnStartup>false</purgeOnStartup>
|
| <cacheloader>
| <class>org.jboss.cache.loader.JDBCCacheLoader</class>
|
| <properties>
| cache.jdbc.datasource=java:/cmdsDB
| </properties>
|
| </cacheloader>
|
| </config>
| </attribute>
|
|
Just to give you and idea on my ear package, might have something to do with that
anonymous wrote :
| +cmds.ear
| +cmds-cache.jar
| +meta-inf
| +cmdsNonPersistenCache-service.xml
| +meta-inf
| +cmdsPersistentCache-service.xml
| +webapp.war
| +common.jar
|
Just in case directory structure is important, there are 2 things i know that are wrong and havent changed yet. 1. Is why 2 service files in 2 different directory structures?? Well apparently you can only have one-service file in your meta-ing directory, at the moment i have 2 seperate cache configs one for a persistent cache and for a non persistent cache.(Will take out the non persistent config cache and see if this is having an effect, will let you know). 2nd thing wrong is that my cmds-cache.jar should be called cmds-cache.sar but the deployer is still picking up the service file and deploying it so i havent bothered to rename!!
What is you directory structure looking like??
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122922#4122922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122922
18 years, 5 months