<source><name>Hemi.task</name><project><name>Hemi JavaScript Framework</name><url-title>Hemi JavaScript Framework Project</url-title><url>/Hemi/</url></project><package><path>Hemi.task</path><library>Hemi</library><description>The Task Service coordinates various actions and handlers and dependencies.  Tasks are excellent bootstraps for multiple asynchronous operations.</description><static-class><name>service</name><description>Static instance of serviceImpl.</description><version>3.1.9</version></static-class><class><name>TaskServiceImpl</name><description>A service for managing asynchronous and dependency-driven actions.</description><version>3.1.9</version><object><name>Task</name><property name="task_state" type="int">Current state of the task.  State ranges from 0 to 5.</property><property name="handled" type="boolean">Bit indicating the task has been handled.</property><property name="service_id" type="String">The unique identifier of the service to which this task belongs.</property><property name="task_id" type="String">The unique task identifier.</property><property name="transaction_id" type="String">The transaction identifier for this task.</property><property name="index" type="int">The index of this task in the TaskService tasks array.</property><property name="task_name" type="String">The name of the task.</property><property name="action_type" type="String">The type of action this task performs.  Supported types are: xml, task, import-task, event, script, and function.</property><property name="action" type="String">The action this task performs, based on the <i>action_type</i>.</property><property name="handler_type" type="String">The type of handler this task performs.  Supported types are: xml, task, import-task, event, script, and function.</property><property name="handler" type="String">The handler this task performs, based on the <i>handler_type</i>.</property><property name="data" type="variant">The data associated with the task.</property><property name="depends" type="array">Array of identifiers representing dependencies that must be completed before the task can be handled.</property><property name="executed" type="boolean">Bit indicating the task has been executed.</property><property name="processor" type="function">Task pre-processor for manipulating XML data prior to the task being evaluated.</property><property name="busy" type="boolean">Bit indicating the task is busy working on its action or handler.</property><property name="parent_id" type="String">The identifier of the parent task, which depends on this task to complete.</property><property name="parameters" type="array">Array of parameters, used as function arguments or general shared task configuration.</property><property name="module" type="Module">For evaluated script statements, a module instance is created and a reference is stored on this property.</property><property name="component" type="Component">A framework component.</property><property name="moduleName" type="String">Name assigned to the module base.</property><method><name>setAutoDestroy</name><param name="b" type="boolean">Bit indicating the task should be destroyed once it is completed.</param></method></object><method><name>isTask</name><param name="i" type="variant">Name or index of the Task object..</param><return-value name="b" type="boolean">Bit indicating whether the specified object name exists.</return-value><description>Returns true if the specified name exists.</description></method><method><name>getTasks</name><return-value name="a" type="array">Array of Task objects.</return-value><description>Returns an array of Task objects.</description></method><method><name>getTask</name><param name="i" type="int">Index of the Task object..</param><return-value name="e" type="Task">XHTMLForm object.</return-value><description>Returns the specified Task object.</description></method><method><name>getTaskByName</name><param name="n" type="String">Name of the element.</param><return-value name="e" type="Task">Task object.</return-value><description>Returns the specified Task object.</description></method><method internal="1"><name>newTaskObject</name><param name="n" type="String">Unique task name.</param><param name="at" type="String">Action type.</param><param name="a" type="String">Action, based on type.  Example: Action type of function would be a function name (not evaluatable)</param><param name="ht" type="String">Handler type.</param><param name="h" type="String">Handler, based on type.</param><param name="k" type="String">Task id.</param><param name="i" type="int">Task index.</param><param name="r" type="String">Transaction id.</param><param name="p" type="function">Task pre-prococessor.</param><return-value type="TaskObject" name="t">Returns a new TaskObject.</return-value><description>Creates a new task object.</description></method><method><name>endTask</name><param name="v" type="Variant">TaskObject or task identifier.</param><param name="b" type="Boolean">Bit indicating that all task dependencies should be removed from the cleared dependencies list.</param><return-value type="boolean" name="t">Returns true if the task was ended.</return-value><description>End task returns all named dependencies for the task, and then invokes clearTask.</description></method><method><name>clearTask</name><param name="v" type="Variant">TaskObject or task identifier.</param><return-value type="boolean" name="t">Returns true if the task was cleared or slated to be cleared, or otherwise false.</return-value><description>Clears the specified task and removes the TaskObject.  If the task is still in operation, auto destroy is enabled and the task will continue to function.</description></method><method><name>clearAllTasks</name><description>Clears all tasks.  Any task that is still in operation will be unceremoniously removed from operation, as opposed to <i>clearTask</i> which allows the task to continue current operation until it's finished.</description></method><method><name>destroy</name><description>Prepares this object for destruction.  All tasks will be cleared.</description></method><method><name>sigterm</name><description>Sends a termination signal to this object.</description></method><method><name>isExternalLoaded</name><return-value type="boolean" name="b">Bit indicating whether an external task list has been loaded.</return-value><description>Returns true if any external task list has been loaded, false otherwise.</description></method><method><name>addTaskDependency</name><param name="t" type="TaskObject">A Task object.</param><param name="d" type="String">Name of the dependency.</param><return-value name="a" type="boolean">Bit indicating whether the dependency was added.</return-value><description>Adds a dependency to a Task object.</description></method><method><name>getTaskDepends</name><param name="t" type="TaskObject">A Task object.</param><return-value name="a" type="array">Array of task dependency names.</return-value><description>Returns a copy of the dependency names for this task.</description></method><method><name>returnDependency</name><param name="v" type="variant">A Task object, task name, or dependency name.</param><description>Returns the specified depency name or dependent task name, causing all tasks identifying this dependency to be updated.  If the returned dependency is a task, the task is forced closed regardless of whether its action or handler were executed.</description></method><method><name>clearDependency</name><param name="v" type="variant">A Task object, task name, or dependency name.</param><description>Removes the specified dependency, regardless of whether it was resolved or completed.</description></method><method><name>HP</name><param name="s" type="TaskService">A Task Service object.</param><param name="o" type="Task">A Parent Task object.</param><param name="n" type="name">A Task name.</param><param name="v" type="value">A variant value.</param><return-value type="String" name="c">The processed value</return-value><description>Returns the evaluated token value.</description></method><method><name>isTaskComplete</name><param name="o" type="Task">A Task object.</param><return-value type="boolean" name="c">Bit indicating whether the task was completed.</return-value><description>Returns whether or not the task was completed.</description></method><method><name>serveTaskTransaction</name><param name="o" type="Task">A Task object.</param><description>Forces the transaction that drives the Task object to serve the corresponding TransactionPacket.  This is used when a Task object is thought to be stuck due to some uncaught exception in its action, handler, or dependencies.  Alternately, use the advance method.</description></method><method><name>executeTaskHandler</name><param name="o" type="Task">A Task object.</param><return-value type="boolean" name="b">Bit indicating whether the handler was executed.</return-value><description>Forces the task handler to be executed, and positioning the task to be in a completed state.</description></method><method><name>executeTaskHandlerByName</name><param name="n" type="String">The name of a task object.</param><return-value type="boolean" name="b">Bit indicating whether the handler was executed.</return-value><description>Forces the task handler to be executed, and positioning the task to be in a completed state.</description></method><method><name>executeTaskByName</name><param name="n" type="String">The name of a task object.</param><return-value type="boolean" name="b">Bit indicating whether the task action was executed.</return-value><description>Forces the task action to be executed.</description></method><method><name>executeTask</name><param name="o" type="Task">A Task object.</param><return-value type="boolean" name="b">Bit indicating whether the task action was executed.</return-value><description>Forces the task action to be executed.</description></method><method><name>importTaskFromXML</name><param name="n" type="variant">XML Node representing a task, or a String naming a task.</param><param name="o" type="TaskObject" optional="1">Parent task, which would be made dependent on this task.</param><param type="DOMDocument" name="d">The XML Document from which the XML Node originated.</param><param type="boolean" name="b">Bit indicating the task should be executed immediately.</param><description>Creates a TaskObject from the specified XML Node.</description></method>
alert(a);
<method><name>executeTaskLoader</name><param name="n" type="String">Task name.</param><param name="at" type="String">Action type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="a" type="variant">Task action, based on specified action type.</param><param name="ht" type="String">Handler type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="h" type="variant">Task handler, based on specified action type.</param><param name="f" type="function" optional="1">Dependency pre-processor used to resolve tokenized values for xml import tasks.</param><return-value name="o" type="TaskObject">New Task object.</return-value><description>Convenience method for adding and immediately executing a task.  Used as a driver to launch other task lists by the Space service.  Invokes <i>addTaskLoader</i>.</description></method><method><name>addTaskLoader</name><param name="n" type="String">Task name.</param><param name="at" type="String">Action type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="a" type="variant">Task action, based on specified action type.</param><param name="ht" type="String">Handler type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="h" type="variant">Task handler, based on specified action type.</param><param name="f" type="function" optional="1">Dependency pre-processor used to resolve tokenized values for xml import tasks.</param><return-value name="o" type="TaskObject">New Task object.</return-value><description>Convenience method for adding a task that overrides the default task loader name.</description></method><method><name>addTask</name><param name="n" type="String">Task name.</param><param name="at" type="String">Action type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="a" type="variant">Task action, based on specified action type.</param><param name="ht" type="String">Handler type. Supported types are: xml, task, import-task, event, script, and function.</param><param name="h" type="variant">Task handler, based on specified action type.</param><param name="f" type="function" optional="1">Dependency pre-processor used to resolve tokenized values for xml import tasks.</param><return-value name="o" type="TaskObject">New Task object.</return-value><description>Adds a new task.</description></method><method internal="1"><name>doTransaction</name><param name="s" type="TransactionService">TransactionService managing this transaction.</param><param name="p" type="TransactionPacket">TransactionPacket used to monitor the task state.</param><description>Invoked by TransactionService as a TransactionParticipant.</description></method>
return 1;
return 1;
return 1;
return 0;
alert('ev=' + z);
return 0;
_m.sendMessage("Moving task " + o.task_name + " state to " + o.task_state, "511.1");
return 0;
<method internal="1"><name>Advance</name><param name="o" type="Task">A task object</param><param name="b" type="boolean">Bit indicating whether the state should advance.</param><param name="s" type="boolean">Bit indicating whether the task transaction should be served.</param><description>Advances the task state based on the condition.</description></method><method virtual="1"><name>RunTaskScript</name><param name="oTask" type="Task">Task object.</param><return-value type="boolean" name="bCompleted">Boolean indicating whether the script successfully completed.  If not true, the task will become stuck and the advance method must be used to move the task forward.</return-value><description>Invoked for JavaScript defined as a task action or handler, either inline or as CDATA.  Script contents support the following tokens: ${taskservice}, ${taskservice.id}, ${task}, and ${task.name}.</description></method><method internal="1"><name>DecorateModuleContent</name><param name="sName" type="String">Name of the Module</param><param name="sPath" type="String">Path to the Module</param><param name="sRaw" type="String">The raw imported text of the module.</param><return-value type="String" name="sDecoration">A value to be included in the module prior to the module being instantiated.</return-value><description>Decorates the task script for use as a module and with the virtual RunTaskScript function.</description></method><method internal="1"><name>startTransaction</name><param name="s" type="TransactionService">TransactionService managing this transaction.</param><param name="p" type="TransactionPacket">TransactionPacket used to monitor the task state.</param><description>Invoked by TransactionService as a TransactionParticipant.</description></method><method internal="1"><name>endTransaction</name><param name="s" type="TransactionService">TransactionService managing this transaction.</param><param name="p" type="TransactionPacket">TransactionPacket used to monitor the task state.</param><description>Invoked by TransactionService as a TransactionParticipant.</description></method></class></package><index><description>The Task Service coordinates various actions and handlers and dependencies.  Tasks are excellent bootstraps for multiple asynchronous operations.</description><url>Hemi_api.html</url><url-title>API Index</url-title></index></source>
