Resource Definition Examples and Tips › Implementation of the Definition for a Resource That Should Be Started Once Only
Implementation of the Definition for a Resource That Should Be Started Once Only
You can define a resource that satisfies the following requirements:
- It can perform a set of tasks.
- It can indicate that the tasks are performed.
- It must not be started a second time.
For example, you want to submit a set of jobs once and once only during the life of a system.
A typical implementation uses a activation process and a display process:
The activation process takes the following actions:
- Perform tasks.
- Execute the EVVARSET macro to set an EventView variable to ACTIVE.
The display process takes the following actions:
- Execute the EVVARGET macro to get the value of the EventView variable.
- Execute the COMPARE macro to test the value.
The startup sequence of the resource is as follows:
- The region starts up.
- The resource display process gets a null value from the EventView variable.
- The resource activation process is executed, setting the value of the variable to ACTIVE.
- In subsequent activations of the resource, the display process gets an ACTIVE value from the variable and the resource is not activated again.