* Test case for handing over process variables without target attribute set
*/
public void testSubProcessWithDataInputOutputWithoutTarget() {
String processId = "subProcessDataInputOutputWithoutTarget";
BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(processId)
.startEvent()
.callActivity("callActivity")
.calledElement("simpleSubProcess")
.userTask()
.endEvent()
.done();
CallActivityBuilder callActivityBuilder = ((CallActivity) modelInstance.getModelElementById("callActivity")).builder();
// create camunda:in with source but without target
CamundaIn camundaIn = modelInstance.newInstance(CamundaIn.class);
camundaIn.setCamundaSource("superVariable");
callActivityBuilder.addExtensionElement(camundaIn);
deployAndExpectException(modelInstance);
// set target
camundaIn.setCamundaTarget("subVariable");
// create camunda:in with sourceExpression but without target
camundaIn = modelInstance.newInstance(CamundaIn.class);
camundaIn.setCamundaSourceExpression("${x+5}");
callActivityBuilder.addExtensionElement(camundaIn);
deployAndExpectException(modelInstance);
// set target
camundaIn.setCamundaTarget("subVariable2");
// create camunda:out with source but without target
CamundaOut camundaOut = modelInstance.newInstance(CamundaOut.class);
camundaOut.setCamundaSource("subVariable");
callActivityBuilder.addExtensionElement(camundaOut);
deployAndExpectException(modelInstance);
// set target
camundaOut.setCamundaTarget("superVariable");
// create camunda:out with sourceExpression but without target
camundaOut = modelInstance.newInstance(CamundaOut.class);
camundaOut.setCamundaSourceExpression("${y+1}");
callActivityBuilder.addExtensionElement(camundaOut);
deployAndExpectException(modelInstance);
// set target