Show / Hide Table of Contents

Class NSBatchAgent

Start, stop and monitor predefined batch tasks.

Syntax
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
Examples
NSBatchAgent agent;
agent.callMethod(arg1, arg2);

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
Examples
NSBatchAgent agent;
agent.callMethod(arg1, arg2);

GetBatchTaskInfo(Integer)

Gets a single NSBatchTaskInfo based on ID.

Declaration
NSBatchTaskInfo GetBatchTaskInfo(Integer id)
Parameters
Type Name Description
Integer id

ID of the BatchTaskInfo to get.

Returns
Type Description
NSBatchTaskInfo

A BatchTaskInfo.

Examples
NSBatchAgent agent;
Integer id;
NSBatchTaskInfo res = agent.GetBatchTaskInfo(id);

GetBatchTaskInfosByAssociates(Integer[])

Gets an array of NSBatchTaskInfo for the provided associate IDs.

Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByAssociates(Integer[] associateIds)
Parameters
Type Name Description
Integer[] associateIds

Array of associate IDs.

Returns
Type Description
NSBatchTaskInfo[]

An array of BatchTaskInfo.

Examples
NSBatchAgent agent;
Integer[] associateIds;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByAssociates(associateIds);

GetBatchTaskInfosByAssociatesAndState(Integer[],Integer)

Gets an array of NSBatchTaskInfo for the provided associate IDs and batch task state.

Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByAssociatesAndState(Integer[] associateIds, Integer state)
Parameters
Type Name Description
Integer[] associateIds

Array of associate IDs

Integer state

The BatchTaskState to get batch tasks for. See BatchTaskState.

Returns
Type Description
NSBatchTaskInfo[]

An array of BatchTaskInfo.

Examples
NSBatchAgent agent;
Integer[] associateIds;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByAssociatesAndState(associateIds, state);

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)
Parameters
Type Name Description
String name

Batchtask definition name.

Integer[] associateIds

Array of associate IDs.

Returns
Type Description
NSBatchTaskInfo[]

An array of BatchTaskInfo.

Examples
NSBatchAgent agent;
String name;
Integer[] associateIds;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByNameAndAssociates(name, associateIds);

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)
Parameters
Type Name Description
String name

Batchtask definition name.

Integer state

The BatchTaskState to get batch tasks for. See BatchTaskState.

Returns
Type Description
NSBatchTaskInfo[]

An array of BatchTaskInfo.

Examples
NSBatchAgent agent;
String name;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByNameAndState(name, state);

GetBatchTaskInfosByState(Integer)

Gets an array of NSBatchTaskInfo with state defined by a BatchTaskState.

Declaration
NSBatchTaskInfo[] GetBatchTaskInfosByState(Integer state)
Parameters
Type Name Description
Integer state

See BatchTaskState.

Returns
Type Description
NSBatchTaskInfo[]

An array of BatchTaskInfo.

Examples
NSBatchAgent agent;
Integer state;
NSBatchTaskInfo[] res = agent.GetBatchTaskInfosByState(state);

StartBatchJob(NSBatchTaskInfo)

Starts a batch job based on NSBatchTaskInfo.

Declaration
Integer StartBatchJob(NSBatchTaskInfo 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.

Examples
NSBatchAgent agent;
NSBatchTaskInfo batchTaskInfo;
Integer res = agent.StartBatchJob(batchTaskInfo);

StopBatchJob(Integer)

Stops a batch job based on ID.

Declaration
Bool StopBatchJob(Integer 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.

Examples
NSBatchAgent agent;
Integer id;
Bool res = agent.StopBatchJob(id);

UpdateBatchTask(NSBatchTaskInfo)

Updates information about a BatchTask.

Declaration
NSBatchTaskInfo UpdateBatchTask(NSBatchTaskInfo batchTaskInfo)
Parameters
Type Name Description
NSBatchTaskInfo batchTaskInfo

The updated information to save.

Returns
Type Description
NSBatchTaskInfo

The updated BatchTaskInfo.

Remarks

Only the following properties can be updated: State, Description, Response and Request.

Examples
NSBatchAgent agent;
NSBatchTaskInfo batchTaskInfo;
NSBatchTaskInfo res = agent.UpdateBatchTask(batchTaskInfo);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top