public static KeyValue[] GetReleasedProcDefs()
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            KeyValue[] defs = svc.GetReleasedProcDefs();
            return(defs);
        }
Exemplo n.º 2
0
        public static WFEvent StartProcInst(string piID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            WFEvent            evt = svc.StartProcInst(piID);

            return(evt);
        }
Exemplo n.º 3
0
        public static WFEvent CreateLinkedWorkItem(string sourceWorkItemID, string workToPerform,
                                                   string userID, WFTimeDuration duration, string clientData)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            // get existing work item
            string  workItemID = sourceWorkItemID;// for example,"90CF843AC57644058A391FBFA030F607"
            WFEvent evt        = null;

            try
            {
                // Get the source WFManualWorkItem object
                //WFManualWorkItem sourceWorkItem = svc.GetWorkItem(workItemID);
                //string workToPerform = sourceWorkItem.Name; //different workToPerform can be used if desired
                //WFTimeDuration duration = new WFTimeDuration();
                //duration.Length = "15"; //for example, 15 days
                //duration.Unit = WFTimeUnit.DAY;
                //string user = @"[DOMAIN NAME]\username"; //the participant of the linked work item
                evt = svc.CreateLinkedWorkItem(workItemID, workToPerform, userID, duration, clientData);
            }

            catch (Exception ex)
            {
            }
            return(evt);
        }
        public static string GetBaseProcDefID(string pName)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             processDefinitionName   = pName;
            string             baseProcessDefinitionID = svc.GetBaseProcDefID(processDefinitionName);

            return(baseProcessDefinitionID);
        }
Exemplo n.º 5
0
        public static void DeleteProcDef(string pID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            string processTemplateID = pID;// The unique identifier of the process definition to be deleted

            svc.DeleteProcDef(processTemplateID);
        }
        public static NameValue[] GetProcInstAttrs(String piID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            string processInstanceID = piID;// process instance ID

            NameValue[] attributes = svc.GetProcInstAttrs(processInstanceID);
            return(attributes);
        }
Exemplo n.º 7
0
        public static void UpdateProcInst(string processInstanceID, NameValue[] attributes)
        {
            //IWFWorkflowService svc = Common.GetWorkFlowAPI();
            //string processInstanceID = PIID; // process instance ID
            //string newProccessInstanceName = "[new process instance name]";
            //DateTime newDueDate = DateTime.Now.AddDays(7.0);

            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            svc.UpdateProcInst(processInstanceID, attributes);
        }
        public static void RemoveCustomAttr(string customID, string attributeName)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.RemoveCustomAttr(customID, attributeName);
            }

            catch (Exception ex)
            { }
        }
Exemplo n.º 9
0
        public static void SetCustomAttrs(string customID, NameValue[] nameValues)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.SetCustomAttrs(customID, nameValues);
            }

            catch (Exception ex)
            { }
        }
        public static void ResendMailDeliverable(string mID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             emailNotificationID = mID;// for example, "1e3d514d43d3465cae6ec3bbbd409168";

            try
            {
                svc.ResendMailDeliverable(emailNotificationID);
            }
            catch (Exception ex)
            { }
        }
Exemplo n.º 11
0
        public static void SetCustomAttr(String customID, String name, object val)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.SetCustomAttr(customID, name, val);
            }

            catch (Exception ex)
            { }
        }
Exemplo n.º 12
0
        private String GetProcInstName(String piID)
        {
            String                name = "";
            IWFWorkflowService    api  = WFFactory.GetWF(WFType.AgilePoint).GetAPI();
            WFBaseProcessInstance pi   = api.GetProcInst(piID);

            if (pi != null)
            {
                name = string.Format("{0},{1}", pi.ProcInstName, pi.Status);
            }
            return(name);
        }
