Ejemplo n.º 1
0
        private void Initialize(WorkflowHost host, string templateData)
        {
            _log   = ClassLogger.Create(GetType());
            _dblog = DebugOnlyLogger.Create(_log);

            _host = host;


            _workspaceContainerName = WorkflowShared.WorkflowInstanceWorkspaceName(Id);

            Workspace = Catalog.Preconfigure()
                        .Add(WorkspaceLocalConfig.WorkspaceName, _workspaceContainerName)
                        .ConfiguredResolve <IWorkspace>(_workflowWorkspaceKey);


            if (null == _wfLock)
            {
                _wfLock = ConstructLock(Id);
            }



            SpecifyUsingTemplate(templateData);

            var instance = new WorkflowInstanceInfo
            {
                Id                 = Id,
                TemplateName       = Name,
                LastActivity       = DateTime.UtcNow,
                NextActivationTime = DateTime.UtcNow,
                Status             = WorkflowStatus.Active.ToString(),
            };

            _instanceData.Store(instance);
        }
Ejemplo n.º 2
0
        public void ChangeState(string st)
        {
            _cachedState = st;
            var update = new WorkflowMachineState
            {
                Id               = _cachedId,
                Parent           = _persistenceContext,
                StateMachine     = _machineContext,
                State            = _cachedState,
                LastStateChanged = DateTime.UtcNow
            };

            _machineStateData.Store(update);
        }
Ejemplo n.º 3
0
        private void InternalFireOnHostedWorkflow(string agentId, WorkflowTrigger fire)
        {
            _triggers.Store(fire);



            if (_agents.ContainsKey(agentId))
            {
                _agents[agentId].Bump();
            }
            else
            {
                _log.WarnFormat(
                    "Attempt to fire on hosted workflow {0} that isn't hosted here, redirecting to broadcast.", agentId);

                _broadcaster.Send(fire, "_");
            }
        }
Ejemplo n.º 4
0
 public virtual void PostStore(TDataType document)
 {
     _dataRepository.Store(document);
 }