Esempio n. 1
0
        public bool TryLoad(string persistentState)
        {
            if (TryDeserializState(persistentState, out WorkflowContextState state))
            {
                var containerContext = new WorkflowContainerContext(state);
                Initialize(containerContext);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public void Initialize(WorkflowContainerContext context = null, IEnumerable <Tuple <string, string> > variants = null)
        {
            var variantConstarints = variants?.Select(v => new VariantConstraint(v.Item1, v.Item2)).ToList();

            if (context == null)
            {
                _pluginServices.Initialize(variants: variantConstarints);
                _containerContext = new WorkflowContainerContext
                {
                    ExecutionContext = _pluginServices.GetExecutionContext(),
                    Executed         = false,
                    Variants         = variantConstarints
                };
            }
            else
            {
                _containerContext = context;
                _pluginServices.Initialize(context.ExecutionContext, context.Variants);
            }
            _isInitialized = true;
        }