snyperboss [
http://community.jboss.org/people/snyperboss] created the discussion
"Exception while trying to access java return value"
To view the discussion, visit:
http://community.jboss.org/message/628557#628557
--------------------------------------------------------------
Hello all,
I am getting exception while trying to access the java method return value. Below are my
source files.
HelloWorld.jpdl.xml:
###################
<?xml version="1.0" encoding="UTF-8"?>
<process name="HelloWorld" xmlns="
http://jbpm.org/4.4/jpdl
http://jbpm.org/4.4/jpdl">
<start g="127,111,38,30" name="start1">
<transition name="to PrintHelloWorld"
to="PrintHelloWorld"
g="-91,-18" />
</start>
<java class="com.jap.san.HelloWorldTest"
g="496,126,80,47"
method="printHelloWorld" name="PrintHelloWorld"
var="returnValue">
<transition g="-42,-18" name="to end1"
to="end1" />
</java>
<end g="634,132,29,27" name="end1" />
</process>
HelloWorldTest.java:
##################
package com.jap.san;
import java.io.Serializable;
public class HelloWorldTest implements Serializable{
public String printHelloWorld() {
System.out.println(" hi hi hi here @@@@@@");
return "from method";
}
}
Test file:
######################
ProcessEngine processEngine = new
Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();
RepositoryService repositoryService =
processEngine.getRepositoryService();
ExecutionService executionService =
processEngine.getExecutionService();
repositoryService.createDeployment().addResourceFromClasspath("com/jpmc/san/HelloWorld.jpdl.xml").deploy();
ProcessInstance processInstance
=executionService.startProcessInstanceByKey("HelloWorld");
String pid = processInstance.getId();
String answer = (String) executionService.getVariable(pid,
"returnValue");
System.out.println("answer");
It error out on in the line
String answer = (String) executionService.getVariable(pid, "returnValue");
19:58:26,064 INF | [DefaultCommandService] exception while executing command
org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd@b9b8d0
org.jbpm.api.JbpmException: execution HelloWorld.7 doesn't exist
at
org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:60)
at
org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:36)
at
org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at
org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
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:56)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at
org.jbpm.pvm.internal.svc.ExecutionServiceImpl.getVariable(ExecutionServiceImpl.java:131)
at com.jpmc.san.TestDeployment.main(TestDeployment.java:34)
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/628557#628557]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]