Class BatchAgent
Facade for the Batch Agent Start, stop and monitor predefined batch tasks
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class BatchAgent : AgentBase<IBatchAgent>, IDisposable, IBatchAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
Constructors
BatchAgent()
Facade for the Batch Agent Start, stop and monitor predefined batch tasks
Declaration
public BatchAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
Methods
DeleteBatchTask(Int32)
Delete a batch task from the database.
Declaration
public void DeleteBatchTask(int batchTaskId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | batchTaskId | The batchTask id to delete. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
DeleteBatchTasks(Int32[])
Delete batch tasks from the database.
Declaration
public void DeleteBatchTasks(int[] batchTaskIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | batchTaskIds | Array of batchTask ids to delete. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetAllBatchTaskInfosByName(String)
Get an array of system and user BatchTaskInfo for the provided task name.
Declaration
public BatchTaskInfo[] GetAllBatchTaskInfosByName(string taskName)
Parameters
Type | Name | Description |
---|---|---|
String | taskName | A task name, NULL or blank to get all tasks |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of user and system BatchTaskInfos. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetAllBatchTaskInfosByNameAndState(String, BatchTaskState)
Get an array of system and user BatchTaskInfo for the provided task name and state.
Declaration
public BatchTaskInfo[] GetAllBatchTaskInfosByNameAndState(string taskName, BatchTaskState state)
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. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of user and system BatchTaskInfos. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfo(Int32)
Get a single BatchTaskInfo based on Id.
Declaration
public BatchTaskInfo GetBatchTaskInfo(int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Id of the BatchTaskInfo to get. |
Returns
Type | Description |
---|---|
BatchTaskInfo | Returns a BatchTaskInfo. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfosByAssociates(Int32[])
Get an array of BatchTaskInfo for the provided associate id's.
Declaration
public BatchTaskInfo[] GetBatchTaskInfosByAssociates(int[] associateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | associateIds | Array of associate id's. empty array = all tasks, 0 = system tasks, -1 = all user tasks. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of user's BatchTaskInfo. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfosByAssociatesAndState(Int32[], BatchTaskState)
Get an array of BatchTaskInfo for the provided associate id's and batch task state.
Declaration
public BatchTaskInfo[] GetBatchTaskInfosByAssociatesAndState(int[] associateIds, BatchTaskState state)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | 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. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of BatchTaskInfo. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfosByNameAndAssociates(String, Int32[])
Get an array of BatchTaskInfo for the provided associate id's and batch task definition name.
Declaration
public BatchTaskInfo[] GetBatchTaskInfosByNameAndAssociates(string name, int[] associateIds)
Parameters
Type | Name | Description |
---|---|---|
String | name | Batchtask definition name. Blank for all tasks. |
Int32[] | associateIds | Array of associate id's. Empty array for all. 0 for system tasks, -1 for all users, or specific user ids. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of BatchTaskInfo. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfosByNameAndState(String, BatchTaskState)
Gets an array of user BatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
Declaration
public BatchTaskInfo[] GetBatchTaskInfosByNameAndState(string name, BatchTaskState state)
Parameters
Type | Name | Description |
---|---|---|
String | name | Batchtask definition name. Blank for all tasks. |
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of user BatchTaskInfo. System tasks are excluded. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetBatchTaskInfosByState(BatchTaskState)
Gets an array of user BatchTaskInfo with state defined by a BatchTaskState.
Declaration
public BatchTaskInfo[] GetBatchTaskInfosByState(BatchTaskState state)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskState | state | The BatchTaskState to get batch tasks for. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of user BatchTaskInfo. System tasks are excluded. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetSystemBatchTaskInfosByName(String)
Get an array of system BatchTaskInfo for the provided task name.
Declaration
public BatchTaskInfo[] GetSystemBatchTaskInfosByName(string taskName)
Parameters
Type | Name | Description |
---|---|---|
String | taskName | A task name, NULL or blank to get all tasks |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of system BatchTaskInfos. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
GetSystemBatchTaskInfosByNameAndState(String, BatchTaskState)
Get an array of system BatchTaskInfo for the provided task name and state.
Declaration
public BatchTaskInfo[] GetSystemBatchTaskInfosByNameAndState(string taskName, BatchTaskState state)
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. |
Returns
Type | Description |
---|---|
BatchTaskInfo[] | Returns an array of system BatchTaskInfos. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
StartBatchJob(BatchTaskInfo)
Start a batch job based on BatchTaskInfo.
Declaration
public int StartBatchJob(BatchTaskInfo batchTaskInfo)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskInfo | batchTaskInfo | Use BatchTaskInfo to describe the new batch job. |
Returns
Type | Description |
---|---|
Int32 | Returns the id of the created batch job. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
StopBatchJob(Int32)
Stop a batch job based on Id.
Declaration
public bool StopBatchJob(int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Id of the batch job to stop. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the job was stopped successfully. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}
UpdateBatchTask(BatchTaskInfo)
Update information about a BatchTask. Only the following properties can be updated: State, Description, Response and Request.
Declaration
public BatchTaskInfo UpdateBatchTask(BatchTaskInfo batchTaskInfo)
Parameters
Type | Name | Description |
---|---|---|
BatchTaskInfo | batchTaskInfo | The updated information to save. |
Returns
Type | Description |
---|---|
BatchTaskInfo | The updated BatchTaskInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BatchAgent agent = new BatchAgent())
{
// call methods on agent here...
}
}