Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HistoricUserOperationLogService #69

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions Camunda.Api.Client/Camunda.Api.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<VersionSuffix></VersionSuffix>
<VersionPrefix>2.5.2</VersionPrefix>
<FileVersion>2.5.2.0</FileVersion>
<VersionPrefix>2.6.0</VersionPrefix>
<FileVersion>2.6.0.0</FileVersion>
<Product>Camunda REST API Client</Product>
<Title>Camunda REST API Client</Title>
<Authors>Jan Lucansky</Authors>
Expand Down
6 changes: 4 additions & 2 deletions Camunda.Api.Client/CamundaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ internal class HistoricApi
public Lazy<IHistoricVariableInstanceRestService> VariableInstanceApi;
public Lazy<IHistoricUserTaskRestService> UserTaskApi;
public Lazy<IHistoricProcessDefinitionRestService> ProcessDefinitionApi;
public Lazy<IHistoricExternalTaskLogRestService> ExternalTaskLogApi;
public Lazy<IHistoricExternalTaskLogRestService> externalTaskLogApi;
public Lazy<IHistoricUserOperationLogRestService> userOperationLogApi;
}

static CamundaClient()
Expand Down Expand Up @@ -234,7 +235,8 @@ private void CreateServices()
VariableInstanceApi = CreateService<IHistoricVariableInstanceRestService>(),
UserTaskApi = CreateService<IHistoricUserTaskRestService>(),
ProcessDefinitionApi = CreateService<IHistoricProcessDefinitionRestService>(),
ExternalTaskLogApi = CreateService<IHistoricExternalTaskLogRestService>(),
externalTaskLogApi = CreateService<IHistoricExternalTaskLogRestService>(),
userOperationLogApi = CreateService<IHistoricUserOperationLogRestService>(),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Camunda.Api.Client.CaseInstance
{
public class CaseInstanceDeleteVariable
{
[JsonProperty("name")]
public string Name;
}
}
24 changes: 5 additions & 19 deletions Camunda.Api.Client/CaseInstance/CaseInstanceQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,41 @@ namespace Camunda.Api.Client.CaseInstance
{
public class CaseInstanceQuery
{
[JsonProperty("caseInstanceId")]
public string CaseInstanceId;

[JsonProperty("businessKey")]
public string BusinessKey;

[JsonProperty("caseDefinitionId")]
public string CaseDefinitionId;

[JsonProperty("caseDefinitionKey")]
public string CaseDefinitionKey;

[JsonProperty("deploymentId")]
public string DeploymentId;

[JsonProperty("superProcessInstance")]
public string SuperProcessInstance;

[JsonProperty("subProcessInstance")]
public string SubProcessInstance;

[JsonProperty("superCaseInstance")]
public string SuperCaseInstance;

[JsonProperty("subCaseInstance")]
public string SubCaseInstance;

[JsonProperty("active")]
public bool? Active;

[JsonProperty("completed")]
public bool? Completed;

[JsonProperty("tenantIdIn")]
public List<string> TenantIdIn;
public List<string> TenantIds;

[JsonProperty("withoutTenantId")]
public bool? WithoutTenantId;

[JsonProperty("variables")]
public List<CaseInstanceQueryVariable> Variables;
public List<VariableQueryParameter> Variables;

[JsonProperty("variableNamesIgnoreCase")]
public bool VariableNamesIgnoreCase;

[JsonProperty("variableValuesIgnoreCase")]
public bool VariableValuesIgnoreCase;

[JsonProperty("sorting")]
public List<CaseInstanceSorting> Sorting;
public CaseInstanceSorting SortBy;

public SortOrder SortOrder;
}
}
20 changes: 0 additions & 20 deletions Camunda.Api.Client/CaseInstance/CaseInstanceQueryVariable.cs

This file was deleted.

5 changes: 1 addition & 4 deletions Camunda.Api.Client/CaseInstance/CaseInstanceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ internal CaseInstanceService(ICaseInstanceRestService api)
}

public QueryResource<CaseInstanceQuery, CaseInstanceInfo> Query(CaseInstanceQuery query = null) =>
new QueryResource<CaseInstanceQuery, CaseInstanceInfo>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<CaseInstanceQuery, CaseInstanceInfo>(query, _api.GetList, _api.GetListCount);

