Policy scopes

Policies are defined in a CICS® bundle, which is then deployed into a CICS region in different ways. Policies that define task rules can be deployed into a stand-alone CICS region, with a CICS platform, or with a CICS application. Policies that define system rules can be deployed only into a stand-alone CICS region or with a CICS platform.

For policies that define system rules, regardless of how the policies are deployed, the rules apply to all tasks (system or user) in the CICS region that make changes to system or resource state.

For a policy that defines task rules, the scope of the task rules is determined by both the way in which the CICS bundle that defines the policy is deployed and the policy scope, if defined for the policy, in the CICS bundle manifest. A policy that defines task rules can be deployed as follows:
Deployed into a stand-alone CICS region
When a policy is deployed into a stand-alone CICS region, task rules that are defined in the policy apply to all user tasks that are running in that CICS region. This method is useful where you cannot define a CICS platform or application.
Deployed into a stand-alone CICS region with a policy scope
When a policy with an associated policy scope is deployed into a stand-alone CICS region, any task rules that are defined in the policy only apply to user tasks with a matching operation in their application context.
Deployed with a CICS platform
When a policy is deployed with a CICS platform, task rules that are defined in the policy apply to all user tasks that have the matching platform in their application context.
Deployed with a CICS application
When a policy is deployed with an CICS application, task rules that are defined in the policy apply to all user tasks on the platform that have the matching platform, application, and application version information in their application context.
Deployed with a CICS application and a policy scope
When a policy with an associated policy scope is deployed with an CICS application, task rules that are defined in the policy apply to all user tasks on the platform that have the matching platform, application, application version, and operation information in their application context.
Table 1. Policy scoping for task rules
Effective policy scope What the policy rules apply to How the policy is deployed
 1  Region The policyStart of change task rules End of changeapply to all user tasks that run in the CICS region to which you deploy the policy. The policy is deployed as a CICS BUNDLE resource defined in the CSD or CICSPlex® SM data repository, and installed into any CICS region.
 2  Platform The policy Start of changetask rulesEnd of change apply to all user tasks on the platform that have the matching platform in their application context. When you define a CICS Platform project, you add to it the CICS bundles that contain policy definitions to be deployed with the platform. If you want to deploy a policy to an already active platform, export the policy bundle to the platform home directory in zFS, and then use the CICS Explorer® ADDBUNDLE operation dialog to install it into a region type. For more information about the ADDBUNDLE operation dialog, see Adding a CICS bundle to a platform in the CICS Explorer product documentation.
 3  Application The policy Start of changetask rulesEnd of change apply to all user tasks on the platform that have the matching platform, application, and application version information in their application context. When you define a CICS Application project, you add to it the CICS bundles that contain policy definitions to be deployed with the application. Alternatively, you can also deploy CICS bundles with the application binding, depending on the architecture of your application.
 4  Operation When a policy is deployed with an application, the policy Start of changetask rules End of changeapply to all user tasks on the platform that have the matching platform, application, application version, and operation information in their application context.

When a policy is deployed to a stand-alone CICS region, the policy task rules apply to all user tasks in the region that have matching operation information in their application context.

First, you define the policies in a CICS bundle. You then define the scoping for the operation by editing the CICS bundle manifest with the CICS manifest editor to define an application entry point and a policy scope. Finally you can either:
  • Add the CICS bundle to a CICS Application project for deployment.
Or
  • Deploy the policy as a CICS BUNDLE resource defined in the CSD or CICSPlex SM data repository, and install it into any CICS region.

CICS bundles that define a policy scope for an operation cannot be deployed with a platform project or added to an already active platform by using the ADDBUNDLE operation dialog. For more information, see Defining policy scopes in the CICS Explorer product documentation and Defining application entry points in the CICS Explorer product documentation.

