示例#1
0
        public override List <ServiceObject> DescribeServiceObjects()
        {
            var so = new ServiceObjectBuilder("Identity", "Exposes functionality to resolve Identities in K2.", true);

            so.CreateProperty(Constants.SoProperties.Identity.FQN,
                              "Fully Qualified Name of the Identity.", SoType.Text)
            .CreateProperty(Constants.SoProperties.Identity.ResolveMembers,
                            "Resolve Members of the Identity.", SoType.YesNo)
            .CreateProperty(Constants.SoProperties.Identity.ResolveContainers,
                            "Resolve Containers of the Identity", SoType.YesNo);

            var resolveUser = new ServiceObjectMethodBuilder(Constants.Methods.Identity.ResolveUser, "Resolves the user", MethodType.Execute)
                              .AddProperty(Constants.SoProperties.Identity.FQN, true, true, false)
                              .AddProperty(Constants.SoProperties.Identity.ResolveContainers, true, false, false);

            so.AddMethod(resolveUser);

            var resolveGroup = new ServiceObjectMethodBuilder(Constants.Methods.Identity.ResolveGroup, "Resolves the group", MethodType.Execute)
                               .AddProperty(Constants.SoProperties.Identity.FQN, true, true, false)
                               .AddProperty(Constants.SoProperties.Identity.ResolveContainers, true, false, false)
                               .AddProperty(Constants.SoProperties.Identity.ResolveMembers, true, false, false);

            so.AddMethod(resolveGroup);

            var resolveRole = new ServiceObjectMethodBuilder(Constants.Methods.Identity.ResolveRole, "Resolves the role", MethodType.Execute)
                              .AddProperty(Constants.SoProperties.Identity.FQN, true, true, false)
                              .AddProperty(Constants.SoProperties.Identity.ResolveContainers, true, false, false)
                              .AddProperty(Constants.SoProperties.Identity.ResolveMembers, true, false, false);

            so.AddMethod(resolveRole);

            return(new List <ServiceObject> {
                so
            });
        }
        public override List <ServiceObject> DescribeServiceObjects()
        {
            var sObjects = new List <ServiceObject>();

            foreach (var item in SoDefCollection.Items)
            {
                var so = new ServiceObjectBuilder(item.SoName, $"Service Object {item.SoName}, created on the basis of the Service Object Definition configuration parameter", true);

                var soMethod = new ServiceObjectMethodBuilder(Constants.Methods.ExecuteAdoQuery, "Executes Ado.Net query", MethodType.List);
                soMethod.AddParameter(Parameters.AdoQuery, SoType.Memo, true);
                foreach (var prop in item.Properties)
                {
                    so.CreateProperty(prop.Name, prop.Name, prop.SoType);
                    soMethod.AddProperty(prop.Name, false, false, true);
                }
                so.AddMethod(soMethod);
                sObjects.Add(so);
            }

            return(sObjects);
        }
