Unverified Commit cef7c463 authored by Fabien Viale's avatar Fabien Viale Committed by GitHub
Browse files

Merge pull request #766 from fviale/master

Documentation for global variables and generic info
parents fc9802c1 386c9f5b
......@@ -889,6 +889,86 @@ ENC(xtlMWGd0ZK/EzTMyrgPiPw==)
The encrypted value can then be used as displayed by the `encrypt` command, for example, in *PROACTIVE_HOME/config/scheduler/database.properties*:
`hibernate.connection.password=ENC(xtlMWGd0ZK/EzTMyrgPiPw==)`
=== Configure Global Variables and Generic Information
ProActive Server allows to configure workflow variables or generic information that will apply to all submitted workflows or to some categories of workflows (e.g. workflows with a given name).
This configuration is available in the file *PROACTIVE_HOME/config/scheduler/global_variables.xml*.
The default configuration is the following:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<globalvariables
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:proactive:globalvariables:3.13" xsi:schemaLocation="urn:proactive:globalvariables:3.13 http://www.activeeon.com/public_content/schemas/proactive/globalvariables/3.13/globalvariables.xsd">
<filter>
<select>
<!-- Xpath expressions are used to filter workflows affected by global variables.
Example: to select workflows belonging to the basic-examples bucket
<xpath><![CDATA[/job/genericInformation/info[@name='bucketName' and @value='basic-examples']]]></xpath>
-->
<xpath><![CDATA[.]]></xpath>
<!-- more than one xpath expression can be added. In that case, global variables are applied when all xpath expressions match -->
</select>
<!-- add global variables or generic information below -->
<variables>
</variables>
<genericInformation>
</genericInformation>
</filter>
<!-- Multiple filters can be added, to apply different set of global variables to different workflows -->
</globalvariables>
```
This configuration file is composed of `<filter>` sections. Each filter section describes the global variables and generic information that will be added to a certain category of workflows.
Multiple filter sections allow to add different lists of variables to different types of workflows.
A `<filter>` section contains the following subsections:
* `<select>`: it contains one or more https://en.wikipedia.org/wiki/XPath[xpath] expressions to filter workflow according to xml rules.
In order to select a given workflow, the xpath expression evaluated on this workflow must return a non-empty node set (see xpath documentation). The default xpath expression `<xpath><![CDATA[.]]></xpath>` selects any workflow.
If multiple xpath expressions are included, a given workflow must satisfy all expressions in order to be selected. Examples of `<select>` section:
+
.Select all workflows with name="CronJob"
[source,xml]
----
<select>
<xpath><![CDATA[/job[@name='CronJob']]]></xpath>
</select>
----
+
.Select all workflows in the "basic-examples" catalog bucket
[source,xml]
----
<select>
<xpath><![CDATA[/job/genericInformation/info[@name='bucketName' and @value='basic-examples']]]></xpath>
</select>
----
* `<variables>`: it contains the list of variables that will be added to the selected workflows. The format of this section corresponds to the same format as the `<variables>` section in the ProActive workflow XML definition. See link:../user/ProActiveUserGuide.html#_job_variables[Job Variables] for a description of this format.
* `<genericInformation>`: it contains the list of generic information that will be added to the selected workflows. The format of this section corresponds to the same format as the `<genericInformation>` section in the ProActive workflow XML definition. See link:../user/ProActiveUserGuide.html#_generic_information[Generic Information] for a description of this format.
The following important rules apply to global variables and generic information:
* *Global variables reload*: the definition of global variables and generic information is reloaded every 10 minutes by the ProActive server. It is thus possible to modify the *PROACTIVE_HOME/config/scheduler/global_variables.xml* configuration and have the modifications taken into account without restarting the server.
* *Masking rule*: if a global variable named `VAR1` is defined and a workflow which contains the same variable is submitted, then the definition of `VAR1` inside the workflow will take precedence over the global variable.
* *Variable references*: a global variable can reference another global variable using the `${VAR_NAME}` syntax. A global generic information can also reference a global variable (but a global generic information cannot reference another global generic information). Examples:
+
[source,xml]
----
<variables>
<variable name="var1" value="value" model=""/>
<variable name="var2" value="some_${var2}" model=""/> <!-- var2 references var1 -->
</variables>
<genericInformation>
<info name="ginfo1" value="${var1}"/> <!-- ginfo1 references var1 -->
<info name="ginfo2" value="${ginfo1}"/> <!-- INVALID, a generic information cannot reference another generic info-->
</genericInformation>
----
== User Authentication
In order to use ProActive Scheduler every user must have an account. It supports three methods for authentication:
......
......@@ -22,7 +22,11 @@ For example:
</task>
----
The following table describes all availabe generic information:
Some generic information can also be configured globally on the ProActive server. These *global generic information* will then apply to all submitted workflows or to certain categories of workflows (e.g. workflows with a given name). Global generic information are *job-level* only.
See link:../admin/ProActiveAdminGuide.html#_configure_global_variables_and_generic_information[Configure Global Variables and Generic Information] section to understand how global generic information can be configured on the ProActive server.
The following table describes all available generic information:
.Generic Information
|===
......
......@@ -84,6 +84,11 @@ Task variables can be used similarly to job variables using the pattern `${varia
Task variables override job variables, this means that if a job variable and a task variable are defined with the same name, the task variable value will be used inside the task, and the job variable value will be used elsewhere in the job.
===== Global Variables
Global variables are *job variables* that are configured inside ProActive server and apply to all workflows or to certain categories of workflows (e.g. workflows with a given name).
See link:../admin/ProActiveAdminGuide.html#_configure_global_variables_and_generic_information[Configure Global Variables and Generic Information] section to understand how global variables can be configured on the ProActive server.
===== Variable Model
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment