in libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts [209:291]
input: createNodeConnection(func, funcKey),
});
}
return;
}
const issueType = MapIssueType.FunctionNotFound;
const error: MapIssue = {
issueType: issueType,
severity: MapCheckerItemSeverity.Warning,
reactFlowId: funcKey,
};
throw new DeserializationError(issueType, error);
}
// get function node
func = {
...getSourceNode(
functionMetadata.name,
this._sourceSchema,
functionMetadata.name.length + 1,
this._functionsMetadata,
this._createdFunctions
),
} as FunctionData;
funcKey = createReactFlowFunctionKey(func);
func.key = funcKey;
this._createdFunctions[metadataString] = funcKey;
// function to target
if (targetNode !== undefined) {
applyConnectionValue(connections, {
targetNode: targetNode,
targetNodeReactFlowKey: this.getTargetKey(targetNode),
findInputSlot: true,
input: createNodeConnection(func, funcKey),
});
// connect inputs
functionMetadata.inputs.forEach((input) => {
const srcStr = input.type !== 'Function' ? input.value : input.name;
this.handleSingleValueOrFunction(srcStr, input, func, connections);
});
}
} else if (!possibleSourceSchemaNode && functionMetadata.type !== 'Function') {
// custom value or index
this.handleSingleValue(key, targetNode, connections);
} else if (targetNode && possibleSourceSchemaNode) {
// source schema node
applyConnectionValue(connections, {
targetNode: targetNode,
targetNodeReactFlowKey: this.getTargetKey(targetNode),
findInputSlot: true,
input: createNodeConnection(possibleSourceSchemaNode, addSourceReactFlowPrefix(possibleSourceSchemaNode.key)),
});
} else {
const issueType = MapIssueType.KeyNotFound;
const error: MapIssue = {
issueType: issueType,
severity: MapCheckerItemSeverity.Warning,
reactFlowId: key,
};
throw new DeserializationError(issueType, error);
}
};
private getTargetKey = (targetNode?: SchemaNodeExtended | FunctionData) =>
targetNode ? (isFunctionData(targetNode) ? targetNode.key : addTargetReactFlowPrefix(targetNode.key)) : '';
private addLoopConnectionIfNeeded = (connections: ConnectionDictionary, targetNode: SchemaNodeExtended) => {
if (this._loop.length > 0) {
this._loop.forEach((loop) => {
if (loop.needsConnection) {
if (loop.sequence) {
loop.needsConnection = false;
this.handleSingleValueOrFunction('', loop.sequence, targetNode, connections);
}
let loopSrc: SchemaNodeExtended | FunctionData = findNodeForKey(
loop.key,
this._sourceSchema.schemaTreeRoot,
false
) as SchemaNodeExtended;
if (!loopSrc) {
const issueType = MapIssueType.LoopSourceNotFound;
const error: MapIssue = {