{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$anchor": "cdm.event.instructioncomposition",
  "type": "object",
  "title": "InstructionComposition",
  "description": "Represents an Instruction Composition orchestration, holding data, shared history, and an ordered sequence of CompositionSteps. Each InstructionComposition will have one or more CompositionStps.",
  "properties": {
    "compositionStep": {
      "description": "Ordered sequence of CompositionSteps that drive the Instruction Composition process (atomic actions, calculations, validations).",
      "type": "array",
      "items": {
        "$ref": "cdm-event-instructioncomposition-CompositionStep.schema.json"
      },
      "minItems": 1
    },
    "compositionState": {
      "description": "Shared state accumulated across executed steps, capturing intermediate and final outputs of the Instruction Composition process.",
      "$ref": "cdm-event-instructioncomposition-CompositionState.schema.json"
    },
    "instructionCompositionType": {
      "description": "Type of Instruction Composition being orchestrated (e.g. ResetInstruction).",
      "$ref": "cdm-event-instructioncomposition-InstructionCompositionTypeEnum.schema.json"
    },
    "identifier": {
      "description": "Unique identifier of this InstructionComposition instance.",
      "type": "string"
    },
    "tradeId": {
      "description": "Identifier of the underlying trade to which this InstructionComposition relates.",
      "$ref": "cdm-event-common-TradeIdentifier.schema.json"
    },
    "instructionCompositionOutput": {
      "description": "Outputs of each Instruction Composition process. The recording of this information will be done in a single step at the end of the process for each Instruction Composition.",
      "$ref": "cdm-event-instructioncomposition-InstructionCompositionOutput.schema.json"
    }
  },
  "required": [
    "instructionCompositionType",
    "identifier"
  ]
}
