_process.addCorrelator(CORRELATOR_ID2);
return corr;
}
private ProcessInstanceDAO createProcessInstance(ProcessDAO process, CorrelatorDAO corr) throws SAXException, IOException {
ProcessInstanceDAO pi = null;
String[] actions = { "action1","action2" };
String[] correlationKeys = { "key1", "key2" };
CorrelationKey key1 = new CorrelationKey(1,correlationKeys);
CorrelationKey key2 = new CorrelationKey(2,correlationKeys);
CorrelationKey[] corrkeys = {key1,key2};
QName[] names = { new QName(TEST_NS,"name1"), new QName(TEST_NS,"name2") };
pi = process.createInstance(corr);
pi.setExecutionState(new String("test execution state").getBytes());
pi.setFault(new QName(TEST_NS,"testFault"), "testExplanation", 1, 1, DOMUtils.stringToDOM("<testFaultMessage>testMessage</testFaultMessage>"));
pi.setLastActiveTime(cal.getTime());
pi.setState((short) 1);
pi.createActivityRecovery("testChannel1", 3, "testReason1", cal.getTime(), DOMUtils.stringToDOM("<testData>testData1</testData>"), actions, 2);
pi.createActivityRecovery("testChannel2", 4, "testReason2", cal.getTime(), DOMUtils.stringToDOM("<testData>testData2</testData>"), actions, 2);
ScopeDAO root = pi.createScope(null, "Root", 1);
root.setState(ScopeStateEnum.ACTIVE);
ScopeDAO child1 = pi.createScope(root, "Child1", 2);
child1.setState(ScopeStateEnum.ACTIVE);
XmlDataDAO var1 = child1.getVariable("var1");
var1.set(DOMUtils.stringToDOM("<testData>testData</testData>"));
var1.setProperty("key1", "prop1");
var1.setProperty("key2", "prop2");