Amin MC [
http://community.jboss.org/people/aminmc] created the discussion
"JUnit test and process instance variables"
To view the discussion, visit:
http://community.jboss.org/message/602340#602340
--------------------------------------------------------------
Hi
I have encountered an interesting scenario of my test failing when I run it but passing
when I debug the test. Basically I have the following code
WorkflowProcessInstance instance =
(WorkflowProcessInstance)session.getProcessInstance(processInstanceId);
DataObject dataObject = instance.getVariable(variableName);
session.signalEvent(..);
WorkflowProcessInstance instance =
(WorkflowProcessInstance)session.getProcessInstance(processInstanceId);
DataObject reloaded = instance.getVariable(variableName);
if (dataObject is not same as reloaded) {
doSomething();
}
What I notice is that when i run the test reloaded hasn't been updated when i expect
it to be as defined in my flow. However when I debug and wait a second or two reload gets
updated and the condition is evaluated. My test basically starts the flow and then
performs the signal.
I was wondering if anyone has experienced this issue? When running the code outside of a
test it works as expected but not within a test.
Any help would be appreciated.
Cheers
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/602340#602340]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]