示例#1
0
		/*----------------------------------------------------*/

		protected cDataObjectList GetEvents(ProcessType aProcessType, WorkflowEventType aWorkflowEventType)
		{
			cXMLDoc aXmlDoc;
			XmlNode aDataObjectNode, aFiltersNode, aSortNode;
			string aWfProjectTaskID = "";
			//if (aProcessType == ProcessType.PreAssignment) {
			//    cDataObject aGranteeProjectDO = this.DataObjectFactory.GetDataObjectFromPrimaryKey("GranteeProject", this.GetPropertyString("GranteeProjectID"));
			//    cDataObjectList aWfProjectTaskDOL = this.DataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectID", aGranteeProjectDO.GetPropertyString("WfProjectID"), "WfTaskID", this.GetPropertyString("WfTaskID"));
			//    if (aWfProjectTaskDOL != null && aWfProjectTaskDOL.Count > 0)
			//        aWfProjectTaskID = aWfProjectTaskDOL[0].GetPropertyString("WfProjectTaskID");
			//}
			//else {
			//    aWfProjectTaskID = this.GetWfProjectTask().GetPropertyString("WfProjectTaskID");
			//}
			cDataObject aGranteeProjectDO = this.DataObjectFactory.GetDataObjectFromPrimaryKey("GranteeProject", this.GetPropertyString("GranteeProjectID"));
			cDataObjectList aWfProjectTaskDOL = this.DataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectID", aGranteeProjectDO.GetPropertyString("WfProjectID"), "WfTaskID", this.GetPropertyString("WfTaskID"));
			if (aWfProjectTaskDOL != null && aWfProjectTaskDOL.Count > 0)
				aWfProjectTaskID = aWfProjectTaskDOL[0].GetPropertyString("WfProjectTaskID");
			
			aXmlDoc = this.DataObjectFactory.CreateDataObjectNode("WorkflowEvents", out aDataObjectNode, out aFiltersNode);
			aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "ProcessTypeID", Convert.ToString((Int32)aProcessType)));
			aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "WorkflowEventTypeID", Convert.ToString((Int32)aWorkflowEventType)));
			aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "WorkflowID", aWfProjectTaskID));
			aSortNode = aDataObjectNode.AppendChild(aXmlDoc.CreateSortNode());
			aSortNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "SortOrder", ""));
			return this.DataObjectFactory.GetDataObjectList(aDataObjectNode);
		}
 public Func <WorkflowDefinition> RaiseEvent(WorkflowEventType eventType, WorkflowDataObject workflowDataObject)
 {
     return(() =>
     {
         new WorkflowEventActionExecution().RaiseEvent(eventType, workflowDataObject);
         return this;
     });
 }
示例#3
0
 public void RaiseEvent(WorkflowEventType workflowEventType, WorkflowDataObject workflowDataObject)
 {
     if (!WorkflowEventRegistry().ContainsKey(workflowEventType))
     {
         return;
     }
     WorkflowActionManager().ExecuteChain(() =>
                                          WorkflowActionRegistry()[WorkflowEventRegistry()[workflowEventType].WorkflowEventActionConfig.WorkflowActionName]);
 }
示例#4
0
		/*----------------------------------------------------*/
		
		protected Boolean GetEventsProcessingResult(ProcessType aProcessType, WorkflowEventType aWorkflowEventType)
		{
			cDataObjectList aWorkflowEventsDOL = GetEvents(aProcessType, aWorkflowEventType);
			Boolean aProcessSuccess = true;
			string aFilterName = "";
			foreach (cDataObject aWorkflowEventsDO in aWorkflowEventsDOL) {
				cProcessingEvent aProcessingEvent;
				string aProcessDefinitionKey = aWorkflowEventsDO.GetRelatedPropertyString("EventManagerEvents.ProcessName");
				aProcessingEvent = cProcessingEvent.CreateProcessingEventInstance(aProcessDefinitionKey, this.DataObjectFactory);
				if (aProcessType == ProcessType.PreAssignment) {
					aFilterName = "GranteeProjectID";
				}
		        else {
					aFilterName = "WfTaskAssignmentID";
				}
				aProcessingEvent.ProcessEvent(aFilterName, this.GetPropertyString(aFilterName));
				if (aProcessingEvent.StatusID < 1) {
					aProcessSuccess = false;
					break;
				}
			}
			return aProcessSuccess;
		}
示例#5
0
 public HostEventArgs(WorkflowEventType eventType, Guid instanceId, string exceptionMessage)
 {
     this.EventType = eventType;
     this.InstanceId = instanceId;
     this.ExceptionMessage = exceptionMessage;
 }
示例#6
0
 public HostEventArgs(WorkflowEventType eventType, Guid instanceId)
 {
     this.EventType = eventType;
     this.InstanceId = instanceId;
 }
示例#7
0
 public bool ContainsKey(WorkflowEventType key)
 {
     return(_registry.ContainsKey(key));
 }
示例#8
0
 public WorkflowEventAction this[WorkflowEventType key] => _registry.ContainsKey(key) ? _registry[key] : null;
示例#9
0
 public static bool IsBoundaryTimer(this WorkflowEventType type) =>
 type == WorkflowEventType.BoundaryForkTimer ||
 type == WorkflowEventType.BoundaryInterruptingTimer;
示例#10
0
 public static bool IsFinish(this WorkflowEventType type) =>
 type == WorkflowEventType.Finish;
示例#11
0
 public static bool IsScheduledStart(this WorkflowEventType type) =>
 type == WorkflowEventType.ScheduledStart;
示例#12
0
 public HostEventArgs(WorkflowEventType eventType, Guid instanceId, string exceptionMessage)
 {
     this.EventType        = eventType;
     this.InstanceId       = instanceId;
     this.ExceptionMessage = exceptionMessage;
 }
示例#13
0
 public HostEventArgs(WorkflowEventType eventType, Guid instanceId)
 {
     this.EventType  = eventType;
     this.InstanceId = instanceId;
 }
示例#14
0
 public static bool IsTimerStart(this WorkflowEventType type) =>
 type == WorkflowEventType.TimerStart;
 public WorkflowListenerAction(Func <WorkflowActionBaseConfig> workflowActionConfiguration, WorkflowEventType workflowEventType) :
     base(workflowActionConfiguration)
 {
     WorkflowEventType = workflowEventType;
 }