Hi,
this is my attribute rule. It seems to work fine, but i can not set the right terminal. I tried different things but I get always errors.
Expression
if ($feature.assetgroup == 1001) {
var update_class = 'ElectricDevice'
var filterDevice = "ASSETGROUP = 854 And DIRECTION = 'Voeding OV'"
var boundaries = FeatureSetByName($datastore, "FLUVIUS_109_DESIGN2.UTARC.StructureBoundary", ["globalid"], true);
if(isempty(boundaries)){
return;
//{"errorMessage": "Error 1"};
};
var intersectBoundaries = Intersects(boundaries, $feature);
if(isempty(intersectBoundaries)){
return;
//{"errorMessage": "Error 2"};
};
var structureBoundary = First(intersectBoundaries);
if(isempty(structureBoundary)){
return;
//{"errorMessage": "Error 3"};
}
var AllDevices = FeatureSetByName($datastore, "FLUVIUS_109_DESIGN2.UTARC.ElectricDevice", ["assetgroup", "globalid"], true);
if(isempty(AllDevices)){
return;
//{"errorMessage": "Error 4"};
}
var XYDevice = Filter(AllDevices, filterDevice)
if(isempty(XYDevice)){
return;
//{"errorMessage": "Error 5"};
};
var intersectDevice = Intersects(XYDevice, structureBoundary);
if(isempty(intersectBoundaries)){
return;
//{"errorMessage": "Error 6"};
};
var DeviceGeo = First(intersectDevice)
if(isempty(DeviceGeo)){
return;
//{"errorMessage": "Error 7"};
}
return {
"edit":
[
{"className": update_class,
"updates":[{"globalid": DeviceGeo.globalid,
"FROMTERMINALID": 13,
"associationType":"connected"}]}
]
}
}
I have tried:
-"fromTerminal": "13"

- "fromTerminal": 13

- "FROMTERMINALID": 13
I get a association without error but, I have topology errors and the terminal is set FromTerminalID 1 ToTerminalID 1

The association rule looks like this:

Thank you for your help!