1.2.12 OcaTaskAgent

Class Hierarchy:

OcaRoot : OcaAgent : OcaTaskAgent

class OcaTaskAgent : OcaAgent

Task scheduler. Holds a queue of task-program pairs to be executed under specific future conditions.

Properties:

OcaBoolean Blocked

If value is TRUE, the task agent is allowed to complete any work in progress, but is prevented from accepting any new work. When TRUE, the methods ActionPrepare, ActionRun, and ActionStart will fail with OcaStatus = ProcessingFailed.

This property has id 3.5.

static const OcaClassID ClassID = "1.2.12"

Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the OcaRoot property.

This property has id 1.1.

static const OcaClassVersionNumber ClassVersion = 1

Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the OcaRoot property.

This property has id 1.2.

OcaONo ExecutableONo

ONo of OcaProgram or OcaCommandSet assigned to this task. Set by the ActionPrepare(…) and ActionRun(…) methods. Value is zero if no OcaProgram or OcaCommandSet is attached. or zero if no executable is assigned.

This property has id 3.1.

OcaBlob ExecutionParameters

Application-specific parameters for running the executable, as set by the methods ActionPrepare(…) and ActionRun(…). Value is an empty blob if**** if no execution is pending. or in progress.

This property has id 3.3.

OcaID16 GroupID

ID of group the task is in, or zero if it isn’t in a group

This property has id 3.2.

OcaTaskOperationalState OperationalState

Operational state of this agent’s task = {generic state, task-specific blob} .

This property has id 3.6.

OcaProgramRunMode RunMode

Run mode as set by the methods ActionPrepare(…) and ActionRun(…). Value is None if no execution is pending or in progress.

This property has id 3.4.

Properties inherited from 1.2 OcaAgent:

Methods:

OcaStatus ActionPrepare(OcaONo Program, OcaBlob ExecutionParameters, OcaProgramRunMode RunMode)

Prepares task for program execution, but does not start execution. Sets ExecutableONo and ExecutionParameters. Changes state from NotPrepared to Ready. If property .Blocked is TRUE, does nothing and returns status of ProcessingFailed.

This method has id 3.1.

OcaStatus ActionRun(OcaONo Program, OcaBlob ExecutionParameters, OcaProgramRunMode RunMode)

Execute the given program immediately. Sets ExecutableONo and ExecutionParameters. Changes state from NotPrepared to Running. If property .Blocked is TRUE, does nothing and returns status of ProcessingFailed.

This method has id 3.2.

OcaStatus ActionStart()

Executes the prepared program. Changes state from Ready to Running. If property .Blocked is TRUE, does nothing and returns status of ProcessingFailed.

This method has id 3.3.

OcaStatus ActionStop()

Requests orderly termination of running program. Changes state from Running to Stopping. When termination is complete, state changes from Stopping to Ended.

This method has id 3.4.

OcaStatus ActionReset()

Resets all internal states to their values at start of execution. Forces immediate termination of running or stopping program. Changes state from Running, Stopping, or Ended to Ready.

This method has id 3.5.

OcaStatus ActionClear()

Clears all memory of program and program execution from the task agent. Forces immediate termination of running or stopping program. Changes state from Running, Stopping, or Ended to NotPrepared. ** Sets property **ExecutableONo to zero, property ExecutionParameters to a null blob, and property RunMode to None.

This method has id 3.6.

OcaStatus GetBlocked(OcaBoolean &Blocked)

Gets property Blocked.

This method has id 3.7.

OcaStatus SetBlocked(OcaBoolean Blocked)

Sets the Blocked property.

This method has id 3.8.

OcaStatus GetOperationalState(OcaTaskOperationalState &State)

Gets value of the OperationalState property.

This method has id 3.9.

  • State: Output parameter.

OcaStatus GetExecutableONo(OcaONo &ONo)

Gets value of ExecutableONo property, as set by the ActionPrepare(…) and ActionRun(…) methods. Returns zero if no execution is pending or in progress.

This method has id 3.10.

  • ONo: Output parameter.

OcaStatus GetExecutionParameters(OcaBlob &Parameters)

Gets value of ExecutionParameters property, as set by the ActionPrepare(…) and ActionRun(…) methods. Returns an empty blob if no execution is pending or in progress.

This method has id 3.11.

OcaStatus GetRunMode(OcaProgramRunMode &RunMode)

Gets the value of the RunMode property, as set by the ActionPrepare(…) and ActionRun(…) methods. Returns the value None if no execution is pending or in progress.

This method has id 3.12.

Methods inherited from 1.2 OcaAgent:

Events:

void ExecutionTerminated(OcaTaskExecutionTerminatedEventData EventData)

Event raised when execution terminates for any reason.

This event has id 3.1.