Skip to main content
Kinetic Community

Task Handler Structure

Brief walk through of the structure of common Task Handlers

Directory Hierarchy

kineticTask\tasks\

·         taskHandlerName\

o    handler

o    process

o    test

Handler Code (handler/init.rb)

Standalone specific piece of code designed to be simply configured to perform a business task. Tasks take parameters, return results and can throw exceptions in the event of an error.

Handler Methods

initialize

  • Initialize the handler, pre-load form definitions and load parameter/parameter value hashes

execute

  • This is a required method that is automatically called by the Kinetic Task Engine
  • Returns an Xml formatted String representing the return variable results

preinitialize_on_first_load

  • Preinitialize expensive operations that are not task node dependent

escape

  • used to escape results values (returned in execute) that would cause the XML to be invalid

get_info_value

  • for retrieving  info.xml values from the input document

Handler Input (process/node.xml)

  • The Task Engine is responsible for gathering information, building and passing an “Input Document” to the Task Handler upon execution.  This node.xml file defines the content and locations of the data elements to be gathered by the Task Engine.
  • Establishes Task Name and contains the description which is made visible on the Task Builder.
  • Defines the parameters for display on the node when configuring in the Task Builder.
  • Defines hash of parameter names to parameter values which can be utilized by the Task Handler.
  • Defines hash of info values.  These are the static values configured as part of the info.xml file.
  • Defines hash of field values and field name mapping values to a Remedy form or external table structure, also utilized by the Task Handler. 

Handler Configuration (process/info.xml)

  • Defines static parameter and parameter values defined for the Task Handler process.
  • Values are configured using the Task Management console as part of the Task Handler import process.

Handler Configuration (test/)

  • Defines static parameter and parameter values defined for the Task Handler process.
  • Values are configured using the Task Management console as part of the Task Handler import process.

Describe additional details and how to use the Feature.