public List<ProcessDefinition> List(
            int? version = null,
            string name = null,
            string nameLike = null,
            string key	= null,
            string keyLike = null,
            string resourceName = null,
            string resourceNameLike = null,
            string category = null,
            string categoryLike = null,
            string categoryNotEquals = null,
            string deploymentId = null,
            string startableByUser = null,
            bool? latest = null,
            bool? suspended = null,
            RestClientBase.Sort? sort = null,
            int? size = null)
        {
            var request = new RestRequest("repository/process-definitions", Method.GET);

            request.AddParameterIfNotNull("version", version);
            request.AddParameterIfNotNull("name", name);
            request.AddParameterIfNotNull("nameLike", nameLike);
            request.AddParameterIfNotNull("key", key);
            request.AddParameterIfNotNull("keyLike", keyLike);
            request.AddParameterIfNotNull("resourceName", resourceName);
            request.AddParameterIfNotNull("resourceNameLike", resourceNameLike);
            request.AddParameterIfNotNull("category", category);
            request.AddParameterIfNotNull("categoryLike", categoryLike);
            request.AddParameterIfNotNull("categoryNotEquals", categoryNotEquals);
            request.AddParameterIfNotNull("deploymentId", deploymentId);
            request.AddParameterIfNotNull("startableByUser", startableByUser);
            request.AddParameterIfNotNull("latest", latest);
            request.AddParameterIfNotNull("suspended", suspended);
            request.AddParameterIfNotNull("sort", sort);
            request.AddParameterIfNotNull("size", size);

            var response = base.Client.Execute<DataSet<ProcessDefinition>>(request);
            base.HandleError(response);
            return response.Data.GetData();
        }
Beispiel #2
0
        public void Post(int taskId, RestClientBase.Action action,
            NameValueCollection variables = null,
            string assignee = null)
        {
            var request = new RestRequest("runtime/tasks/{taskId}", Method.POST);
            request.AddUrlSegment("taskId", taskId.ToString());

            var param = (from name in variables.AllKeys
                         select new { name, value = variables.Get(name) }).ToList();
            var json = new {
                action = action.ToString(),
                variables = param,
                assignee = assignee,
            };
            request.RequestFormat = DataFormat.Json;
            request.AddBody(json);
            var response = base.Client.Execute<Models.Task>(request);
            base.HandleError(response);
        }