Exemplo n.º 13
0
        public static void SendMailEx(String from, String to, String cc, String subject, String body, String attachments, Enum priority)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.SendMailEx(from, to, cc, subject, body, attachments);
            }

            catch (Exception ex)
            {
            }
        }
        public static WFEvent ReassignWorkItem(string wID, string userID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            WFEvent            evt = null;

            try
            {
                evt = svc.ReassignWorkItem(wID, userID);
            }
            catch (Exception ex)
            { }
            return(evt);
        }
Exemplo n.º 15
0
        public static void MigrateProcInst(WFProcessMigrationInstruction instruction,
                                           string processInstanceID, string reserved)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.MigrateProcInst(instruction, processInstanceID, reserved);
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 16
0
        public static void SendMail(String to, String cc, String subject, String body)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            try
            {
                svc.SendMail(to, cc, subject, body);
            }

            catch (Exception ex)
            {
            }
        }
        public static WFEvent RollbackActivityInst(string activityInstanceID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            WFEvent            evt = null;

            try
            {
                evt = svc.RollbackActivityInst(activityInstanceID);
            }
            catch (Exception ex)
            {
            }
            return(evt);
        }
        public static void UnCheckOutProcDef(string pID)
        {
            try
            {
                IWFWorkflowService svc = Common.GetWorkFlowAPI();
                string             processTemplateID = pID;
                svc.UncheckoutProcDef(processTemplateID);
            }

            catch (Exception ex)
            {
                Console.WriteLine("Message:\n" + ShUtil.GetSoapMessage(ex));
            }
        }
        public static object GetCustomAttr(string customID, string name)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            Object             obj = null;

            try
            {
                obj = svc.GetCustomAttr(customID, name);
            }

            catch (Exception ex)
            { }
            return(obj);
        }
Exemplo n.º 20
0
        public static void CancelMailDeliverable(string mID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             emailNotificationID = mID;

            try
            {
                svc.CancelMailDeliverable(emailNotificationID);
            }

            catch (Exception ex)
            {
            }
        }
Exemplo n.º 21
0
        public static WFEvent GetEvent(string evtID)
        {
            IWFWorkflowService svc     = Common.GetWorkFlowAPI();
            string             eventID = evtID;// for example, "049C3974240F47D3BA8EB6D4A3CDCD3F";
            WFEvent            evt     = null;

            try
            {
                evt = svc.GetEvent(eventID);
            }
            catch (Exception ex)
            { }
            return(evt);
        }
        public static WFManualWorkItem[] QueryWorkListEx(string sql)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            WFManualWorkItem[] workItems = null;
            try
            {
                workItems = svc.QueryWorkListEx(sql);
            }
            catch (Exception ex)
            {
            }
            return(workItems);
        }
        public static WFEvent UndoAssignWorkItem(string wID)
        {
            IWFWorkflowService svc        = Common.GetWorkFlowAPI();
            string             workItemID = wID;// for example, "03ABD59A0EB74D7A8741709478E83877";
            WFEvent            evt        = null;

            try
            {
                evt = svc.UndoAssignWorkItem(workItemID);
            }
            catch (Exception ex)
            { }
            return(evt);
        }
        public void DeleteProcInst(string piID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             processInstanceID = piID;// the ID of the process instance to becanceled.

            try
            {
                svc.DeleteProcInst(processInstanceID);
            }

            catch (Exception ex)
            {
            }
        }
        public static string MergeProcInsts(WFProcessMergingInstruction instruction)
        {
            IWFWorkflowService svc          = Common.GetWorkFlowAPI();
            string             MergProcInst = string.Empty;

            try
            {
                MergProcInst = svc.MergeProcInsts(instruction);
            }
            catch (Exception ex)
            {
            }
            return(MergProcInst);
        }
        public static string[] SplitProcInst(WFProcessSplittingInstruction instruction)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            string[] IDs = null;
            try
            {
                IDs = svc.SplitProcInst(instruction);
            }
            catch (Exception ex)
            {
            }
            return(IDs);
        }
        public static KeyValue[] GetCustomAttrsEx(string[] customIDs)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();

            KeyValue[] keyValues = null;
            try
            {
                keyValues = svc.GetCustomAttrsEx(customIDs);
            }
            catch (Exception ex)
            { }

            return(keyValues);
        }
