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.
- 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.
| Effective policy scope | What the policy rules apply to | How the policy is deployed |
|---|---|---|
| 1 Region | The policy task rules apply 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 task rules 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 task rules 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 task rules apply 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:
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. |
task rules
with all the
task rules
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
task rules
for scopes 1 ,
2 , and 3 . This set of
task
rules
applies 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
task rules
that apply at scopes
1 , 2 , 3 , and
4 . This search shows any additional policy
task
rules
that apply to a specific operation of an application, as well as the policy
task rules
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
task rules
that apply to all the application
tasks that run on the selected platform. It is a subset of the policy
task rules
you 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
task rules
that apply at scopes 1 and
2 . This search shows you all the policy
task rules
that apply to all application tasks that run in regions of this type on the platform.
task rules
:- A set of all policy
task rules
with region scope. - A set of all policy
task rules
with platform scope; one for each platform
that a specific CICS region is a member of. - A set of all policy
task rules
for a particular application version; one set
for each application version that is deployed in the CICS
region. - A set of all policy
task rules
for each operation of an application version;
one set for each operation of an application version.
task rules
with 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:
- 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.
- 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.
- If still no match is found, CICS then checks for a set that matches the platform name only.
- If still no match is found, CICS then checks for a set of rules that apply for the region.
- If still no match is found, then the task executes without any policy rules.
- If the task's application context is not set, then CICS just associates the set of region policy rules, if any, with the task
- 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:
- 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.
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.