[JBoss jBPM] - Serializing Session in jbpm???
by ashishc
Hi All,
I am running into another issue with Serializing jms session object in jbpm..
I am using jms/tibco to store and retrieve the messages from a queue and in the workflow what I am doing as a first step is create a session and then at the end of the workflow ..ack the message and end that session.
Now since tibco jms session is not serializable jbpm is not able to store that object in its dbâ¦
So I created a session store and returned the id which I storeâ¦.But when the execution transitions from one step to another, the static variable is cleared outâ¦
Here is the code what I am talking aboutâ¦.
Step 1: to create sessionâ¦
public class QueueSessionHandler implements ActionHandler {
|
| public void execute(ExecutionContext context) throws Exception {
|
| context.getContextInstance().setVariable(CONSTANTS.SESSION_OBJECT_VAR, SessionStore.storeSession(CreateSession()));
Here is the SessionStore Class:
import java.io.Serializable;
| import java.util.HashMap;
| import java.util.Map;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
|
| import javax.jms.Session;
|
| public class SessionStore {
|
| private static Map<String,Session> StoreMap = null;
| private static int m_SeqNumber = 1;
|
| static {
| StoreMap = new HashMap<String,Session>();
| }
|
| public static String storeSession(Session s)
| {
| String token = "" + m_SeqNumber++;
|
| StoreMap.put(token, s);
| return token;
| }
|
| public static Session getSession(String token)
| {
| Session s = StoreMap.get(token);
| return s;
| }
|
| public static void destroySession(String token)
| {
| StoreMap.remove(token);
| }
| }
Step 2 of the workflow:
public void execute(ExecutionContext context) throws Exception {
| context.getContextInstance().setVariable("actionName", actionName);
| context.getContextInstance().setVariable("queueName", queueName);
|
| String token = (String)context.getContextInstance().getVariable(CONSTANTS.SESSION_OBJECT_VAR);
| Session prevSession = SessionStore.getSession(token);
| log.info("Session token is " + token);
| if(prevSession != null)
| {
| context.getContextInstance().setVariable(CONSTANTS.INCOMING_MSG_READ_VAR, ReadMessage(prevSession, queueName));
| log.info("Returning after reading message from incoming queue");
| }
| else {
| context.getContextInstance().setVariable(CONSTANTS.INCOMING_MSG_READ_VAR, "");
| log.info("Session is null so not reading message...returning blank");
| }
In Step 2 of the WF I expect when I call SessionStore.getSession it should have the same StoreMap and return me the session which I stored in thereâ¦.but actually the StoreMap is empty/null or recreatedâ¦.that is what I am not understandingâ¦.
Can you please advise on how should i be doing that....
Thanks
ashish
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166759#4166759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166759
16 years, 4 months
[JBoss jBPM] - org.hibernate.HibernateException: null index column for coll
by clandestino_bgd
Hi,
to be honest, I do not know why i am posting question on this forum, since I am the one who only answers on them, and I really do not think I will have an answer on this one :)
It seems, I feel really desperate :(
So the problem is the following:
I am using Jbpm-jpdl-3.2.3, hibernate 3.2.5, latest spring modules and basically use JBPM with Spring, passing the existing sessionFactory to jbpmContext.
Everything works fine within JUnit test cases (I extend AbstractTransactionalDataSourceSpringContextTests and at the end of each test method, I call setComplete() in order to commit in DB instead of default rollback.
But the same methods. e.g deploy/undeployProcessDefinition with the same process definition do not work under tomcat.
For example: method undeployProcessDefinition results in
| org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.def.ProcessDefinition.nodes
|
And, by looking in DB, after executed method deployProcessDefinition, it is not wonder, since the field:
NODECOLLECTIONINDEX_ in JBPM_NODE table is NULL for every node record.
Just to note, when invoked the same method within JUnit the NODECOLLECTIONINDEX_ is NOT NULL.
I read user manual several times, along with the most JIRA issues, (no wonder since I am working with JBPM very long time).
Can somebody, possibly can have a clue what can be the reason for this?
Btw, I read Bernd's JIRA issue about the same exception when using JtaPersistenceServicefactory, but then he said that it was because of the wrong conf.
It is definitely not my case, at least extensive debug messages confirm that everything is initialised properly. I even compared the initialisation code in both cases (junit and tomcat) and everything looks just the same and without any problem.
NOTE: since I am using JBPM with spring and within a big enterprise application, I am not able to send short Unit test, that someone can try locally.
Thanks a lot for every hint.
Milan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166738#4166738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166738
16 years, 4 months
[JBoss jBPM] - Task Node Question - How to end blocking tasks
by steve.j.hall@tektronix.com
I could use some help with how to end or close blocking tasks in a task node. Here is my scenario:
I an able to successfully move a token through the nodes in my workflow using the processinstance.signal method. The process has 4 nodes named START, R, S, END. Node R is a task node. A simple test of the work flow works fine. I can move the token through the work flow using the signal method as shown in the examples.
After this initial test, I added a single task to the R task node. The new task is named AssignMacAddress. AssignMacAddress is blocking and signalling. I can see that the process moves through the AssignMacAddress task and calls methods for the assignment and controller classes I have associated to it.
Now when I attempt to signal to move from node r to node s, I get java.lang.IllegalStateException: task-node 'R' still has blocking tasks.
My question is how do I end or close the blocking AssignMacAddress task so that the process is able to move from node r to s without throwing the error? I have tried a number of approaches, none of them work.
Thanks in advance.
Steve
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166733#4166733
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166733
16 years, 4 months
[JBoss jBPM] - Re: Oracle Error Keyword from missing
by AJanz
don't think so
configuration is
| <?xml version='1.0' encoding='utf-8'?>
|
| <!DOCTYPE hibernate-configuration PUBLIC
| "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
| <hibernate-configuration>
| <session-factory>
|
| <!-- hibernate dialect -->
| <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
|
| <!-- JDBC connection properties (begin) -->
| <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
| <property name="hibernate.connection.url">jdbc:oracle:thin:@server:1521:orcl</property>
| <property name="hibernate.connection.username">admin</property>
| <property name="hibernate.connection.password">admin</property>
| <!-- JDBC connection properties (end) -->
|
| <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
|
| <!-- DataSource properties (begin) ===
| <property name="hibernate.connection.datasource">java:/JbpmDS</property>
| ==== DataSource properties (end) -->
|
| <!-- JTA transaction properties (begin) ===
| <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
| <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
| ==== JTA transaction properties (end) -->
|
| <!-- CMT transaction properties (begin) ===
| <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
| <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
| ==== CMT transaction properties (end) -->
|
| <!-- logging properties (begin) ===
| <property name="hibernate.show_sql">true</property>
| <property name="hibernate.format_sql">true</property>
| <property name="hibernate.use_sql_comments">true</property>
| ==== logging properties (end) -->
|
| <!-- ############################################ -->
| <!-- # mapping files with external dependencies # -->
| <!-- ############################################ -->
|
| <!-- following mapping file has a dependendy on -->
| <!-- 'bsh-{version}.jar'. -->
| <!-- uncomment this if you don't have bsh on your -->
| <!-- classpath. you won't be able to use the -->
| <!-- script element in process definition files -->
| <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
|
| <!-- following mapping files have a dependendy on -->
| <!-- 'jbpm-identity.jar', mapping files -->
| <!-- of the pluggable jbpm identity component. -->
| <!-- Uncomment the following 3 lines if you -->
| <!-- want to use the jBPM identity mgmgt -->
| <!-- component. -->
| <!-- identity mappings (begin) -->
| <mapping resource="org/jbpm/identity/User.hbm.xml"/>
| <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
| <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
| <!-- identity mappings (end) -->
|
| <!-- following mapping files have a dependendy on -->
| <!-- the JCR API -->
| <!-- jcr mappings (begin) ===
| <mapping resource="org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml"/>
| ==== jcr mappings (end) -->
|
|
| <!-- ###################### -->
| <!-- # jbpm mapping files # -->
| <!-- ###################### -->
|
| <!-- hql queries and type defs -->
| <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
|
| <!-- graph.action mapping files -->
| <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
|
| <!-- graph.def mapping files -->
| <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
| <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
| <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
|
| <!-- graph.node mapping files -->
| <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
| <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
|
| <!-- context.def mapping files -->
| <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
| <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
|
| <!-- taskmgmt.def mapping files -->
| <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
|
| <!-- module.def mapping files -->
| <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
|
| <!-- bytes mapping files -->
| <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
|
| <!-- file.def mapping files -->
| <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
|
| <!-- scheduler.def mapping files -->
| <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
| <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
|
| <!-- graph.exe mapping files -->
| <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
| <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
| <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
| <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
|
| <!-- module.exe mapping files -->
| <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
|
| <!-- context.exe mapping files -->
| <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
| <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
|
| <!-- job mapping files -->
| <mapping resource="org/jbpm/job/Job.hbm.xml"/>
| <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
| <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
| <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>
|
| <!-- taskmgmt.exe mapping files -->
| <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
|
| <!-- logging mapping files -->
| <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
| <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
| <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
| <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
| <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
|
| </session-factory>
| </hibernate-configuration>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166644#4166644
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166644
16 years, 4 months
[JBoss jBPM] - Oracle Error Keyword from missing
by AJanz
i got an error using oracle with jbpm
the statement is
| select
| job0_.ID_ as ID1_25_,
| job0_.VERSION_ as VERSION3_25_,
| job0_.DUEDATE_ as DUEDATE4_25_,
| job0_.PROCESSINSTANCE_ as PROCESSI5_25_,
| job0_.TOKEN_ as TOKEN6_25_,
| job0_.TASKINSTANCE_ as TASKINST7_25_,
| job0_.ISSUSPENDED_ as ISSUSPEN8_25_,
| job0_.ISEXCLUSIVE_ as ISEXCLUS9_25_,
| job0_.LOCKOWNER_ as LOCKOWNER10_25_,
| job0_.LOCKTIME_ as LOCKTIME11_25_,
| job0_.EXCEPTION_ as EXCEPTION12_25_,
| job0_.RETRIES_ as RETRIES13_25_,
| job0_.NAME_ as NAME14_25_,
| job0_.REPEAT_ as REPEAT15_25_,
| job0_.TRANSITIONNAME_ as TRANSIT16_25_,
| job0_.ACTION_ as ACTION17_25_,
| job0_.GRAPHELEMENTTYPE_ as GRAPHEL18_25_,
| job0_.GRAPHELEMENT_ as GRAPHEL19_25_,
| job0_.NODE_ as NODE20_25_,
| job0_.CLASS_ as CLASS2_25_
| from
| JBPM_JOB job0_
| where (job0_.LOCKOWNER_ is null
| or job0_.LOCKOWNER_=?)
| and job0_.RETRIES_>0
| and job0_.DUEDATE_<=?
| and job0_.ISSUSPENDED_<>1
| order by job0_.DUEDATE_ asc
i could execute it from a database client. no problem
but under jbpm i got
ORA-00923- FROM keyword not found where expected-
what may i have done wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166638#4166638
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166638
16 years, 4 months