Test case for BZ#782032 #49

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@tomason
tomason commented Jan 17, 2012

Hi Kris,
here is promised reproducer for bugzilla mentioned in subject.

Tomas Schlosser

@tomason
tomason commented Jan 18, 2012

added one more test to pull request

@mrietveld mrietveld commented on the diff Jan 25, 2012
...persistence/processinstance/ParameterMappingTest.java
+ Thread.sleep(500);
+
+ Assert.assertTrue(listener.isProcessStarted(PROCESS_ID));
+ Assert.assertTrue(listener.isProcessStarted(SUBPROCESS_ID));
+ Assert.assertTrue(listener.isProcessCompleted(SUBPROCESS_ID));
+ Assert.assertTrue(listener.isProcessCompleted(PROCESS_ID));
+ }
+
+ @Test
+ public void testChangingVariableByEvent2() throws Exception {
+ Map<String, Object> mapping = new HashMap<String, Object>();
+ mapping.put("type", "event");
+ mapping.put("var", "value");
+
+ long processId = ksession.startProcess(PROCESS_ID, mapping).getId();
+ ksession.getProcessInstance(processId).signalEvent("pass", "new value");
@mrietveld
mrietveld Jan 25, 2012 Member

Tomas,

I'm busy writing the fix for this (and merging your commits/tests as well -- thank you for the tests!).

Because of how persistence is setup, this will never work. In fact, anything that looks like this:

ksession.<method>(<args>).<method-on-return-value-of-ksession-method>(<more-args>)

Will always fail: persistence based (stateful) knowledge sessions are based around a Command pattern where every method on the ksession is a command (with associated handling of the persistence context and transactions).

We're going to leave this the way it is, and document above (use ksession methods, don't count on return values, etc.).

I'll add it to the persistence chapter of the docs but if you have a suggestion for other good places (java docs of specific classes?), please let me know.

Thanks,
Marco

@mrietveld
Member

Tomas,

I've merged this by cherry-picking your commits to the appropriate branches.

@mrietveld mrietveld closed this Jan 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment