When I try to link two object in my code repositories into a TS function as explain in the foundry documentation:
// Set an Employee's supervisor employee.supervisor.set(newSupervisor);
There is my code:
@Edits(A,B)
@OntologyEditFunction()
private Link_to_B(a:A,b:B):void{b.A.clear(),
a.B.set(b);}
I get the following issue :
Error Parameters: {}
TypeError: r.map is not a function
at Function.convertToPhonographTypeV2 (FunctionsFunctionsIsolateRuntimePackagePackage:84:22866)
at t.TypeConvertingPropertyStore.convertToPhonographType (FunctionsFunctionsIsolateRuntimePackagePackage:371:6237)
at t.TypeConvertingPropertyStore.set (FunctionsFunctionsIsolateRuntimePackagePackage:371:5997)
at t.DefaultObjectStorageProvider.setPropertyValue (FunctionsFunctionsIsolateRuntimePackagePackage:100:35623)
at t.DefaultObjectStorageProvider.addSingleKeyLink (FunctionsFunctionsIsolateRuntimePackagePackage:100:38897)
at t.DefaultObjectStorageProvider.setSingleKeyLink (FunctionsFunctionsIsolateRuntimePackagePackage:100:38627)
at Object.set (FunctionsFunctionsIsolateRuntimePackagePackage:100:37746)
at Object.set (FunctionsFunctionsIsolateRuntimePackagePackage:331:10356)
at Object.set (FunctionsFunctionsIsolateRuntimePackagePackage:334:1414)
at Object.set (FunctionsFunctionsIsolateRuntimePackagePackage:334:4108)
I try to link those to object, the linkType already exist, but I cannot asign those two objects.
I checked my Writeback dataset and I find the problem. These link A to B is defined as a One to One link in the Ontology. But in the writeback, multiple A or link to a B and multible B are link to a A. So it completely broke the code and make it unusable. To fix the bug we need to change the Ontology.