container = out.eContainer();
if (container instanceof ProcessingElementInstance) {
ProcessingElementInstance pei = (ProcessingElementInstance) container;
Collection<LocalVariable> variables = DispelEObjectUtil
.getObjectsByType(pck.eAllContents(),
VariablesPackage.eINSTANCE.getLocalVariable());
for (LocalVariable var : variables) {
if (var.getValue() != null && var.getValue().equals(pei)) {
src1.setTarget(var);
}
}
}
/*******************************/
IdentifierReference dst1 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
IdentifierReference dst2 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
dst1.setNext(dst2);
dst2.setTarget((Input) getTarget());
Input in = (Input) getTarget();
container = in.eContainer();
if (container instanceof ProcessingElementInstance) {
ProcessingElementInstance pei = (ProcessingElementInstance) container;
Collection<LocalVariable> variables = DispelEObjectUtil
.getObjectsByType(pck.eAllContents(),
VariablesPackage.eINSTANCE.getLocalVariable());
for (LocalVariable var : variables) {
if (var.getValue() != null && var.getValue().equals(pei)) {
dst1.setTarget(var);
}
}
}
newElement.setChild(src1);
newElement.setValue(dst1);
}
//TODO iFO following might be buggy!
if (getSource() instanceof ConnectionInitialization
&& getTarget() instanceof Input) {
IdentifierReference dst1 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
IdentifierReference dst2 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
dst1.setNext(dst2);
dst2.setTarget((Input) getTarget());
Input in = (Input) getTarget();
container = in.eContainer();
if (container instanceof ProcessingElementInstance) {
ProcessingElementInstance pei = (ProcessingElementInstance) container;
Collection<LocalVariable> variables = DispelEObjectUtil
.getObjectsByType(pck.eAllContents(),
VariablesPackage.eINSTANCE.getLocalVariable());
for (LocalVariable var : variables) {
if (var.getValue() != null && var.getValue().equals(pei)) {
dst1.setTarget(var);
}
}
}
newElement.setChild(getSource());
newElement.setValue(dst1);
}
if (getSource() instanceof Output
&& getTarget() instanceof LocalVariable) {
IdentifierReference src1 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
IdentifierReference src2 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
src1.setNext(src2);
src2.setTarget((Output) getSource());
Output out = (Output) getSource();
container = out.eContainer();
if (container instanceof ProcessingElementInstance) {
ProcessingElementInstance pei = (ProcessingElementInstance) container;
Collection<LocalVariable> variables = DispelEObjectUtil
.getObjectsByType(pck.eAllContents(),
VariablesPackage.eINSTANCE.getLocalVariable());
for (LocalVariable var : variables) {
if (var.getValue() != null && var.getValue().equals(pei)) {
src1.setTarget(var);
}
}
}
IdentifierReference dst1 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
dst1.setTarget((LocalVariable) getTarget());
newElement.setChild(src1);
newElement.setValue(dst1);
}
if (getSource() instanceof LocalVariable
&& getTarget() instanceof Input) {
IdentifierReference dst1 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
IdentifierReference dst2 = ReferencesFactory.eINSTANCE
.createIdentifierReference();
dst1.setNext(dst2);
dst2.setTarget((Input) getTarget());
Input in = (Input) getTarget();
container = in.eContainer();
if (container instanceof ProcessingElementInstance) {
ProcessingElementInstance pei = (ProcessingElementInstance) container;
LocalVariable inVar = (LocalVariable) getSource();
pck = inVar.getContainingPackage();
Collection<LocalVariable> variables = DispelEObjectUtil