Class NSBatchAgent
Start, stop and monitor predefined batch tasks.
Examples
NSBatchAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSBatchAgent()
Initializes a new instance of the NSBatchAgent class.
Declaration
NSBatchAgent Examples
NSBatchAgent agent;
agent.callMethod(arg1, arg2);
Methods
DeleteBatchTask(Integer)
Deletes a batch task from the database.
Declaration
Void DeleteBatchTask(Integer batchTaskId) Parameters
| Type | Name | Description |
| Integer | batchTaskId | The batchTask ids to delete. |
Returns
| Type | Description |
| Void |
DeleteBatchTasks(Integer[])
Deletes batch tasks from the database.
Declaration
Void DeleteBatchTasks(Integer[] batchTaskIds) Parameters
| Type | Name | Description |
| Integer[] | batchTaskIds | Array of batchTask ids to delete. |
Returns
| Type | Description |
| Void |
GetBatchTaskInfo(Integer)
Gets a single NSBatchTaskInfo based on ID.
Declaration
NSBatchTaskInfo GetBatchTaskInfo(Integer id) Examples
NSBatchAgent agent;
Integer id;
NSBatchTaskInfo res = agent.GetBatchTaskInfo(id);
Parameters
| Type | Name | Description |
| Integer | id | ID of the BatchTaskInfo to get. |
Returns
| Type | Description |
| NSBatchTaskInfo | A BatchTaskInfo. |
GetBatchTaskInfosByAssociates(Integer[])
Gets an array of NSBatchTaskInfo for the provided associate IDs.
Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByAssociates(Integer[] associateIds) Examples
NSBatchAgent agent;
Integer[] associateIds;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByAssociates(associateIds);
Parameters
| Type | Name | Description |
| Integer[] | associateIds | Array of associate IDs. |
Returns
| Type | Description |
| NSBatchTaskInfo[] | An array of BatchTaskInfo. |
GetBatchTaskInfosByAssociatesAndState(Integer[],Integer)
Gets an array of NSBatchTaskInfo for the provided associate IDs and batch task state.
Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByAssociatesAndState(Integer[] associateIds, Integer state) Examples
NSBatchAgent agent;
Integer[] associateIds;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByAssociatesAndState(associateIds, state);
Parameters
| Type | Name | Description |
| Integer[] | associateIds | Array of associate IDs |
| Integer | state | The BatchTaskState to get batch tasks for. See <xref href="CRMScript.NetServer.BatchTaskState" data-throw-if-not-resolved="false"></xref>. |
Returns
| Type | Description |
| NSBatchTaskInfo[] | An array of BatchTaskInfo. |
GetBatchTaskInfosByNameAndAssociates(String,Integer[])
Gets an array of NSBatchTaskInfo for the provided associate IDs and batch task definition name.
Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByNameAndAssociates(String name, Integer[] associateIds) Examples
NSBatchAgent agent;
String name;
Integer[] associateIds;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByNameAndAssociates(name, associateIds);
Parameters
| Type | Name | Description |
| String | name | Batchtask definition name. |
| Integer[] | associateIds | Array of associate IDs. |
Returns
| Type | Description |
| NSBatchTaskInfo[] | An array of BatchTaskInfo. |
GetBatchTaskInfosByNameAndState(String,Integer)
Gets an array of NSBatchTaskInfo with state defined by a BatchTaskState and the batchtask definition name.
Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByNameAndState(String name, Integer state) Examples
NSBatchAgent agent;
String name;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByNameAndState(name, state);
Parameters
| Type | Name | Description |
| String | name | Batchtask definition name. |
| Integer | state | The BatchTaskState to get batch tasks for. See <xref href="CRMScript.NetServer.BatchTaskState" data-throw-if-not-resolved="false"></xref>. |
Returns
| Type | Description |
| NSBatchTaskInfo[] | An array of BatchTaskInfo. |
GetBatchTaskInfosByState(Integer)
Gets an array of NSBatchTaskInfo with state defined by a BatchTaskState.
Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByState(Integer state) Examples
NSBatchAgent agent;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByState(state);
Parameters
| Type | Name | Description |
| Integer | state | See <xref href="CRMScript.NetServer.BatchTaskState" data-throw-if-not-resolved="false"></xref>. |
Returns
| Type | Description |
| NSBatchTaskInfo[] | An array of BatchTaskInfo. |
StartBatchJob(NSBatchTaskInfo)
Starts a batch job based on NSBatchTaskInfo.
Declaration
Integer StartBatchJob(NSBatchTaskInfo batchTaskInfo) Examples
NSBatchAgent agent;
NSBatchTaskInfo batchTaskInfo;
Integer res = agent.StartBatchJob(batchTaskInfo);
Parameters
| Type | Name | Description |
| NSBatchTaskInfo | batchTaskInfo | Use BatchTaskInfo to describe the new batch job. |
Returns
| Type | Description |
| Integer | The ID of the created batch job. |
StopBatchJob(Integer)
Stops a batch job based on ID.
Declaration
Bool StopBatchJob(Integer id) Examples
NSBatchAgent agent;
Integer id;
Bool res = agent.StopBatchJob(id);
Parameters
| Type | Name | Description |
| Integer | id | ID of the batch job to stop. |
Returns
| Type | Description |
| Bool | true if the job was stopped successfully. |
UpdateBatchTask(NSBatchTaskInfo)
Updates information about a BatchTask.
Declaration
NSBatchTaskInfo UpdateBatchTask(NSBatchTaskInfo batchTaskInfo) Examples
NSBatchAgent agent;
NSBatchTaskInfo batchTaskInfo;
NSBatchTaskInfo res = agent.UpdateBatchTask(batchTaskInfo);
Parameters
| Type | Name | Description |
| NSBatchTaskInfo | batchTaskInfo | The updated information to save. |
Returns
| Type | Description |
| NSBatchTaskInfo | The updated BatchTaskInfo. |