示例#3
0
        public override List <ServiceObject> DescribeServiceObjects()
        {
            var so = new ServiceObjectBuilder("ProcessInstanceManagement", "Exposes functionality to manage the process instance.", true);

            so.CreateProperty(Constants.SoProperties.ProcessInstance.ProcessFolio,
                              "The folio to use for the process.", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ProcessName,
                            "The full name of the process.", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.StartSync,
                            "Start the process synchronously or not.", SoType.YesNo)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ProcInstId,
                            "The process instance ID.", SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ProcessVersion,
                            "The version number to start. Leave empty for default.", SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.DataFieldName,
                            "The name of the DataField.", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.DataFieldValue,
                            "The value of the DataField.", SoType.Memo)
            .CreateProperty(Constants.SoProperties.ProcessInstance.DataFieldType,
                            "The data type of the DataField.", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.XmlFieldName, "The name of the XML field.",
                            SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.XmlFieldValue,
                            "The value of the XML field.", SoType.Memo)
            .CreateProperty(Constants.SoProperties.ProcessInstance.TargetProcVersion, "Target Process Version Id",
                            SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.FromActName, "Activity Name to expire",
                            SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ToActName,
                            "Activity, to which the workflow needs to go", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.StartDate,
                            "StartDate of the process instance", SoType.DateTime)
            .CreateProperty(Constants.SoProperties.ProcessInstance.Status,
                            "Status of the worfklow", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.Originator,
                            "Originator of the workflow", SoType.Text)
            .CreateProperty(Constants.SoProperties.ProcessInstance.Version,
                            "Version of the workflow", SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ExecutingVersion,
                            "Executing version of the workflow", SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ProcSetId,
                            "Process Set of the Process Instance", SoType.Number)
            .CreateProperty(Constants.SoProperties.ProcessInstance.ProcId,
                            "Process ID of the process Instance", SoType.Number);

            var updateFolio = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.UpdateFolio, "Updates the folio of a running process instance", MethodType.Update)
                              .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                              .AddProperty(Constants.SoProperties.ProcessInstance.ProcessFolio, true, true, false);

            so.AddMethod(updateFolio);

            var updateDataField = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.UpdateDataField,
                                                                 "Updates the DataField of a running process instance", MethodType.Update)
                                  .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                                  .AddProperty(Constants.SoProperties.ProcessInstance.DataFieldName, true, true, false)
                                  .AddProperty(Constants.SoProperties.ProcessInstance.DataFieldValue, true, false, false);

            so.AddMethod(updateDataField);

            var listDataFields = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.ListDataFields,
                                                                "Lists the data fields with values from the Process Instance", MethodType.List)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.DataFieldName, false, false, true)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.DataFieldType, false, false, true)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.DataFieldValue, false, false, true);

            so.AddMethod(listDataFields);

            var listXmlFields = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.ListXmlFields,
                                                               "Lists the data fields with values from the Process Instance", MethodType.List)
                                .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                                .AddProperty(Constants.SoProperties.ProcessInstance.XmlFieldName, false, false, true)
                                .AddProperty(Constants.SoProperties.ProcessInstance.XmlFieldValue, false, false, true);

            so.AddMethod(listXmlFields);

            var updateXmlField = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.UpdateXmlField,
                                                                "Updates the XmlField of a running process instance", MethodType.Update)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.XmlFieldName, true, true, false)
                                 .AddProperty(Constants.SoProperties.ProcessInstance.XmlFieldValue, true, false, false);

            so.AddMethod(updateXmlField);

            var setProcessInstanceVersion = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.SetProcessInstanceVersion,
                                                                           "Migrates the workflow to another version", MethodType.Execute)
                                            .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                                            .AddProperty(Constants.SoProperties.ProcessInstance.TargetProcVersion, true, true, false);

            so.AddMethod(setProcessInstanceVersion);

            var goToActivity = new ServiceObjectMethodBuilder(Constants.Methods.ProcessInstance.GoToActivity,
                                                              "Moves the workflow to another activity", MethodType.Execute)
                               .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, true, true, false)
                               .AddProperty(Constants.SoProperties.ProcessInstance.FromActName, true, false, false)
                               .AddProperty(Constants.SoProperties.ProcessInstance.ToActName, true, true, false);

            so.AddMethod(goToActivity);

            var listProcessInstances = new ServiceObjectMethodBuilder(
                Constants.Methods.ProcessInstance.ListProcessInstances,
                "Lists the process instances", MethodType.List)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.ProcInstId, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.ProcessFolio, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.StartDate, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.Status, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.Originator, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.Version, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.ExecutingVersion, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.ProcSetId, false, false, true)
                                       .AddProperty(Constants.SoProperties.ProcessInstance.ProcId, false, false, true)
                                       .AddParameter(Constants.SoParameters.ProcessSetId, SoType.Number);

            so.AddMethod(listProcessInstances);

            return(new List <ServiceObject>()
            {
                so
            });
        }
示例#4
0
        public void ServiceObjectBase_Create()
        {
            string name = "So_1";

            var soBuilder = new ServiceObjectBuilder();
        }