public static ProcessParameterArray GetSomeProcessParams(string url, string sessionid) { Guid g = Guid.NewGuid(); string suffix = g.ToString().Replace('-', '_'); ProcessParameterArray parameters = new ProcessParameterArray(); ProcessParameter param1 = new ProcessParameter( Name: "Batch" + suffix, Description: "a description", ContextLabel: "top", OutlineParameterName: "batch", DisplayUnit: null, Mandatory: true ); ProcessParameter param2 = new ProcessParameter( Name: "Conc" + suffix, Description: "a description", ContextLabel: "top", OutlineParameterName: "conc", DisplayUnit: null, Mandatory: true ); parameters.Add(param1); parameters.Add(param2); return(parameters); }
public static Process GetASimpleProcess(string url, string sessionid) { Guid g = Guid.NewGuid(); string suffix = g.ToString().Replace('-', '_'); //get a context ParameterContextArray contexts = new ParameterContextArray { new ParameterContext("top") }; //get params ProcessParameterArray parameters = ParameterGenerator.GetSomeProcessParams(url, sessionid); //build process Process proc = new Process(Name: "SimpleProcess" + suffix, Description: "a description", ElementTypeName: "ProcessDefinition", StateName: "pending", MethodUsage: "optional", IsValidUsage: "optional", OutputStyle: "sheet", CustomProperties: null, Parameters: parameters, Steps: null, Contexts: contexts, Rows: null); //ProcessParameterArray return(proc); }