Example #1
0
        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);
            }
        }
Example #2
0
        public ElseIfNode(DocumentIdNode documentIdNode, IElseIf elseIf)
        {
            Infra.NotNull(elseIf.Condition);

            documentIdNode.SaveToSlot(out _documentIdSlot);
            _elseIf = elseIf;
        }
Example #3
0
        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);
            }
        }
Example #4
0
        public ParamNode(DocumentIdNode documentIdNode, IParam param)
        {
            Infra.NotNull(param.Name);

            documentIdNode.SaveToSlot(out _documentIdSlot);
            _param = param;
        }
Example #5
0
 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 !;
Example #6
0
        public InitialNode(DocumentIdNode documentIdNode, IInitial initial) : base(documentIdNode, children: null)
        {
            Infra.NotNull(initial.Transition);

            _initial   = initial;
            Transition = initial.Transition.As <TransitionNode>();

            Transition.SetSource(this);
        }
Example #7
0
        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>();
        }
Example #8
0
        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>();
        }
Example #9
0
        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);
        }
Example #10
0
        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>();
        }
Example #11
0
        protected StateEntityNode(DocumentIdNode documentIdNode, IEnumerable <StateEntityNode>?children)
        {
            documentIdNode.SaveToSlot(out _documentIdSlot);

            if (children is not null)
            {
                foreach (var stateEntity in children)
                {
                    stateEntity.Parent = this;
                }
            }
        }
Example #12
0
        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;
        }
Example #13
0
 public ElseNode(DocumentIdNode documentIdNode, IElse @else)
 {
     documentIdNode.SaveToSlot(out _documentIdSlot);
     _else = @else;
 }
Example #14
0
 public LogNode(DocumentIdNode documentIdNode, ILog log) : base(documentIdNode, log) => _log = log;
Example #15
0
 protected ExecutableEntityNode(DocumentIdNode documentIdNode, IExecutableEntity entity)
 {
     _execEvaluator = entity.As <IExecEvaluator>();
     documentIdNode.SaveToSlot(out _documentIdSlot);
 }
Example #16
0
 public ScriptNode(DocumentIdNode documentIdNode, IScript script) : base(documentIdNode, script) => _script = script;
Example #17
0
 public OnEntryNode(DocumentIdNode documentIdNode, IOnEntry onEntry)
 {
     _onEntry = onEntry;
     documentIdNode.SaveToSlot(out _documentIdSlot);
     ActionEvaluators = onEntry.Action.AsArrayOf <IExecutableEntity, IExecEvaluator>();
 }
Example #18
0
 public TransitionNode(DocumentIdNode documentIdNode, ImmutableArray <StateEntityNode> target = default) : this(documentIdNode, EmptyTransition, target)
 {
 }
Example #19
0
 public OnExitNode(DocumentIdNode documentIdNode, IOnExit onExit)
 {
     _onExit = onExit;
     documentIdNode.SaveToSlot(out _documentIdSlot);
     ActionEvaluators = onExit.Action.AsArrayOf <IExecutableEntity, IExecEvaluator>();
 }
Example #20
0
 public RuntimeExecNode(DocumentIdNode documentIdNode, IExecutableEntity entity)
 {
     _entity = entity;
     documentIdNode.SaveToSlot(out _documentIdSlot);
 }
Example #21
0
 public CompoundNode(DocumentIdNode documentIdNode, IState state) : base(documentIdNode, state)
 {
     Infra.NotNull(base.Initial);
 }
Example #22
0
        public CustomActionNode(DocumentIdNode documentIdNode, ICustomAction customAction) : base(documentIdNode, customAction)
        {
            Infra.NotNull(customAction.Xml);

            _customAction = customAction;
        }
Example #23
0
        public InitialNode(DocumentIdNode documentIdNode, TransitionNode transition) : base(documentIdNode, children: null)
        {
            Transition = transition ?? throw new ArgumentNullException(nameof(transition));

            Transition.SetSource(this);
        }
Example #24
0
 public IfNode(DocumentIdNode documentIdNode, IIf @if) : base(documentIdNode, @if) => _if = @if;
Example #25
0
 public DataModelNode(DocumentIdNode documentIdNode, IDataModel dataModel)
 {
     documentIdNode.SaveToSlot(out _documentIdSlot);
     _dataModel = dataModel;
     Data       = dataModel.Data.AsArrayOf <IData, DataNode>(true);
 }
Example #26
0
 public CancelNode(DocumentIdNode documentIdNode, ICancel cancel) : base(documentIdNode, cancel) => _cancel = cancel;
Example #27
0
 public ForEachNode(DocumentIdNode documentIdNode, IForEach forEach) : base(documentIdNode, forEach) => _forEach = forEach;
Example #28
0
 public SendNode(DocumentIdNode documentIdNode, ISend send) : base(documentIdNode, send) => _send = send;
Example #29
0
		public RaiseNode(DocumentIdNode documentIdNode, IRaise raise) : base(documentIdNode, raise) => _raise = raise;
Example #30
0
 public AssignNode(DocumentIdNode documentIdNode, IAssign assign) : base(documentIdNode, assign) => _assign = assign;