Exemplo n.º 28
0
        public static void ReleaseProcDef(string processTemplateID)
        {
            try
            {
                IWFWorkflowService svc = Common.GetWorkFlowAPI();
                //string processDefinitionID = "";
                svc.ReleaseProcDef(processTemplateID);
            }

            catch (Exception ex)
            {
                Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
            }
        }
        public static void UpdateWorkItem(string workItemID, NameValue[] attributes)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             wID = workItemID;// work item ID of manual work item or automatic work item.

            try
            {
                //NameValue[] attrs = NameValue.Array("NAME", "[New Name]", "DUE_DATE", DateTime.Now.Add(new TimeSpan(1, 1, 1))); // for example, DateTime.Now.AddDays(3.0)
                svc.UpdateWorkItem(workItemID, attributes);
            }

            catch (Exception ex)
            { }
        }
Exemplo n.º 30
0
        public static void ArchiveProcInst(string procInstID)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             processInstanceID = procInstID;// the ID of process instance to bearchived

            try
            {
                svc.ArchiveProcInst(processInstanceID);
            }

            catch (Exception ex)
            {
            }
        }
        private int CountParticipantOnActivity(IWFWorkflowService api, string piID, WFBaseActivityInstance ai)
        {
            ArrayList participantList = new ArrayList();

            //Retreive Activity definition to know the type of activity
            WFBaseProcessInstance pi = api.GetProcInst(piID);
            string xmlString = api.GetProcDefXml(pi.DefID);
            WFProcessDefinition processDef = new WFProcessDefinition();
            ProcDefXmlParser xmlParser = new ProcDefXmlParser(processDef);
            xmlParser.Parse(xmlString);
            IWFActivityDefinition ad = processDef.FindActivityByName(ai.Name);
            WFManualActivityDefinition activityDef = null;
            //Get the type of activity
            if (ad != null && ad.GetType() == typeof(WFManualActivityDefinition))
            {
                activityDef = (WFManualActivityDefinition)ad;
            }

            // Get manual work items for the given Activity
            WFAny any = WFAny.Create(ai.ID);
            WFQueryExpr expr = new WFQueryExpr("ACTIVITY_INST_ID", SQLExpr.EQ, any, true);

            WFManualWorkItem[] wks = api.QueryWorkList(expr);

            if (wks != null)
            {
                foreach (WFManualWorkItem wk in wks)
                {
                    if (wk.Status == WFManualWorkItem.ASSIGNED || wk.Status == WFManualWorkItem.OVERDUE || wk.Status == WFManualWorkItem.COMPLETED)
                    {
                        if (!String.IsNullOrEmpty(wk.UserID) && !participantList.Contains(wk.UserID.ToLower()))
                        {
                            participantList.Add(wk.UserID.ToLower());
                        }
                    }
                }
            }

            // if activity is Agilework of type ProcessAdaptation
            if (activityDef != null && activityDef.CustomProperties.Contains("Ascentn.AgileWork.Premier.ProcessAdaptation"))
            {
                //Get type of the AgileWork
                string activityType = api.GetCustomAttr(pi.WorkObjectID, ai.ID + "_ApprovalType") as string;

                //Count number of participant in case of sequential type
                if (activityType == "Sequential")
                {
                    string activityProperties = api.GetCustomAttr(pi.WorkObjectID, ai.ID + "_ActivityProperties") as string;
                    if (!String.IsNullOrEmpty(activityProperties))
                    {
                        string[] approverInfoList = activityProperties.Split(';');
                        foreach (string approverInfo in approverInfoList)
                        {
                            string[] userInfoList = approverInfo.Split('|');
                            string user = userInfoList[0];
                            if (!String.IsNullOrEmpty(user) && !participantList.Contains(user.ToLower()))
                            {
                                participantList.Add(user.ToLower());
                            }
                        }
                    }
                }
            }
            return participantList.Count;
        }