public DataTable ReadData(WorkflowDataObject workflowDataObject)
 {
     return(WorkflowSqlConnection().ExecuteDataTable(
                workflowDataObject.WorkflowObjectType.ObjectTypeName,
                workflowDataObject.FieldValues.ToFieldDictionary(),
                workflowDataObject.PrimaryKeyField,
                workflowDataObject.PrimaryKeyValue));
 }
Exemple #2
0
 public void RaiseEvent(WorkflowEventType workflowEventType, WorkflowDataObject workflowDataObject)
 {
     if (!WorkflowEventRegistry().ContainsKey(workflowEventType))
     {
         return;
     }
     WorkflowActionManager().ExecuteChain(() =>
                                          WorkflowActionRegistry()[WorkflowEventRegistry()[workflowEventType].WorkflowEventActionConfig.WorkflowActionName]);
 }
 public WorkflowDatabaseEngine UpdateData(WorkflowDataObject workflowDataObject)
 {
     WorkflowSqlConnection().ExecuteUpdateCommand(
         workflowDataObject.WorkflowObjectType.ObjectTypeName,
         workflowDataObject.FieldValues.ToFieldDictionary(),
         workflowDataObject.PrimaryKeyField,
         workflowDataObject.PrimaryKeyValue);
     return(this);
 }
        public Func <WorkflowConfiguration, WorkflowDefinition> IntializeWorkflow(WorkflowDataObject workflowDataObject)
        {
            return((workflowConfig) => new WorkflowDefinition(workflowConfig)
                   .RegisterTypes()
                   .BuildActionManager()
                   .RegisterListeners()
                   .RaiseEvent(WorkflowEventType.Start, workflowDataObject)());

            //Check for errors
            //Should write to the logs

            //What ways can a workflow transition / execute.... We know rules can execute... Timers can execute, inbound listeners can execute..
            //Workflow is executed on a per object bassis, so we will always be starting a workflow based on an inboud object...
            //That inbound object must be defined..  Has properties and methods.

            // A workflow is a dicodomy of the states of an object along with the history of actions and the
            //series of events that can be executed because, on behalf or as a result of.  A workflow is also based on the world around an object.
            //It can also spawn objects with workflows, so a workflow object as its basis is that thing that has the workflow applied
        }
Exemple #5
0
        public virtual void Dispose()
        {
            foreach (var(key, process) in MemoryProcesses)
            {
                process.Dispose();
            }

            MemoryProcesses.Clear();
            var content = WorkflowDataObject.GetContent();

            foreach (var c in content)
            {
                if (c.Value is IDisposable disposable)
                {
                    disposable.Dispose();
                }
            }

            if (WorkflowDataObject is IDisposable d)
            {
                d.Dispose();
            }
        }
 public void ExecuteWorkflow(WorkflowDefinition definition, WorkflowDataObject workflowDataObject)
 {
     workflowDataObject.CurrentWorkflowState.ExecuteState();
 }
 public void DeleteData(WorkflowDataObject workflowDataObject)
 {
     WorkflowSqlConnection()
     .ExeuteDeleteCommand(workflowDataObject.WorkflowObjectType.ObjectTypeName, workflowDataObject.PrimaryKeyField,
                          workflowDataObject.PrimaryKeyValue);
 }
 public WorkflowDatabaseEngine InsertData(WorkflowDataObject workflowDataObject)
 {
     WorkflowSqlConnection().ExecuteInsertCommand(workflowDataObject.WorkflowObjectType.ObjectTypeName,
                                                  workflowDataObject.FieldValues.ToFieldDictionary());
     return(this);
 }