Пример #1
0
        //sample: filtered list method for the Workflow General/Process Instance SmartObject
        static void ExecuteFilteredListMethodWCF()
        {
            Console.WriteLine("Executing filtered List method via WCF (Active instances only)");
            //set up the service client
            WorkflowGeneralReport_WCFService.Process_InstanceSvcClient processInstanceSvcClient = new Process_InstanceSvcClient();
            processInstanceSvcClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

            //set up a filter object (you could also constrcut the filter directly in XML if you prefer)
            Equals             statusEquals      = new Equals();
            PropertyExpression statusPropertyExp = new PropertyExpression("Status", PropertyType.Text);
            ValueExpression    statusValueExp    = new ValueExpression("Active", PropertyType.Text);

            statusEquals.Left  = statusPropertyExp;
            statusEquals.Right = statusValueExp;

            // Serialize the filter to XML
            FilterExp   filterExpression = new FilterExp(statusEquals);
            XmlDocument filterXml        = filterExpression.GetFilterXml();
            string      filterXmlString  = filterXml.InnerXml;

            //call the filter method, passing in the filter XML
            WorkflowGeneralReport_WCFService.Process_Instance[] processInstanceList = processInstanceSvcClient.Process_InstanceSvc_List_Filtered(filterXmlString);
            foreach (Process_Instance processInstance in processInstanceList)
            {
                Console.WriteLine("Folio: " + processInstance.Folio + " | ProcInstID: " + processInstance.ProcessInstanceID.ToString());
            }
            Console.WriteLine("Completed execution of filtered List method via WCF (Active instances only)");
            Console.ReadLine();
        }