User Tools

Site Tools


SET PROTOTYPE ACTION

Guide Section: SET PROTOTYPE ACTION | EASAP Tree: EVENT PROCESSING Branch


SET PROTOTYPE ACTION is an advanced feature used to manipulate LIST's and SCALAR's and trigger ACTION's using the Java-like scripting language Groovy.

In addition to the Essential Parameters, one of either File: or Text: parameters must contain the Groovy source script.

There must be at least one use of each object listed in Parameters:, Outputs:, and Action Parameters:.

Groovy API Documentation is a useful reference.

SET PROTOTYPE ACTION
Essential Parameters:
Parameters:Input LIST's and SCALAR's available by name in the script block.
Outputs:Declaration of new object references that will contain the output from a Groovy script
Optional Parameters:
Text:The Groovy script text to run.
File:A file containing the Groovy script text.
Action Parameters: Names of ACTION GROUP's available to be .run(); by the script. (example below)
Do If:Script executed if this evaluates to 'TRUE'

Below are two examples: the first shows a simple Groovy script, the second shows the use of Action Parameters:


Simple Groovy Example

Below is a simple Groovy script in an EASAP to allow the user to enter a person's name and the script creates a greeting which is displayed in a LABEL.

This example creates an EASAP with the interface below:

  • an INPUTBOX for entering a person's name
  • a BUTTON with
    • a Child SET PROTOTYPE ACTION
  • a LABEL to display the output DOR, groovyDOR.



First set up an EASAP with the objects below:



  • For menu-action1
    • Set Menu Action: 'Refresh'

This insures that values are refreshed following the script execution.

  • For set_prototype1 set parameters below:

The EASAP executes as follows:

  • User enters a name
  • button1 triggers set_prototype1
    • Groovy concatenates 'hello ' with the inputbox1
    • result is returned as groovyDOR.
  • menu_action1 refreshes all DORs
  • groovyDOR is displayed in a LABEL

Groovy example using Action Parameters:

The Tree below outlines an EASAP that:

  • opens a browser (action_group1) when a TABBED PANE is selected
  • a BUTTON triggers a SET PROTOTYPE ACTION
    • the Groovy script in Text: runs which:
      • assigns inputbox1 to output
      • calls action_group1.run()

This scripts requires Parameters:, Outputs: and Action Parameters: to be declared as they are in the screenshot below.


Page Tools