[jbpm-issues] [JBoss JIRA] Commented: (JBPM-2711) Subprocess waiting at <state> or <custom> throws JbpmException 'is not active: inactive-scope' even though isActive() returns true and findActiveActivityNames() returns the correct active state activity - Addition of <timer> on transition seems the cause.

Martin Porter (JIRA) jira-events at lists.jboss.org
Wed Jan 6 05:32:30 EST 2010


    [ https://jira.jboss.org/jira/browse/JBPM-2711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12502413#action_12502413 ] 

Martin Porter commented on JBPM-2711:
-------------------------------------

We are using the jobExecutor as this will be used in the real environment. But I take your point for unit testing then it could be removed and the techniques you pointed out used instead. my bad.

When you say use the ID of the active execution this is what I had assumed to be the id of the sub process instance. So when the subprocess is created and its ID is 'key.someid' then I should signal that 'key.someid' value as this is the active execution id ? Or am I misunderstanding something ? Maybe this is where the inactive-scope is coming from as I am using the child process instance id and I should instead be then using the jobQuery to get the id and then signal the transition using the job query id, I will look into the samples and see if i can see where i have got this confused !?.

We had used continue="async" as in our real environment we will have the process engine targetted to the cluster so there will effectively be multiple job executors and they should be able to pick up jobs from any node. So if we have a server failure the process execution should be picked up on another active node. Or at least this was our understanding or how async continuations should be working ? Is that valid or ?.

Just to clarify on triggering timers. You mean for testing we should remove the 'duedate' attribute to leave just <timer /> and then use the above job to trigger the actual timeout event ?.

Thanks
Martin





> Subprocess waiting at <state> or <custom> throws JbpmException 'is not active: inactive-scope' even though isActive() returns true and findActiveActivityNames() returns the correct active state activity - Addition of <timer> on transition seems the cause.
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBPM-2711
>                 URL: https://jira.jboss.org/jira/browse/JBPM-2711
>             Project: jBPM
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Runtime Engine
>    Affects Versions: jBPM 4.3
>         Environment: Eclipse 3.5, Oracle 11g, jBPM 4.3 & jBPM 4.2
>            Reporter: Martin Porter
>         Attachments: jira-jbpm2711.zip
>
>
> I have a sub-process that is waiting at a <state> activity. If I attempt to signal that activity using the subprocess id I get an exception with 'inactive scope'. Below is the code I am using to signal the activity and also the output (system.out) to show the status:-
> ProcessDefinition childProcessDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("org.jbpm.examples.subprocess.usecase.waitstate.child").uniqueResult();
> ProcessInstanceQuery query = executionService.createProcessInstanceQuery().processDefinitionId(childProcessDefinition.getId());
> ProcessInstance childInstance = query.uniqueResult();
> System.out.println("Found Child Process Instance With Id [" + childInstance.getId() + "]");	
> System.out.println("Is Active ? " + childInstance.isActive("Business Service Response Handler"));
> System.out.println("State = " + childInstance.getState());
> Set<String> activities = childInstance.findActiveActivityNames();
> for (String activity : activities) {
> 	System.out.println("Active Activity = " + activity);
> }
> executionService.signalExecutionById(childInstance.getId(), AbstractServiceDispatcher.SignalState.SUCCESS.getSignalName(), params);
> And here follows the output & stack trace:-
> Found Child Process Instance With Id [org.jbpm.examples.subprocess.usecase.waitstate.child.30020]
> Is Active ? true
> State = inactive-scope
> Active Activity = Business Service Response Handler
> 11:25:30,862 FIN       | [ExecuteActivity] execution[org.jbpm.examples.subprocess.usecase.waitstate.child.30020.Business Service Response Handler] executes activity(Business Service Response Handler)
> 11:25:30,862 FIN       | [ExecuteJobCmd] executed job ExecuteActivityMessage[30054]
> 11:25:30,862 FIN       | [HibernateSessionResource] ----- committing hibernate tx 10796546 -------------------------------------------------------
> 11:25:32,828 FIN | [HibernateSessionResource] ----- beginning hibernate tx 11998234 --------------------------------------------------------
> 11:25:32,828 FIN | [HibernateSessionResource] ----- committing hibernate tx 32888473 -------------------------------------------------------
> 11:25:32,828 FIN | [HibernateSessionResource] ----- beginning hibernate tx 21290107 --------------------------------------------------------
> 11:25:32,829 FIN | [HibernateSessionResource] ----- committing hibernate tx 22589165 -------------------------------------------------------
> Found Child Process Instance With Id [org.jbpm.examples.subprocess.usecase.waitstate.child.30020]
> 11:25:32,829 FIN | [HibernateSessionResource] ----- beginning hibernate tx 23590079 --------------------------------------------------------
> ### EXCEPTION ###########################################
> 11:25:32,829 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd at 88e83d
> org.jbpm.api.JbpmException: execution[org.jbpm.examples.subprocess.usecase.waitstate.child.30020] is not active: inactive-scope
> 	at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1024)
> 	at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:411)
> 	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
> 	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
> 	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
> 	at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
> 	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:55)
> 	at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
> 	at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:92)
> 	at org.jbpm.examples.subprocess.usecase.waitstate.SimpleSubflowUsecaseWaitStateTest.testSimpleSubflowRequestRetryThenSkipStepThenEndSuccess(SimpleSubflowUsecaseWaitStateTest.java:700)
> 	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 junit.framework.TestCase.runTest(TestCase.java:164)
> 	at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
> 	at junit.framework.TestCase.runBare(TestCase.java:130)
> 	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:120)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:230)
> 	at junit.framework.TestSuite.run(TestSuite.java:225)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> 	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)
> ### EXCEPTION ###########################################
> 11:25:32,829 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 4657294 -----------------------------------------------------
> 11:25:32,829 SEV | [BaseJbpmTestCase] 
> ### EXCEPTION ###########################################
> 11:25:32,829 SEV | [BaseJbpmTestCase] TEST THROWS EXCEPTION: execution[org.jbpm.examples.subprocess.usecase.waitstate.child.30020] is not active: inactive-scope
> org.jbpm.api.JbpmException: execution[org.jbpm.examples.subprocess.usecase.waitstate.child.30020] is not active: inactive-scope
> 	at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1024)
> 	at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:411)
> 	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
> 	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
> 	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
> 	at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
> 	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:55)
> 	at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
> 	at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:92)
> 	at org.jbpm.examples.subprocess.usecase.waitstate.SimpleSubflowUsecaseWaitStateTest.testSimpleSubflowRequestRetryThenSkipStepThenEndSuccess(SimpleSubflowUsecaseWaitStateTest.java:700)
> 	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 junit.framework.TestCase.runTest(TestCase.java:164)
> 	at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
> 	at junit.framework.TestCase.runBare(TestCase.java:130)
> 	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:120)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:230)
> 	at junit.framework.TestSuite.run(TestSuite.java:225)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> 	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)
> ### EXCEPTION ###########################################
> 11:25:32,829 SEV | [BaseJbpmTestCase] 
> If I remove the <timer> from the transition all works as expected. I also made a change the jbpm4.3.xsd to allow the timer to be added to the transition of a <custom> node in the same way as for <state> (see http://community.jboss.org/message/518116#518116 ). The result was the same that timers worked but the signalling fails and removing the <timer> allows the signalling to work again.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbpm-issues mailing list