When a policy is installed into a CICS region, CICS combines its Start of changetask rulesEnd of change with all the Start of changetask rulesEnd of change of the other policies that are deployed with different scopes in that CICS region to determine a set of task rules that apply for each unique runtime scope. Policy rules that are deployed with different scopes might apply to the same task. For a policy deployed to a CICS platform or with a CICS application, you can use the Cloud Explorer view in CICS Explorer to determine which set of policy rules apply to a given scope. For example:
  • If you search for policy rules against a specific application version, you see an aggregation of the policy Start of changetask rules End of changefor scopes  1 ,  2 , and  3 . This set ofStart of change task rules End of changeapplies to all user tasks for this application version.
  • If you search for policy rules against a specific operation of an application, you see an aggregation of the policy Start of changetask rulesEnd of change that apply at scopes  1 ,  2 ,  3 , and  4 . This search shows any additional policy Start of changetask rulesEnd of change that apply to a specific operation of an application, as well as the policy Start of changetask rulesEnd of change that apply to the application.
  • If you search for policy rules against a platform, you see an aggregation of the policy task rules that apply at scopes  1  and  2 . This search shows you all the policy Start of changetask rulesEnd of change that apply to all the application tasks that run on the selected platform. It is a subset of the policy Start of changetask rulesEnd of changeyou see if you search for the policy rules for a specific application (or application operation) running on that platform.
  • Similarly, if you search for policy rules against a region type, you see an aggregation of the policy Start of changetask rules End of changethat apply at scopes  1  and  2 . This search shows you all the policy Start of changetask rulesEnd of changethat apply to all application tasks that run in regions of this type on the platform.
Because policy rules can be aggregated in this way, CICS maintains a number of sets of policy Start of changetask rulesEnd of change:
  • A set of all policy Start of changetask rulesEnd of change with region scope.
  • A set of all policy Start of changetask rulesEnd of change with platform scope; one for each platform that a specific CICS region is a member of.
  • A set of all policy Start of changetask rules End of changefor a particular application version; one set for each application version that is deployed in the CICS region.
  • A set of all policy Start of changetask rules End of changefor each operation of an application version; one set for each operation of an application version.
CICS associates one of these sets of policy Start of changetask rules End of changewith the task at one of two points in the task's lifetime:
When a task is attached
At task attach time, depending on whether the tasks application context is set, CICS determines task rules to be associated with the task as follows:
  • If the task's application context is set, that is, the task has passed through an application entry point, CICS applies the set of policy rules whose scope best matches the task's application context. CICS checks for the best match as follows:
    1. CICS first checks for a set of rules whose scope matches the platform, application, application version, and operation in the task's application context. When the application entry point is defined in a CICS bundle that is deployed to a stand-alone CICS region, only the operation name is set in the tasks application context. In this case, if no match is found, CICS continues the search from step d; otherwise, it proceeds to step b.
    2. If no match is found, CICS then checks for a set of rules that match the platform, application, and application version in the task's application context.
    3. If still no match is found, CICS then checks for a set that matches the platform name only.
    4. If still no match is found, CICS then checks for a set of rules that apply for the region.
    5. If still no match is found, then the task executes without any policy rules.
    For the remainder of this task's lifetime, these are the policy rules that are enforced. Even if the application context changes, the policy rules remain the same.
  • If the task's application context is not set, then CICS just associates the set of region policy rules, if any, with the task
When a task invokes an application entry point program by using EXEC CICS LINK or INVOKE APPLICATION
If the application context was set at task attach, then the policy rules for the task remain unchanged. However, if the application context was not set at task attach, CICS looks for the best set of policy rules that match the task's application context as described earlier, and if a match is found this set of policy rules replaces any region-scoped policy rules that were associated with the task at task attach. This new set includes any such region-scoped rules.
For more information about application context, see Application context.

During task execution, CICS applies the policy rules of a specific type in order of the lowest threshold to the highest threshold. When multiple rules apply to the same threshold, CICS processes message action rules first, then event action rules, and finally abend action rules. This order ensures that messages and events are emitted before a task abends.



policy_scopes.html | Timestamp icon Last updated: Sunday, 4 June 2017