Class BatchAgent
Proxy class for the Batch Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class BatchAgent : IBatchAgent, IAgent
Constructors
BatchAgent(IBatchImplementation, ISoRequestItemsAccessor)
Proxy class for the Batch Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public BatchAgent(IBatchImplementation batchImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IBatchImplementation | batchImplementation | |
ISoRequestItemsAccessor | accessor |
BatchAgent(IBatchImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the Batch Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public BatchAgent(IBatchImplementation batchImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type | Name | Description |
---|---|---|
IBatchImplementation | batchImplementation | |
ISoRequestItemsAccessor | accessor | |
IDebugUser | debugUser | |
IServiceCallsRepository | serviceCallsRepository |
Methods
DeleteBatchTaskAsync(int, CancellationToken)
Delete a batch task from the database.
Declaration
public Task DeleteBatchTaskAsync(int batchTaskId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | batchTaskId | The batchTask id to delete. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
DeleteBatchTasksAsync(int[], CancellationToken)
Delete batch tasks from the database.
Declaration
public Task DeleteBatchTasksAsync(int[] batchTaskIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | batchTaskIds | Array of batchTask ids to delete. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
GetAllBatchTaskInfosByNameAndStateAsync(string, BatchTaskState, CancellationToken)
Get an array of system and user BatchTaskInfo for the provided task name and state.
Declaration
public Task<BatchTaskInfo[]> GetAllBatchTaskInfosByNameAndStateAsync(string taskName, BatchTaskState state, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | taskName | A task name, NULL or blank to get all tasks |
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of user and system BatchTaskInfos. |
GetAllBatchTaskInfosByNameAsync(string, CancellationToken)
Get an array of system and user BatchTaskInfo for the provided task name.
Declaration
public Task<BatchTaskInfo[]> GetAllBatchTaskInfosByNameAsync(string taskName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | taskName | A task name, NULL or blank to get all tasks |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of user and system BatchTaskInfos. |
GetBatchTaskInfoAsync(int, CancellationToken)
Get a single BatchTaskInfo based on Id.
Declaration
public Task<BatchTaskInfo> GetBatchTaskInfoAsync(int id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | id | Id of the BatchTaskInfo to get. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo> | Returns a BatchTaskInfo. |
GetBatchTaskInfosByAssociatesAndStateAsync(int[], BatchTaskState, CancellationToken)
Get an array of BatchTaskInfo for the provided associate id's and batch task state.
Declaration
public Task<BatchTaskInfo[]> GetBatchTaskInfosByAssociatesAndStateAsync(int[] associateIds, BatchTaskState state, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | associateIds | Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids. |
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of BatchTaskInfo. |
GetBatchTaskInfosByAssociatesAsync(int[], CancellationToken)
Get an array of BatchTaskInfo for the provided associate id's.
Declaration
public Task<BatchTaskInfo[]> GetBatchTaskInfosByAssociatesAsync(int[] associateIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | associateIds | Array of associate id's. empty array = all tasks, 0 = system tasks, -1 = all user tasks. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of user's BatchTaskInfo. |
GetBatchTaskInfosByNameAndAssociatesAsync(string, int[], CancellationToken)
Get an array of BatchTaskInfo for the provided associate id's and batch task definition name.
Declaration
public Task<BatchTaskInfo[]> GetBatchTaskInfosByNameAndAssociatesAsync(string name, int[] associateIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | Batchtask definition name. Blank for all tasks. |
int[] | associateIds | Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of BatchTaskInfo. |
GetBatchTaskInfosByNameAndStateAsync(string, BatchTaskState, CancellationToken)
Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
Declaration
public Task<BatchTaskInfo[]> GetBatchTaskInfosByNameAndStateAsync(string name, BatchTaskState state, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | Batchtask definition name. Blank for all tasks. |
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of user BatchTaskInfo. System tasks are excluded. |
GetBatchTaskInfosByStateAsync(BatchTaskState, CancellationToken)
Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
Declaration
public Task<BatchTaskInfo[]> GetBatchTaskInfosByStateAsync(BatchTaskState state, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of user BatchTaskInfo. System tasks are excluded. |
GetSystemBatchTaskInfosByNameAndStateAsync(string, BatchTaskState, CancellationToken)
Get an array of system BatchTaskInfo for the provided task name and state.
Declaration
public Task<BatchTaskInfo[]> GetSystemBatchTaskInfosByNameAndStateAsync(string taskName, BatchTaskState state, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | taskName | A task name, NULL or blank to get all tasks |
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of system BatchTaskInfos. |
GetSystemBatchTaskInfosByNameAsync(string, CancellationToken)
Get an array of system BatchTaskInfo for the provided task name.
Declaration
public Task<BatchTaskInfo[]> GetSystemBatchTaskInfosByNameAsync(string taskName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | taskName | A task name, NULL or blank to get all tasks |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo[]> | Returns an array of system BatchTaskInfos. |
StartBatchJobAsync(BatchTaskInfo, CancellationToken)
Start a batch job based on BatchTaskInfo.
Declaration
public Task<int> StartBatchJobAsync(BatchTaskInfo batchTaskInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskInfo | batchTaskInfo | Use BatchTaskInfo to describe the new batch job. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | Returns the id of the created batch job. |
StopBatchJobAsync(int, CancellationToken)
Stop a batch job based on Id.
Declaration
public Task<bool> StopBatchJobAsync(int id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | id | Id of the batch job to stop. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<bool> | Returns true if the job was stopped successfully. |
UpdateBatchTaskAsync(BatchTaskInfo, CancellationToken)
Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
Declaration
public Task<BatchTaskInfo> UpdateBatchTaskAsync(BatchTaskInfo batchTaskInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskInfo | batchTaskInfo | The updated information to save. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BatchTaskInfo> | The updated BatchTaskInfo |