Ejemplo n.º 1
0
        public static LogicLayerPersistentObject CreateWorkflowForPersistentObjecttemp(LogicLayerPersistentObject persistentObject)
        {
            string currentStateName = persistentObject.CurrentActivity.CurrentStateName;
			//string workflowInstanceId = WorkflowEngine.Engine.CreateWorkflow(persistentObject, ref currentStateName);
            int workflowVersionNumber = 0;
            string workflowInstanceId = WorkflowEngine.Engine.CreateWorkflow(persistentObject, ref currentStateName, out workflowVersionNumber);
            persistentObject.CurrentActivity.WorkflowInstanceID = workflowInstanceId;
            return persistentObject;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a persistent object and a workflow instance.
        /// </summary>
        /// <returns></returns>
        public static LogicLayerPersistentObject CreateWorkflowForPersistentObject(LogicLayerPersistentObject persistentObject)
        {
            string currentStateName = "-";
			//string workflowInstanceId = WorkflowEngine.Engine.CreateWorkflow(persistentObject, ref currentStateName);
            int workflowVersionNumber = 0;
            string workflowInstanceId = WorkflowEngine.Engine.CreateWorkflow(persistentObject, ref currentStateName, out workflowVersionNumber);

            if (persistentObject.CurrentActivity == null)
            {
                persistentObject.CurrentActivity = TablesLogic.tActivity.Create();
                persistentObject.CurrentActivity.ObjectTypeName = persistentObject.GetType().BaseType.Name;
                persistentObject.CurrentActivity.ObjectName = currentStateName;
                persistentObject.CurrentActivity.WorkflowVersionNumber = workflowVersionNumber;
            }
            persistentObject.CurrentActivity.WorkflowInstanceID = workflowInstanceId;
            return persistentObject;
        }