Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
titleWhat is session and global scope?

TODO

...

Info
titleLet's Break it Down

Let's break it down a bit using the previous examples.

  • We make the output of the action sequence available to portlets by creating the XML element <org.pentaho.ui.portlet.PentahoHttpSession>.
  • We make the output of the action sequence available to servlets/jsps by creating the XML element <org.pentaho.core.session.PentahoHttpSession>.
  • We make the action sequence run at system start time and make output available in global scope by adding the scope="global" attribute to our element.
  • We make the action sequence run at session start time and make output available in session scope by adding the scope="session" attribute to our element.
  • We identify the name and location of our action sequence by adding samples/filters/setCompanyName.xaction as a child text node of our xml element.

...

In this example we'll develop an action sequence to generate an HTML report containing financial data for the current user's region. This suggests that when the user logs in, we need to identify the user's region, and store this information someplace that we can user use later in our action sequence.
To identify the user's region, let's create a new action sequence in Eclipse using the action sequence editor.

Name the action sequence usernameToRegion.xaction, and place it in the samples/filters folder of the repository.

Info
titleThe BI Platform Repository

The repository is where resources, like

...

action sequence definition documents are stored in the Pentaho BI Platform. The Platform has a variety of repository implementations. The repository used by the Pentaho Preconfigured Install is a file system repository, and it is located in the pentaho-solutions folder of the Preconfigured Install.

<TODO: link to doc with info about repository> 
Next, in the action sequence editor, add an input called name to the Process Inputs tree control. Configure it to be of type string, and define its scope to be session. 

When the user logs into the BI Platform, the platform places a parameter called name in into the session scope. name is the user name that was used to log into the platform. We can get access to this parameter by defining it as an input to our action sequence.<TODO: identify other parameters provided by the platform.> 
Next we'll add

The DEPARTMENT_MANAGERS table of the SampleData database has the columns MANAGER_NAME, REGION, and EMAIL. MANAGER_NAME is the full name of the manager. We need a mechanism for mapping the user's login name to their fullname. We can then use a SQL query in an action sequence to discover the user's region.

We'll do this by adding a JavaScript action to our action sequence. Using the Process Actions tree control in the action sequence editor, click on the Add control (blue + sign with a triangle next to it), and select Generate Data From -> JavaScript. In the JavaScript editor, add this JavaScript code:

...

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 action to discover the region that the manager is responsible for.

...