/// <param name="caseInstanceId">Id of specific case instance</param>
public CaseInstanceResource this[string caseInstanceId] => new CaseInstanceResource(_api, caseInstanceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Camunda.Api.Client.CaseInstance
{
public class CaseInstanceVariableValue : VariableValue
{
[JsonProperty("local")]
public bool Local;
}
}
2 changes: 0 additions & 2 deletions Camunda.Api.Client/CaseInstance/ChangeCaseInstanceState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ namespace Camunda.Api.Client.CaseInstance
{
public class ChangeCaseInstanceState
{
[JsonProperty("variables")]
public Dictionary<string, CaseInstanceVariableValue> Variables;

[JsonProperty("deletions")]
public List<CaseInstanceDeleteVariable> Deletions;
}
}
5 changes: 1 addition & 4 deletions Camunda.Api.Client/Execution/ExecutionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ internal ExecutionService(IExecutionRestService api)
public ExecutionResource this[string executionId] => new ExecutionResource(_api, executionId);

public QueryResource<ExecutionQuery, ExecutionInfo> Query(ExecutionQuery query = null) =>
new QueryResource<ExecutionQuery, ExecutionInfo>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<ExecutionQuery, ExecutionInfo>(query, _api.GetList, _api.GetListCount);

}
}
5 changes: 1 addition & 4 deletions Camunda.Api.Client/ExternalTask/ExternalTaskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ public class ExternalTaskService
internal ExternalTaskService(IExternalTaskRestService api) { _api = api; }

public QueryResource<ExternalTaskQuery, ExternalTaskInfo> Query(ExternalTaskQuery query = null) =>
new QueryResource<ExternalTaskQuery, ExternalTaskInfo>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<ExternalTaskQuery, ExternalTaskInfo>(query, _api.GetList, _api.GetListCount);

/// <param name="externalTaskId">The id of the external task to be retrieved.</param>
public ExternalTaskResource this[string externalTaskId] => new ExternalTaskResource(_api, externalTaskId);
Expand Down
8 changes: 4 additions & 4 deletions Camunda.Api.Client/Filter/FilterQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public class FilterQuery : QueryParameters

public enum FilterSorting
{
filterId,
firstName,
lastName,
email
FilterId,
FirstName,
LastName,
Email
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ internal HistoricActivityInstanceService(IHistoricActivityInstanceRestService ap

public QueryResource<HistoricActivityInstanceQuery, HistoricActivityInstance> Query(
HistoricActivityInstanceQuery query = null) =>
new QueryResource<HistoricActivityInstanceQuery, HistoricActivityInstance>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<HistoricActivityInstanceQuery, HistoricActivityInstance>(query, _api.GetList, _api.GetListCount);

/// <param name="activityInstanceId">The id of the historic activity instance to be retrieved.</param>
public HistoricActivityInstanceResource this[string activityInstanceId] => new HistoricActivityInstanceResource(_api, activityInstanceId);
Expand Down
7 changes: 2 additions & 5 deletions Camunda.Api.Client/History/HistoricCaseInstanceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ internal HistoricCaseInstanceService(IHistoricCaseInstanceRestService api)

public QueryResource<HistoricCaseInstanceQuery, HistoricCaseInstance> Query(
HistoricCaseInstanceQuery query = null) =>
new QueryResource<HistoricCaseInstanceQuery, HistoricCaseInstance>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));

new QueryResource<HistoricCaseInstanceQuery, HistoricCaseInstance>(query, _api.GetList, _api.GetListCount);

/// <param name="caseInstanceId">The id of the historic case instance to be retrieved.</param>
public HistoricCaseInstanceResource this[string caseInstanceId] => new HistoricCaseInstanceResource(_api, caseInstanceId);
}
Expand Down
22 changes: 21 additions & 1 deletion Camunda.Api.Client/History/HistoricDecisionInstanceService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Camunda.Api.Client.History
using System.Threading.Tasks;

namespace Camunda.Api.Client.History
{
public class HistoricDecisionInstanceService
{
Expand All @@ -18,5 +20,23 @@ public QueryResource<HistoricDecisionInstanceQuery, HistoricDecisionInstance> Qu

/// <param name="decisionInstanceId">The id of the historic decision instance to be retrieved.</param>
public HistoricDecisionInstanceResource this[string decisionInstanceId] => new HistoricDecisionInstanceResource(_api, decisionInstanceId);

/// <summary>
/// Delete multiple historic decision instances asynchronously (batch).
/// At least historicDecisionInstanceIds or historicDecisionInstanceQuery has to be provided.
/// If both are provided then all instances matching query criterion and instances from the list will be deleted.
/// </summary>
/// <param name="historicDeleteDecisionInstance"></param>
/// <returns></returns>
public Task<HistoricDeleteDecisionInstanceResult> Delete(HistoricDeleteDecisionInstance historicDeleteDecisionInstance) => _api.Delete(historicDeleteDecisionInstance);

/// <summary>
/// Sets the removal time to multiple historic decision instances asynchronously (batch).
/// At least historicDecisionInstanceIds or historicDecisionInstanceQuery has to be provided.
/// If both are provided, all instances matching query criterion and instances from the list will be updated with a removal time.
/// </summary>
/// <param name="historicSetRemovalTimeDecisionInstance"></param>
/// <returns></returns>
public Task<HistoricDeleteDecisionInstanceResult> SetRemovalTime(HistoricSetRemovalTimeDecisionInstance historicSetRemovalTimeDecisionInstance) => _api.SetRemovalTime(historicSetRemovalTimeDecisionInstance);
}
}
24 changes: 24 additions & 0 deletions Camunda.Api.Client/History/HistoricDeleteDecisionInstance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Camunda.Api.Client.History
{
public class HistoricDeleteDecisionInstance
{
/// <summary>
/// A list historic decision instance ids to delete.
/// </summary>
public List<string> HistoricDecisionInstanceIds;

/// <summary>
/// A historic decision instance query like the request body described by POST /history/decision-instance .
/// </summary>
public HistoricDecisionInstanceQuery Query;

/// <summary>
/// A string with delete reason.
/// </summary>
public string DeleteReason;
}
}
69 changes: 69 additions & 0 deletions Camunda.Api.Client/History/HistoricDeleteDecisionInstanceResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Camunda.Api.Client.History
{
public class HistoricDeleteDecisionInstanceResult
{
/// <summary>
/// The id of the batch.
/// </summary>
public string Id;

/// <summary>
/// The type of the batch.See the User Guide for more information about batch types.
/// </summary>
public string Type;

/// <summary>
/// The total jobs of a batch is the number of batch execution jobs required to complete the batch.
/// </summary>
public int TotalJobs;

/// <summary>
/// The number of batch execution jobs already created by the seed job.
/// </summary>
public int JobsCreated;

/// <summary>
/// The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until it has created all batch execution jobs required by the batch (see totalJobs property).
/// </summary>
public int BatchJobsPerSeed;

/// <summary>
/// Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times.E.g., for a process instance migration batch this specifies the number of process instances which are migrated per batch execution job.
/// </summary>
public int InvocationsPerBatchJob;

/// <summary>
/// The job definition id for the seed jobs of this batch.
/// </summary>
public string SeedJobDefinitionId;

/// <summary>
/// The job definition id for the monitor jobs of this batch.
/// </summary>
public string MonitorJobDefinitionId;

/// <summary>
/// The job definition id for the batch execution jobs of this batch.
/// </summary>
public string MatchJobDefinitionId;

/// <summary>
/// Indicates whether this batch is suspended or not.
/// </summary>
public bool Suspended;

/// <summary>
/// The tenant id of the batch.
/// </summary>
public string TenantId;

/// <summary>
/// The id of the user that created the batch.
/// </summary>
public string CreateUserId;
}
}
5 changes: 1 addition & 4 deletions Camunda.Api.Client/History/HistoricExternalTaskLogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ internal HistoricExternalTaskLogService(IHistoricExternalTaskLogRestService api)
}

public QueryResource<HistoricExternalTaskLogQuery, HistoricExternalTaskLog> Query(HistoricExternalTaskLogQuery query = null) =>
new QueryResource<HistoricExternalTaskLogQuery, HistoricExternalTaskLog>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<HistoricExternalTaskLogQuery, HistoricExternalTaskLog>(query, _api.GetList, _api.GetListCount);

public HistoricExternalTaskLogResource this[string logId] => new HistoricExternalTaskLogResource(_api, logId);
}
Expand Down
5 changes: 1 addition & 4 deletions Camunda.Api.Client/History/HistoricJobLogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ internal HistoricJobLogService(IHistoricJobLogRestService api)
}

public QueryResource<HistoricJobLogQuery, HistoricJobLog> Query(HistoricJobLogQuery query = null) =>
new QueryResource<HistoricJobLogQuery, HistoricJobLog>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<HistoricJobLogQuery, HistoricJobLog>(query, _api.GetList, _api.GetListCount);

/// <param name="historicJobLogId">The id of the log entry.</param>
public HistoricJobLogResource this[string historicJobLogId] => new HistoricJobLogResource(_api, historicJobLogId);
Expand Down
5 changes: 5 additions & 0 deletions Camunda.Api.Client/History/HistoricProcessInstanceQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public class HistoricProcessInstanceQuery : SortableQuery<HistoricProcessInstanc
/// </summary>
[JsonProperty("activeActivityIdIn")]
public List<string> ActiveActivityIds;

/// <summary>
/// Array to only include process instances that have/had variables with certain values.
/// </summary>
public List<VariableQueryParameter> Variables = new List<VariableQueryParameter>();
}

public enum HistoricProcessInstanceQuerySorting
Expand Down
5 changes: 1 addition & 4 deletions Camunda.Api.Client/History/HistoricProcessInstanceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ internal HistoricProcessInstanceService(IHistoricProcessInstanceRestService api)

public QueryResource<HistoricProcessInstanceQuery, HistoricProcessInstance> Query(
HistoricProcessInstanceQuery query = null) =>
new QueryResource<HistoricProcessInstanceQuery, HistoricProcessInstance>(
query,
(q, f, m) => _api.GetList(q, f, m),
q => _api.GetListCount(q));
new QueryResource<HistoricProcessInstanceQuery, HistoricProcessInstance>(query, _api.GetList, _api.GetListCount);

/// <param name="processInstanceId">The id of the historic process instance to be retrieved.</param>
public HistoricProcessInstanceResource this[string processInstanceId] => new HistoricProcessInstanceResource(_api, processInstanceId);
Expand Down
Loading