I have a problem, I need to delete connections from an instance using EKL.
I'm currently using this method after deleting all the instances that I don't need in the project
Let MCX2 (MCX) Let DeleteComponentes (Boolean) DeleteComponentes = TRUE Let inReferenceChildNew1,inReferenceChildNew2,MCX1Child,MRX1Child (list) Let inReferenceMCXExtractIndex (Integer) Let inReferenceMCXName1 (String) inReferenceMCXExtractIndex = 1 inReferenceChildNew1 = VPMReference1.Children inReferenceChildNew2 = inReferenceChildNew1.Extract("MCX","MCX","y = x") For inReferenceMCXExtractIndex while inReferenceMCXExtractIndex <= inReferenceChildNew2.Size(){ MCX2 = inReferenceChildNew2 [inReferenceMCXExtractIndex] Let MCX2Name (string) Let MCX2List (List) MCX2Name = MCX2.Name MCX2List =MCX2List.Children IF MCX2 <> NULL{ Let MCXAux1 (String) IF MCX2.HasAttribute("Status") == TRUE{ MCXAux1 = MCX2.GetAttributeString("Status") if MCXAux1 == "Error" and DeleteComponentes == TRUE { MCX2.Delete() } } } }
After executing the code, the instances that are replaced have their connections deleted, when I comment this part of the code this does not happen.
One of the alternatives that came to me was to delete the connections when I delete the instance, but I don't know of a direct command for this task, is there anything that can be done?
Let inReferenseChildExtract2Index (Integer) Let oInstName,oResp (string) Let isInstance (Boolean) inReferenseChildExtract2Index = 1 if inReferenseChildExtract2.Size()>0 { for inReferenseChildExtract2Index while inReferenseChildExtract2Index <= inReferenseChildExtract2.Size(){ VPMInstance1 = inReferenseChildExtract2[inReferenseChildExtract2Index] if VPMInstance1 <> NULL{ oInstName = VPMInstance1.Name isInstance = jsonCarc.HasAttribute(oInstName) if isInstance == TRUE{ if oStructureUnit == NULL{ oResp = jsonCarc.GetAttributeString(oInstName) } else { oResp = jsonCarc.GetAttributeString(oStructureName + "|" + oInstName + "|" + "Activity") } if Reset == TRUE{ VPMInstance1->SetEffectivity("ActivateDeactivate","TRUE",TRUE) } if Reset == FALSE{ if (oResp == "TRUE" or oResp == "true") and DeleteComponentes==FALSE { VPMInstance1->SetEffectivity("ActivateDeactivate","TRUE",TRUE) } if (oResp == "FALSE" or oResp == "false") and DeleteComponentes==FALSE { VPMInstance1->SetEffectivity("ActivateDeactivate","FALSE",TRUE) } if (oResp == "FALSE" or oResp == "false") and DeleteComponentes==TRUE { VPMInstance1.Delete() } } } } } }