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

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

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

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

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