public StateNode(DocumentIdNode documentIdNode, IState state) : base(documentIdNode, GetChildNodes(state.Initial, state.States, state.HistoryStates)) { _state = state; var id = state.Id ?? new IdentifierNode(Identifier.New()); var transitions = state.Transitions.AsArrayOf <ITransition, TransitionNode>(true); var invokeList = state.Invoke.AsArrayOf <IInvoke, InvokeNode>(true); Id = id; States = state.States.AsArrayOf <IStateEntity, StateEntityNode>(); HistoryStates = state.HistoryStates.AsArrayOf <IHistory, HistoryNode>(true); Transitions = transitions; OnEntry = state.OnEntry.AsArrayOf <IOnEntry, OnEntryNode>(true); OnExit = state.OnExit.AsArrayOf <IOnExit, OnExitNode>(true); Invoke = invokeList; Initial = state.Initial?.As <InitialNode>(); DataModel = state.DataModel?.As <DataModelNode>(); foreach (var transition in transitions) { transition.SetSource(this); } foreach (var invoke in invokeList) { invoke.SetStateId(id); } }
public ElseIfNode(DocumentIdNode documentIdNode, IElseIf elseIf) { Infra.NotNull(elseIf.Condition); documentIdNode.SaveToSlot(out _documentIdSlot); _elseIf = elseIf; }
public ParallelNode(DocumentIdNode documentIdNode, IParallel parallel) : base(documentIdNode, GetChildNodes(initial: null, parallel.States, parallel.HistoryStates)) { _parallel = parallel; var id = parallel.Id ?? new IdentifierNode(Identifier.New()); var transitions = parallel.Transitions.AsArrayOf <ITransition, TransitionNode>(true); var invokeList = parallel.Invoke.AsArrayOf <IInvoke, InvokeNode>(true); Id = id; States = parallel.States.AsArrayOf <IStateEntity, StateEntityNode>(); HistoryStates = parallel.HistoryStates.AsArrayOf <IHistory, HistoryNode>(true); Transitions = transitions; OnEntry = parallel.OnEntry.AsArrayOf <IOnEntry, OnEntryNode>(true); OnExit = parallel.OnExit.AsArrayOf <IOnExit, OnExitNode>(true); Invoke = invokeList; DataModel = parallel.DataModel?.As <DataModelNode>(); foreach (var transition in transitions) { transition.SetSource(this); } foreach (var invoke in invokeList) { invoke.SetStateId(id); } }
public ParamNode(DocumentIdNode documentIdNode, IParam param) { Infra.NotNull(param.Name); documentIdNode.SaveToSlot(out _documentIdSlot); _param = param; }
public TransitionNode(DocumentIdNode documentIdNode, ITransition transition, ImmutableArray <StateEntityNode> target = default) { _transition = transition; documentIdNode.SaveToSlot(out _documentIdSlot); TargetState = target; ActionEvaluators = transition.Action.AsArrayOf <IExecutableEntity, IExecEvaluator>(true); ConditionEvaluator = transition.Condition?.As <IBooleanEvaluator>(); Source = default !;
public InitialNode(DocumentIdNode documentIdNode, IInitial initial) : base(documentIdNode, children: null) { Infra.NotNull(initial.Transition); _initial = initial; Transition = initial.Transition.As <TransitionNode>(); Transition.SetSource(this); }
public FinalNode(DocumentIdNode documentIdNode, IFinal final) : base(documentIdNode, children: null) { _final = final; Id = final.Id ?? new IdentifierNode(Identifier.New()); OnEntry = final.OnEntry.AsArrayOf <IOnEntry, OnEntryNode>(true); OnExit = final.OnExit.AsArrayOf <IOnExit, OnExitNode>(true); DoneData = final.DoneData?.As <DoneDataNode>(); }
public StateMachineNode(DocumentIdNode documentIdNode, IStateMachine stateMachine) : base(documentIdNode, GetChildNodes(stateMachine.Initial, stateMachine.States)) { _stateMachine = stateMachine; Infra.NotNull(stateMachine.Initial); Initial = stateMachine.Initial.As <InitialNode>(); ScriptEvaluator = _stateMachine.Script?.As <ScriptNode>(); DataModel = _stateMachine.DataModel?.As <DataModelNode>(); }
public HistoryNode(DocumentIdNode documentIdNode, IHistory history) : base(documentIdNode, children: null) { Infra.NotNull(history.Transition); _history = history; Id = history.Id ?? new IdentifierNode(Identifier.New()); Transition = history.Transition.As <TransitionNode>(); Transition.SetSource(this); }
public DataNode(DocumentIdNode documentIdNode, IData data) { Infra.NotNull(data.Id); documentIdNode.SaveToSlot(out _documentIdSlot); _data = data; ResourceEvaluator = data.Source?.As <IResourceEvaluator>(); ExpressionEvaluator = data.Expression?.As <IObjectEvaluator>(); InlineContentEvaluator = data.InlineContent?.As <IObjectEvaluator>(); }
protected StateEntityNode(DocumentIdNode documentIdNode, IEnumerable <StateEntityNode>?children) { documentIdNode.SaveToSlot(out _documentIdSlot); if (children is not null) { foreach (var stateEntity in children) { stateEntity.Parent = this; } } }
public InvokeNode(DocumentIdNode documentIdNode, IInvoke invoke) { documentIdNode.SaveToSlot(out _documentIdSlot); _invoke = invoke; Finalize = invoke.Finalize?.As <FinalizeNode>(); var startInvokeEvaluator = invoke.As <IStartInvokeEvaluator>(); Infra.NotNull(startInvokeEvaluator); _startInvokeEvaluator = startInvokeEvaluator; var cancelInvokeEvaluator = invoke.As <ICancelInvokeEvaluator>(); Infra.NotNull(cancelInvokeEvaluator); _cancelInvokeEvaluator = cancelInvokeEvaluator; }
public ElseNode(DocumentIdNode documentIdNode, IElse @else) { documentIdNode.SaveToSlot(out _documentIdSlot); _else = @else; }
public LogNode(DocumentIdNode documentIdNode, ILog log) : base(documentIdNode, log) => _log = log;
protected ExecutableEntityNode(DocumentIdNode documentIdNode, IExecutableEntity entity) { _execEvaluator = entity.As <IExecEvaluator>(); documentIdNode.SaveToSlot(out _documentIdSlot); }
public ScriptNode(DocumentIdNode documentIdNode, IScript script) : base(documentIdNode, script) => _script = script;
public OnEntryNode(DocumentIdNode documentIdNode, IOnEntry onEntry) { _onEntry = onEntry; documentIdNode.SaveToSlot(out _documentIdSlot); ActionEvaluators = onEntry.Action.AsArrayOf <IExecutableEntity, IExecEvaluator>(); }
public TransitionNode(DocumentIdNode documentIdNode, ImmutableArray <StateEntityNode> target = default) : this(documentIdNode, EmptyTransition, target) { }
public OnExitNode(DocumentIdNode documentIdNode, IOnExit onExit) { _onExit = onExit; documentIdNode.SaveToSlot(out _documentIdSlot); ActionEvaluators = onExit.Action.AsArrayOf <IExecutableEntity, IExecEvaluator>(); }
public RuntimeExecNode(DocumentIdNode documentIdNode, IExecutableEntity entity) { _entity = entity; documentIdNode.SaveToSlot(out _documentIdSlot); }
public CompoundNode(DocumentIdNode documentIdNode, IState state) : base(documentIdNode, state) { Infra.NotNull(base.Initial); }
public CustomActionNode(DocumentIdNode documentIdNode, ICustomAction customAction) : base(documentIdNode, customAction) { Infra.NotNull(customAction.Xml); _customAction = customAction; }
public InitialNode(DocumentIdNode documentIdNode, TransitionNode transition) : base(documentIdNode, children: null) { Transition = transition ?? throw new ArgumentNullException(nameof(transition)); Transition.SetSource(this); }
public IfNode(DocumentIdNode documentIdNode, IIf @if) : base(documentIdNode, @if) => _if = @if;
public DataModelNode(DocumentIdNode documentIdNode, IDataModel dataModel) { documentIdNode.SaveToSlot(out _documentIdSlot); _dataModel = dataModel; Data = dataModel.Data.AsArrayOf <IData, DataNode>(true); }
public CancelNode(DocumentIdNode documentIdNode, ICancel cancel) : base(documentIdNode, cancel) => _cancel = cancel;
public ForEachNode(DocumentIdNode documentIdNode, IForEach forEach) : base(documentIdNode, forEach) => _forEach = forEach;
public SendNode(DocumentIdNode documentIdNode, ISend send) : base(documentIdNode, send) => _send = send;
public RaiseNode(DocumentIdNode documentIdNode, IRaise raise) : base(documentIdNode, raise) => _raise = raise;
public AssignNode(DocumentIdNode documentIdNode, IAssign assign) : base(documentIdNode, assign) => _assign = assign;