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");
XmlDataDAO var2 = child1.getVariable("var2");
var2.set(DOMUtils.stringToDOM("<testData>testData</testData>"));
var2.setProperty("key1", "prop1");
var2.setProperty("key2", "prop2");
CorrelationSetDAO cs1 = child1.getCorrelationSet("TestCorrelationSet1");
cs1.setValue(names,key1);
PartnerLinkDAO pl1 = child1.createPartnerLink(1, "Test PartnerLink1", "MyRole1", "PartnerRole1");