May 25, 2015

UCS Director - Custom Task

The platform is built on Javascript (Cloupia is based on Javascript Rhino – a server side language that is a mixture of Java and Javascript).
Rhino : JavaScript Library For Java
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. It is embedded in J2SE 6 as the default Java scripting engine.

Invoking other tasks from a custom task: "Inner task"
Either Pre-built or other Custom tasks can be invoked from a Custom Task.

• Inner Tasks produce the log messages to current SR.
• Inner tasks register object changes to current SR
• Inner tasks register “undo” tasks to current SR (so Rollback will work correctly)
• Inner task output is not automatically visible outside the Custom Task. Script developer must
explicitly save it using ‘output.X = Y’ expression
• Each custom task can invoke multiple inner tasks
• Each custom task may may invoke an inner task in a loop
• If inner task fails, outer Custom Task automatically fails.
• This can be modified by using ‘try { } catch(e) { } ‘ block

Obtain from the Task library show/hide script

Custom Task;

  • Provides the ability to add new workflow tasks with well defined inouts & outputs
  • once a custom task is properly created these is no inherent difference in behaviour for 'built-in tasks' and 'custom tasks'
  • Implementation of the logic is done through a script
  • A custom task feature allows users to create a new custom task off of any system and modify or add inputs and outputs of an existing task
  • Typically uses the implicit objects ctxt, logger, util, inout and output
  • Can be exported/imported as custom tasks