} else {
callActivity.setName("");
}
if(properties.get("independent") != null && properties.get("independent").length() > 0) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "independent", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
properties.get("independent"));
callActivity.getAnyAttribute().add(extensionEntry);
}
if(properties.get("waitforcompletion") != null && properties.get("waitforcompletion").length() > 0) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "waitForCompletion", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
properties.get("waitforcompletion"));
callActivity.getAnyAttribute().add(extensionEntry);
}
if(properties.get("calledelement") != null && properties.get("calledelement").length() > 0) {
callActivity.setCalledElement(properties.get("calledelement"));
}
//callActivity data input set
if(properties.get("datainputset") != null && properties.get("datainputset").trim().length() > 0) {
String[] allDataInputs = properties.get("datainputset").split( ",\\s*" );
if(callActivity.getIoSpecification() == null) {
InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification();
callActivity.setIoSpecification(iospec);
}
InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet();
for(String dataInput : allDataInputs) {
if(dataInput.trim().length() > 0) {
DataInput nextInput = Bpmn2Factory.eINSTANCE.createDataInput();
String[] dataInputParts = dataInput.split( ":\\s*" );
if(dataInputParts.length == 2) {
nextInput.setId(callActivity.getId() + "_" + dataInputParts[0] + "InputX");
nextInput.setName(dataInputParts[0]);
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "dtype", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
dataInputParts[1]);
nextInput.getAnyAttribute().add(extensionEntry);
} else {
nextInput.setId(callActivity.getId() + "_" + dataInput + "InputX");
nextInput.setName(dataInput);
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "dtype", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
"Object");
nextInput.getAnyAttribute().add(extensionEntry);
}
callActivity.getIoSpecification().getDataInputs().add(nextInput);
inset.getDataInputRefs().add(nextInput);
}
}
callActivity.getIoSpecification().getInputSets().add(inset);
} else {
if(callActivity.getIoSpecification() != null) {
callActivity.getIoSpecification().getInputSets().add(Bpmn2Factory.eINSTANCE.createInputSet());
}
}
//callActivity data output set
if(properties.get("dataoutputset") != null && properties.get("dataoutputset").trim().length() > 0) {
String[] allDataOutputs = properties.get("dataoutputset").split( ",\\s*" );
if(callActivity.getIoSpecification() == null) {
InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification();
callActivity.setIoSpecification(iospec);
}
OutputSet outset = Bpmn2Factory.eINSTANCE.createOutputSet();
for(String dataOutput : allDataOutputs) {
if(dataOutput.trim().length() > 0) {
DataOutput nextOut = Bpmn2Factory.eINSTANCE.createDataOutput();
String[] dataOutputParts = dataOutput.split( ":\\s*" );
if(dataOutputParts.length == 2) {
nextOut.setId(callActivity.getId() + "_" + dataOutputParts[0] + "OutputX");
nextOut.setName(dataOutputParts[0]);
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "dtype", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
dataOutputParts[1]);
nextOut.getAnyAttribute().add(extensionEntry);
} else {
nextOut.setId(callActivity.getId() + "_" + dataOutput + "OutputX");
nextOut.setName(dataOutput);
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "dtype", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
"Object");
nextOut.getAnyAttribute().add(extensionEntry);
}