Batch process prioritization

In the base configuration, Guidewire provides an implementation of a lightweight strategy to prioritize the running of batch processes within the PolicyCenter cluster. File batch-process-config.xml provides a way to control the execution of multiple batch processes. This file has the following syntax:
<batch-process-config>

  <setting defaultServer="server_ID" env="environment" startupDelay="delay_list" startup-Timeout=n 
        pollInterval=n/>
  <param name="parameter_name" value="parameter_value" env="environment"/>
  <batch-process typecode="type_code" env="environment" server="server_ID">
      <param name="parameter_name" value="parameter_value" env="environment"/>
  </batch-process>

</batch-process-config>
The following table describes the attributes on the <settings> element.

Element

Attribute

Required

Description

settings

defaultServer

Yes

Prefaced by the # (hashtag) symbol, this value specifies a server role. For example, defaultServer="#batch" means that every cluster member with the batch role is capable of running batch processes.

Without the # symbol, this value specifies a server ID. For example, defaultServer="node1" means that the cluster member defined in the <registry> element in config.xml as serverid=node1 is capable of running batch processes.

pollInterval

Yes

Time, in seconds, between polling the database for new available leases.

PolicyCenter also broadcasts information on new batch process leases. See Simple lease management lifecycle for a batch process for more information.

startupDelay

Yes

Number of seconds the batch process manager has to wait before starting the next process. The delay is dependent on the number of already running batch processes on the current server. In the base configuration, Guidewire sets this value to the following:

  "0, 5, 15, 90, 180"

These values have the following meaning:

    0 – Start the first process immediately

    5 – Start the second process after 5 seconds 

  15 – Start the third process after 15 seconds

  90 – Start the fourth process after 90 seconds

180 – Start the fifth and all subsequent processes after 180 seconds

startupTimeout

Yes

Number of seconds allotted for a batch process to acquire a lease. If the time expires without the batch process acquiring the lease, PolicyCenter generates an error message similar to the following text (600 is the default value):
  • ERROR Server.BatchProcess No one started batch process after 600 seconds

env

No

Use to assign values for distinct installation environments. If used, this <settings> element applies only to the listed environments. To apply a specific <settings> element to multiple environments, input multiple comma-separated values for the env attribute. A multi-valued env attribute eliminates the need for a separate <settings> element for each environment.

The following table describes the attributes on the optional <param> element.

Element

Attribute

Required

Description

param

name

Yes

Name of the parameter. The only valid value is RetryIfInitialConditionsFail.

value

Yes

Boolean value of RetryIfInitialConditionsFail.

env

No

Use to assign a different value for RetryIfInitialConditionsFail to distinct installation environments or batch processes.

The following table describes the attributes on the <batch-process> element. The <batch-process> element also contains an optional <param> element that has the same meaning as listed in the previous table. If you set the RetryIfInitialConditionsFail parameter at the individual batch process level, it overrides any default value for this parameter set at the global level using the root-level <param> element.

Element

Attribute

Required

Description

batch-process

typeCode

Yes

Typecode value of a batch processes defined in the BatchProcessType typelist.

env

No

Use to assign values for distinct installation environments. If used, this <batch-process> element applies only to the listed environments. To apply a specific <batch-process> element to multiple environments, you can input multiple comma-separated values for the env attribute. A multi-valued env attribute eliminates the need for a separate <batch-process> element for each environment.

server

No

Specifies a server on which to run the batch process specified by the typeCode attribute.

The RetryIfInitialConditionsFail parameter

The optional RetryIfInitialConditionsFail parameter governs the behavior of a batch process depending on the return value of batch process class method checkInitialConditions. The name of the parameter is case-insensitive.

This parameter takes the following values.
true If the batch process checkInitialConditions method returns false, the batch process does not terminate immediately. Instead, it continues to execute until its component lease expires. This is the batch process default behavior if the attribute is missing from batch-process-config.xml.
false If the checkInitialConditions method returns false, the batch process terminates immediately.
The <param> element supports the env attribute, meaning that it is possible to set this parameter for different application environments, for example:
  • <paramname="RetryIfInitialConditionsFail" value="false"/>
  • <paramname="RetryIfInitialConditionsFail" value="false" env="dev"/>
  • <paramname="RetryIfInitialConditionsFail" value="true" env="prod"/>
Notice the following in this code example:
  • The example code contains one parameter definition that has no defined env value set for the RetryIfInitialConditionsFail parameter.
  • The example code does not contain a defined RetryIfInitialConditionsFail value for the staging environment
If a particular environment does not set the RetryIfInitialConditionsFail parameter, PolicyCenter does the following:
  • It sets the value of the missing parameter for that environment to that of the parameter definition that does not have an env attribute set, if that parameter definition exists.
  • If there is no parameter definition that does not have the env attribute set, PolicyCenter sets the value of the missing parameter to the RetryIfInitialConditionsFail default value, which is true.

It is also possible to set this parameter individually on each PolicyCenter batch process by including the optional <param> element on the <batch-process> element definition. If you set the RetryIfInitialConditionsFail parameter at the individual batch process level, it overrides any default value for this parameter set at the global level using the root-level <param> element.