{"record":{"id":"fe5db251ac964c10","repo":"BabylonJS/Babylon.js","slug":"multigate-should-have-a-single-configuration-objec","errorCode":null,"errorMessage":"MultiGate should have a single configuration object, the number of output flows","messagePattern":"MultiGate should have a single configuration object, the number of output flows","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.ts","lineNumber":1192,"sourceCode":"            values: {\n                n: { name: \"maxExecutions\", gltfType: \"number\" },\n            },\n        },\n        outputs: {\n            values: {\n                currentCount: { name: \"executionCount\" },\n            },\n        },\n    },\n    \"flow/multiGate\": {\n        blocks: [FlowGraphBlockNames.MultiGate],\n        configuration: {\n            isRandom: { name: \"isRandom\", gltfType: \"boolean\", inOptions: true, defaultValue: false },\n            isLoop: { name: \"isLoop\", gltfType: \"boolean\", inOptions: true, defaultValue: false },\n        },\n        extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {\n            if (declaration.op !== \"flow/multiGate\" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {\n                throw new Error(\"MultiGate should have a single configuration object, the number of output flows\");\n            }\n            const serializedObject = serializedObjects[0];\n            serializedObject.config ||= {};\n            serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows).length;\n            serializedObject.signalOutputs.forEach((output, index) => {\n                output.name = \"out_\" + index;\n            });\n            return serializedObjects;\n        },\n    },\n    \"flow/waitAll\": {\n        blocks: [FlowGraphBlockNames.WaitAll],\n        configuration: {\n            inputFlows: { name: \"inputSignalCount\", gltfType: \"number\", inOptions: true, defaultValue: 0 },\n        },\n        inputs: {\n            flows: {\n                reset: { name: \"reset\" },","sourceCodeStart":1174,"sourceCodeEnd":1210,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.ts#L1174-L1210","documentation":"The flow/multiGate extraProcessor derives the MultiGate block's outputSignalCount from the number of keys in gltfBlock.flows. It throws when the op is not flow/multiGate or flows is absent/empty, since a MultiGate with zero output flows is meaningless.","triggerScenarios":"An interactivity graph with a multiGate block lacking its out_X flow declarations, or a mis-mapped block routed to this processor with a different op.","commonSituations":"Exporter failing to write output flows for multiGate; manual JSON edits; schema drift between exporter drafts where outputs lived in configuration instead of flows.","solutions":["Declare the multiGate output flows, e.g. \"flows\": { \"out_0\": {}, \"out_1\": {} }","Re-export the asset with an updated exporter","Correct custom declaration mappings so only flow/multiGate blocks use this processor"],"exampleFix":"// before\n{ \"op\": \"flow/multiGate\", \"configuration\": { \"isRandom\": { \"value\": [true] } } }\n// after\n{ \"op\": \"flow/multiGate\", \"configuration\": { \"isRandom\": { \"value\": [true] } }, \"flows\": { \"out_0\": {}, \"out_1\": {} } }","handlingStrategy":"validation","validationCode":"function validateMultiGateBlock(block) {\n  return typeof block.flows === \"object\" && block.flows !== null && Object.keys(block.flows).length > 0;\n}\n// verify multiGate blocks declare their output flows before loading","typeGuard":"const hasFlows = (b: { flows?: Record<string, unknown> | null }): b is { flows: Record<string, unknown> } => !!b.flows && Object.keys(b.flows).length > 0;","tryCatchPattern":"try {\n  await loader.loadAsync(url);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"MultiGate should have a single configuration\")) {\n    console.error(\"flow/multiGate block has no output flows declared.\");\n  } else throw e;\n}","preventionTips":["Always emit out_N flows for multiGate blocks in your exporter","Schema-check interactivity JSON before runtime loading","Re-export assets when switching exporter versions"],"tags":["gltf","interactivity","flow-graph","validation"],"backgroundTag":"gltf-interactivity-invalid-configuration","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}