7.0.0-dev.119
Instruction Composition Framework Functions
Background
The CDM Smart Contract Taskforce is introducing the Instruction Composition Model within the Common Domain Model (CDM). While the CDM has traditionally been declarative, defining what a lifecycle event is, it has not always defined how that event is operationally executed. This gap often forces institutions to implement their own procedural logic externally, increasing reconciliation risks and inconsistent interpretations. This release bridges that gap by establishing a modular, stateful, and deterministic framework to execute the sequential steps and intermediate computations of contractual workflows directly within the model. For further information, see issue #4165.
What is being released?
This release builds upon the foundational structures of the Instruction Composition Framework within the cdm.event.instructioncomposition namespace by introducing core operational functions, conditional validation constraints, and routing choices to support the state-machine execution logic. For further information, see issue #4593
Functions
Changes that can be found in the cdm.event.instructionComposition namespace:
Create_InstructionComposition: The primary state-transition engine. Appends a new CompositionStep (stamping Now()), triggers the cumulative history state update, and controls structural inheritance (such as tradeId and instructionCompositionIdentifier) across step executionsAddStepToCompositionState: Evaluates the incoming step instruction type and dynamically routes it to update the corresponding state object choice (e.g., directing reset workflows to UpdateResetCompositionState)UpdateResetCompositionState: Performs the field-by-field cumulative update overlay logic specifically for the Interest Rate Reset stateNextCompositionStepToExecute: Evaluates the total execution timeline to determine what next phase must be targeted by the engineResetInstructionNextStep: Serves as a targeted state-machine evaluator specifically for the 8-step Interest Rate Reset lifecycle by analyzing present and missing data points
Types and Choices
Changes that can be found in the cdm.event.instructioncomposition namespace:
InstructionComposition(Updated): Includes a new structural condition CompositionStateByType, which verifies that if instructionCompositionType = ResetInstruction, then compositionState -> ResetInstructionState must existCompositionState(Updated): Modified to include ResetInstructionState as an active element of the choice routing containerInstructionCompositionSteps: A top-level routing object utilized by the engine to identify and flag the active process-specific instruction sets
Changes that can be found in the cdm.event.instructioncomposition.reset namespace:
ResetInstructionStateThe state accumulator for the reset lifecycle. Acts as the functional "Golden Record" that aggregates variables compiled across the workflow steps to enable deterministic process replaysResetInstructionSteps: A dedicated process wrapper encapsulating the underlying execution phases (ResetInstructionInstructionCompositionStepsEnum), mapping directly back to the top-level routing choices
Review Directions
Navigate to the following paths to inspect the new models:
- rosetta-source/src/main/rosetta/instructionComposition-type.rosetta to review the primary cdm.event.instructioncomposition structures, including the updated InstructionComposition type, conditional alignment constraints, and the CompositionState / InstructionCompositionSteps top-level routing choices
- rosetta-source/src/main/rosetta/instructionComposition-enum.rosetta to inspect the updated InstructionCompositionTypeEnum process mappings
- rosetta-source/src/main/rosetta/instructionComposition-func.rosetta to examine the core state-machine and lifecycle execution functions (including Create_InstructionComposition, AddStepToCompositionState, and the state evaluators)
- rosetta-source/src/main/rosetta/instructionComposition-reset-type.rosetta to inspect the dedicated cdm.event.instructioncomposition.reset components, including the cumulative ResetInstructionState accumulator and the ResetInstructionSteps process wrapper