A very common use case for using an SLA (Service Level Agreement) is when there is a start date-time (not necessarily the current date-time) and an end date-time and you want to use the time difference between those two dates as your SLA in your BPM process. In the good old BPM 10g days you could do that easily. You could take the two dates and subtract one from the other and the result could be used as a SLA value. Unfortunately, the same cannot be done in BPM 11g as easily but we do have a solution.
The following will demonstrate how the above scenario can be achieved in BPM 11g. Since the SLA calculation itself is just a few lines of Java code, we will use a BPEL component called 'Java Embedding' for it. It does exactly what the name suggests; it embeds Java code into a BPEL process. In this blog, we will kill two birds with one stone and will look at the Java code to calculate the SLA value and also look at how to embed that into a reusable BPEL process. The BPEL process can then be referenced or invoked from any client, including a BPM process.
PT5M - five minutes
P1D - a day
P1M - a month
P1Y1DT1H1S - one year, one day, one hour, and one second
For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.