...
For another example, assume your action sequence is called global-department-list.xaction
, it exists in the repository under bi-developers/secure
, you want the action sequence to run when the system starts up with the output placed in global scope, and you want the output of the action sequence to be available in a portlet, then your addition to sessionStartupActions.xml would look like this:
Code Block | ||||
---|---|---|---|---|
| ||||
<bean class="org.pentaho.platform.engine.core.system.SessionStartupAction"> <property name="sessionType" value="org.pentaho.platform.webengine.security.portalsession.PentahoPortletSessionTrustedSystemStartupSession"/> <property name="actionPath" value="bi-developers/secure/global-department-list.xaction"/> <property name="actionOutputScope" value="global"/> </bean> |
...
- We make the output of the action sequence available to portlets by specifying a
sessionType
oforg.pentaho.platform.web.portal.PentahoPortletSession
. - We make the output of the action sequence available to servlets/jsps by specifying a
sessionType
oforg.pentaho.platform.web.http.session.PentahoHttpSession
. - We make the action sequence run at system start time and make output available in global scope by specifying an
actionOutputScope
ofglobal
and specify asessionType
oforg.pentaho.platform.engine.security.session.TrustedSystemStartupSession
. - We make the action sequence run at session start time and make output available in session scope by specifying an
actionOutputScope
ofsession
. - We identify the name and location of our action sequence by specifying
actionPath
.
...
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.
...
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 "heavy" result set to in our session. We only need the string from the result set with the region name. 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:
...