We often come across following restrictions when we use ESS jobs because of data corruption issue or for some other functional reason.
- Only single instance of Job definition should run at particular time.
- Some jobs should not be run during the run of other jobs irrespective of parameters.
- Some jobs should not be run during the run of other jobs when acting on same object i.e. having same value for a particular parameter.
In ESS, all of above requirements are addressed by using Incompatibility definition. The first requirement is addressed by using Self Incompatible option. Second and third requirements are addressed by using Global and Domain type incompatibility definitions. In this blog post, we will learn how to create Incompatibility catering to above requirements.
To create Incompatibility metadata, select File –> New –> Enterprise Scheduler Metadata –> Incompatibility.
Give a meaningful name and use the same package as used in previous post. Here we are creating Global type.
Click OK and you can observe the new Incompatibility file shown in the project explorer and a new tab is opened.
Click + icon in Entities section to start adding the jobs.
Select the required jobs and click OK. If we try to save , we will get an error as shown below. As shown below, aAn Incompatibility definition mandates us to select Self Incompatible option when we are adding just single job (entity).
To set this option, double click job in Entities section and choose the option as shown below and click OK. This would make ESS request processor run only single instance of this job at a particular time.
Now save your changes and deploy to ESS server using the steps mentioned in previous post.
To view newly created Incompatibility in EM console, navigate to ESSAPP –> Job Metadata–> Incompatibilities and do search for EssNativeHostingApp as shown below.
To verify the effect of incompatibility, let us submit 2 instances of the same job and schedule them to run at same time as shown below.
On the scheduled time, we can observe that one of the requests is blocked as shown below because of our incompatibility definition.
Once the job with request id 205 is completed, 206 will be kick started by request processor which is evident from the start times shown in the below screenshot.
If you want to make 2 job incompatible with each other, add the other job in the incompatibility definition as shown below.
Similar to above, you can observe the same blocked behavior for these 2 jobs in following screenshots when submitted in EM console at the same scheduled time.
Domain type Incompatibility
You can create incompatibility definition of Domain type using the following screenshots.
Double click on each job in Entities section to select the property to be used for defining the incompatibility. Note that, we can have different property names to define the incompatibility definition.
Now your incompatibility definition should look like below.
Now deploy your ESS project to verify effect of new incompatibility definition. Note that you have to remove SecondOSBJob from previous incompatibility definition before deployment as that is of Global type and is necessary to see effect of this domain type incompatibility which is based on properties.
When used different values for the parameters, you can observe that both jobs started execution at same time which is evident from the date values shown below.
When used same values for the parameters, you can observe that one of the requests is blocked which is evident from the following screenshots.
Using EM Console to Create Schedule
We can also create a Incompatibility in EM console as shown below and the steps look similar to above.
You can find more information in the documentation here and sample project used in this blog can be downloaded from here.
1 Response to “SOA 12c–Creating ESS Incompatibility metadata”