[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
Can you place the following lines in ur code: System.out.println(root token name=+rootToken.getNode().getName()); After the following line: Token rootToken = procInst.getRootToken(); Let me know the result. Ravi Prakash View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3913347#3913347 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3913347 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
Hi Ravi, I got following result after adding the sop. root token name=Read Loans Data where 'Read Loans Data' is the state where the instance is waiting. Regards, Nilesh View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3913348#3913348 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3913348 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
That means, the root token points to node 'Read Lones Data' and again you are trying to signal to the same node in the following line: rootToken.signla(toReadLoansData); You have already reached that node. I think you can just use token.signal() to execute the node 'Read Lones Data'. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3913366#3913366 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3913366 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
Please find following code ?xml version=1.0 encoding=UTF-8? | | process-definition | xmlns=http://jbpm.org/3/jpdl; | xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; | xsi:schemaLocation=http://jbpm.org/3/jpdl http://jbpm.org/xsd/jpdl-3.0.xsd | name=simple | start-state name=start | transition name=toCheckDSCR to=Check DSCR | action name=Read DSC Ratio class=com.sample.action.FirstActionHandler/action | /transition | /start-state | end-state name=end | /end-state | decision name=Check DSCR | transition name=toReadLoansData to=Read Loans Data | condition | executionContext.getVariable(DSCRatio).intValue() 0 | /condition | /transition | transition name=toRejectLoan to=Reject Loan | condition | executionContext.getVariable(DSCRatio).intValue() == 0 | /condition | /transition | /decision | task-node name=Reject Loan | transition name=toEndFromRejectLoan to=end | action name=action1 class=com.sample.action.LoanRejectHandler/action | /transition |/task-node | state name=Read Loans Data | | transition name=toProcessLoanDecision to=Process Loan Decision | action name=action1 class=com.sample.action.DatabaseActionHandler/action | /transition |/state | decision name=Process Loan Decision | transition name=toProcessLoan to=Process Loan | condition | executionContext.getVariable(LoanProcessingDecision).toString().equals(Yes) | /condition | /transition | transition name=toEndFromProcessLoanDecision to=end | condition | executionContext.getVariable(LoanProcessingDecision).toString().equals(No) | /condition | /transition | /decision |task-node name=Process Loan | transition name=toEndFromProcessLoan to=end | action name=action1 class=com.sample.action.ProcessLoanHandler/action | /transition |/task-node | | /process-definition Code for Test class | package com.sample; | | import java.io.FileReader; | import java.util.ArrayList; | | | | import junit.framework.TestCase; | | import org.jbpm.db.JbpmSession; | import org.jbpm.db.JbpmSessionFactory; | import org.jbpm.graph.def.ProcessDefinition; | import org.jbpm.graph.exe.ProcessInstance; | import org.jbpm.graph.exe.Token; | import org.jbpm.jpdl.xml.JpdlXmlReader; | | public class SimpleProcessTest extends TestCase { | | static JbpmSessionFactory jbpmSessionFactory = JbpmSessionFactory.buildJbpmSessionFactory(); | | public void testSimpleProcess() throws Exception { | | //saveProcessDefinition(); | //saveProcessInstance(); | readProcessInstance(); | | } | | public void saveProcessInstance() { | | // obtain a session | JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession(); | try { | ProcessDefinition loanProcess = jbpmSession.getGraphSession().findLatestProcessDefinition(simple); | // start a user managed transaction | jbpmSession.beginTransaction(); | | ProcessInstance loanInstance = new ProcessInstance(loanProcess); | loanInstance.signal(); | | // store the result in the database | jbpmSession.getGraphSession().saveProcessInstance(loanInstance); | | // commit the user transaction | jbpmSession.getConnection().commit(); | | } | catch(Exception e) | { | e.printStackTrace(); | } | finally { | // close the session. | jbpmSession.close(); | } | } | | public void readProcessInstance() | { | JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession(); | ProcessDefinition procDef = jbpmSession.getGraphSession().findLatestProcessDefinition(simple); | | ArrayList arlProcInsts = (ArrayList) jbpmSession.getGraphSession().findProcessInstances(procDef.getId()); | | | int count = arlProcInsts.size(); | ProcessInstance procInst = null; | System.out.println( +count ++ procDef); | for (int i = 0; i count; i++) | { | procInst = (ProcessInstance) arlProcInsts.get(i); | System.out.println(Process Instance ID = + procInst.getId()); | System.out.println(Has Ended Value = + procInst.hasEnded()); | } | | Token rootToken = procInst.getRootToken(); | | Token token = rootToken.findToken(Check DSCR/Read Loans Data); | System.out.println(token = + token); | |
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
Following changes I did: 1. Read rootToken from the instance I read from the database. Token rootToken = procInst.getRootToken(); 2. signal the rootToken by specifying transition name rootToken.signal(toReadLoansData); But now I am getting following error java.lang.IllegalStateException: couldn't signal token 'Token(/)' : couldn't leave node 'null' over the its transition 'toReadLoansData' at org.jbpm.graph.exe.Token.signal(Token.java:101) at com.sample.SimpleProcessTest.readProcessInstance(SimpleProcessTest.java:199) at com.sample.SimpleProcessTest.testSimpleProcess(SimpleProcessTest.java:25) 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 junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) I don't understand when it says 'couldn't leave node 'null'' , which node it is refering to and which it getting as NULL. I want to achieve following: - Create Process Definition and store it in database using jbpmSession.getGraphSession().saveProcessDefinition(definition); I am using MSSQL. This process has one State node at which execution should wait for external input. I have to use State and not task-node as i want to take user input. - create process instances of this process and start execution. The instance will wait at the State node. Store the waiting processing instance in database. - Read the saved process instance from the database when external input is received and restart the execution. Please confirm that the approach is correct. Thanks for any better approaches. Regards, Nilesh View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3911703#3911703 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3911703 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
please post the processdefinition and the code. Include it in code tags to make it visible (do a preview to see if it is ok) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3911740#3911740 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3911740 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: JBOSS jBPM tool evaluation Help Required
you should signal the node passing it a transitionname (not null!) or use the signal without a parameter. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3911523#3911523 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3911523 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user