[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
Mon Jan 11 11:43:31 EST 2010
[ https://jira.jboss.org/jira/browse/JBPM-2711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12503386#action_12503386 ]
Martin Porter commented on JBPM-2711:
-------------------------------------
Hi,
Looking at your example I now see what you mean. However in the context of a <custom> or <state> node that has multiple transitions from it how can the management service be used to indicate which transition to take. In the example above there is either a timer transition or a message transition so presumably it takes the default transition, which will work in this case. But in our case we needed to signal a particular transition (out of three) which could be taken and hence this is why we used the signalExecutuionById(). Maybe I am missing the point here but looking at the job interface it only allows you to execute the job but no parameters can be supplied or a signal name !.?.
Regards
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
> Assignee: Ronald van Kuijk
> 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