[jboss-user] [jBPM] - JUnit test and process instance variables

Amin MC do-not-reply at jboss.com
Wed Apr 27 15:00:41 EDT 2011


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&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110427/378c6ec5/attachment-0001.html 


More information about the jboss-user mailing list