af analysis
af-analysis-filter
AF Analysis Filter
This node compares arrays of AF Analyses between a source and target structure, identifying differences, additions, and deletions.
Inputs
msg.payload.source: An object containing the source element and its Analyses array.
msg.payload.target: An object containing the target element and its Analyses array.
msg.payload.source.ElementPath: The full path of the source element (used for context).
msg.payload.target.ElementPath: The full path of the target element (used for context).
Outputs
Output 1 (Delete): Analyses present in the target but missing from the source. Output 2 (Create): Analyses present in the source but missing from the target. Output 3 (Sync): Analyses present in both but with configuration differences.
Output Message Format
Each output message is a clone of the input msg with:
msg.payload: An array of analysis comparison results.
msg.topic: One of "delete", "create", or "sync" to indicate the type of change.
Notes
Designed for performance with arrays of up to ~100 analyses. All outputs retain the original message context for downstream processing.
Example Payload
[
{
"id": "inject1",
"type": "inject",
"name": "Test Analysis Comparison",
"props": [{"p": "payload"}],
"payload": {
"source": {
"ElementPath": "\\\\AFServer\\Database\\ElementA",
"Analyses": [{
"Name": "Analysis1",
"Description": "Source description",
"AnalysisRule": "RuleA",
"ConfigString": "ConfigA",
"ExtendedProperties": ["Prop1"],
"Categories": ["Cat1"],
"VariableMappings": [["Var1", "Tag1"]],
"ChildRules": []
}]
},
"target": {
"ElementPath": "\\\\AFServer\\Database\\ElementB",
"Analyses": [{
"Name": "Analysis1",
"Description": "Target description",
"AnalysisRule": "RuleA",
"ConfigString": "ConfigA",
"ExtendedProperties": ["Prop1"],
"Categories": ["Cat1"],
"VariableMappings": [["Var1", "Tag1"]],
"ChildRules": []
}]
}
},
"payloadType": "json",
"x": 150,
"y": 100,
"wires": [["afAnalysisFilter"]]
},
{
"id": "afAnalysisFilter",
"type": "AF Analysis Filter",
"name": "AF Analysis Filter",
"x": 400,
"y": 100,
"wires": [["debugDelete"], ["debugCreate"], ["debugSync"]]
},
{
"id": "debugDelete",
"type": "debug",
"name": "Delete Output",
"active": true,
"console": "false",
"complete": "true",
"x": 650,
"y": 60,
"wires": []
},
{
"id": "debugCreate",
"type": "debug",
"name": "Create Output",
"active": true,
"console": "false",
"complete": "true",
"x": 650,
"y": 100,
"wires": []
},
{
"id": "debugSync",
"type": "debug",
"name": "Sync Output",
"active": true,
"console": "false",
"complete": "true",
"x": 650,
"y": 140,
"wires": []
}
]
{
"payload": {
"source": {
"ElementPath": "\\\\AFServer\\Database\\ElementA",
"Analyses": [
{
"Name": "Analysis1",
"Description": "Source description",
"AnalysisRule": "RuleA",
"ConfigString": "ConfigA",
"ExtendedProperties": ["Prop1"],
"Categories": ["Cat1"],
"VariableMappings": [["Var1", "Tag1"]],
"ChildRules": []
}
]
},
"target": {
"ElementPath": "\\\\AFServer\\Database\\ElementB",
"Analyses": [
{
"Name": "Analysis1",
"Description": "Target description",
"AnalysisRule": "RuleA",
"ConfigString": "ConfigA",
"ExtendedProperties": ["Prop1"],
"Categories": ["Cat1"],
"VariableMappings": [["Var1", "Tag1"]],
"ChildRules": []
}
]
}
}
}
Example Flow To test this node:
Open Node-RED. Click the menu (☰) → Import → Clipboard. Paste the flow below and click Import.
Expected Output: The Sync output will show a difference in the Description field. Create and Delete outputs will be empty.