Click or drag to resize

WorkerShell class

Encapsulates the call of an external work routine, which are generated in response to a defined change in the tree state (TreeEvent) is executed as an external exe (fire and forget) TODO: later possibly also realise as lightweight Dll plugin.
Inheritance hierarchy
SystemObject
  LogicalTaskTreeNodeShellBase
    LogicalTaskTreeWorkerShell

Namespace: LogicalTaskTree
Assembly: LogicalTaskTree (in LogicalTaskTree.dll) Version: 1.0.0+df0404e911d6c38eaed3bb1bb1acfc482d417643
Syntax
public class WorkerShell : NodeShellBase,
	 
	INodeWorker

The WorkerShell Type exposes the following members.

Constructors
 NameDescription of the
Public MethodWorkerShell(String, XElement) constructor - takes over the path to the worker exe, and a parameter string that is used for the call of the exe is also transferred. The parameter string can be any string defined by The following placeholders can be resolved in the program session which are replaced by current runtime values when the worker exe is called: "%Event%" = Name of the event that led to the worker being called, "%Source%" = Source of the event (node in which the event first occurred), "%Sender%" = Node that is currently calling the worker due to the event, "%Timestamp%" = current date with current time in the format "dd.MM.yyyy HH.mm.ss", "%Logical%" = current logical value of the transmitter, "%Exception%" = Exception.Message, if %Event% is "Exception", otherwise "".
Public MethodWorkerShell(String, XElement, Boolean, INodeTrigger) constructor - takes over the path to the worker exe, and a parameter string that is used for the call of the exe is also transferred. Optionally, a trigger can also be transferred, which repeatedly calls a worker once it has been activated. In addition to any placeholders that can be resolved by the program session, the parameter string can contain contain the following placeholders, which are replaced by current runtime values when the worker exe is called be replaced: "%Event%" = Name of the event that led to the worker being called, "%Source%" = Source of the event (node in which the event first occurred), "%Sender%" = Node that is currently calling the worker due to the event, "%Timestamp%" = current date with current time in the format "dd.MM.yyyy HH.mm.ss", "%Logical%" = current logical value of the transmitter, "%Exception%" = Exception.Message, if %Event% is "Exception", otherwise "".
Back to the top
Properties
 NameDescription of the
Protected PropertyCanRunDll Dll with the instance of ICanRun. If available, CanRun is started before every of a node is called. If CanRun returns false, the start is cancelled. In CanRun, the parameters transferred via ref can also be be modified.
(Inherited from NodeShellBase)
Public PropertyCanRunDllPath Path to an optional dll that provides an ICanRun instance. If available, before each run of the associated checker or worker CanRun is called. If CanRun returns false, the start is cancelled. The parameters transferred can also be modified in CanRun.
(Inherited from NodeShellBase)
Public PropertySlavePathName The exe. to be called when the state of Logical changes.
Public PropertyTransportByFile If True, the parameters are transferred via an XML file, otherwise via the command line; Default: false.
Public PropertyTrigger An optional trigger that calls the job repeatedly or null. Is provided by the IJobProvider during instantiation.
Public PropertyWorkerState Condition of the worker. None, Valid, Invalid.
Back to the top
Methods
 NameDescription of the
Public MethodBreakExec Cancel the task. Cancel Worker Scheduler (not the worker!) via CancellationToken.
Public MethodCanRun Is used by Vishnu before each run of a Checker, Worker or before Start a trigger is called up. Returns true if the run/start can be executed.
(Inherited from NodeShellBase)
Public MethodExec Starts a responsible worker after a defined state has been reached. (TreEvent) in the tree has changed. A separate task is started internally for each Exec.
Public MethodExists Returns True if the SlavePathName exists and access is possible.
Back to the top
Remarks
File: WorkerShell.cs Author: Erik Nagel 01.03.2013 Erik Nagel: created
See also