...
A system action is simply an action sequence that is configured to run either at system start time (i.e. when the application server starts) or session start time (i.e. when the user logs in). The output of a system action is available to other action sequences as input parameters. System actions are configured by adding the appropriate child elements to the <system-action>
element in the pentaho.xml file.
----------------------- - what to do with this junk? -------------
Info | ||
---|---|---|
| ||
TODO |
...
This code simply maps the user's login name to the user's full name, and places the full name in a JavaScript variable called fullName
. fullName
will be available to the next Action action in our action sequence.
We still need to identify name
from the Process Inputs tree control as an input to our JavaScript action. Click on the Add control in the Script Inputs editor, and select name
.
We also need to identify the fullName
variable from our JavaScript code as an output from our JavaScript action. To do this, click in the Script Outputs editor, type in fullName
, and identify its type as string
.
TODO: In the SampleData database, there is a table called DEPARTMENT_MANAGERS. The table has the columns MANAGER_NAME, REGION, and EMAIL. We will use the fullName parameter from the previous
Now that we have the fullname
as an output parameter, we can use that parameter in the next action to discover the region that the manager is responsible for.
...
Specify the Result Set Name as RS_MANAGERS_REGION
. And make sure Keep Connection Open is unchecked. The values from the result set will be available to us in our next action. (TODO: explanation about the checkbox)
Info | ||
---|---|---|
| ||
We now have the name of the region that the manager is responsible for, but it is still in the result set. We don't want to keep the relatively large result set in our user session when all we really need is just a simple string. We can use another JavaScript action to get the region string out of our result set, and then store the region string into our session.
In the Process Actions tree control, click on the Add control and select Generate Data From -> JavaScript.
Since we need access to the result set from the previous action, in the Scripts Input, click on the Add control and select RS_MANAGERS_REGION.
Next, add the following code in the JavaScript editor:
...