SOA 12c – Using Schedule Job activity in BPEL

In this post, we will learn how to use the Schedule Job activity to submit a ESS request from BPEL process during orchestration. And we will use the ESS job created from this post.

Create a Sync BPEL process and drag Schedule Job activity into BPEL from Components –> Oracle Extensions as shown below.

jobactivity

jobactinbpel

We need to create a MDS connection so that we can do the lookup for the ESS jobs. Create a new SOA-MDS Connection in Resources –> IDE Connections and select MDS partition essUserMetadata as shown below.

mdsconn

Double click on Schedule Job activity in BPEL to being up the below editor and select the required ESS job as shown in following screenshots. This way, we can also explore ESS jobs deployed to partition using different namespaces.

selectjob

selectjob2

selectedjob

Similarly, we can select Schedule if required as shown below.

selectsch

Navigate to Application Properties tab and give the value for Job Propetires using XPath expression as shown below.

jobargs1

jobargs2

jobargs3

We can also verify the ESS Job system properties in System Properties tab.

sysprop

Click OK to observe a sequence of activities are created in your BPEL flow as shown below. We can click each of these activities and observe what has been done automatically for us.

essexpand

essservice

On selecting the job, we will see following artifacts get created automatically in our project.

esswsdl

Since our composite using ESS abstract WSDL it will result into build errors. So modify your ESS partner link entry in composite.xml to add bindings and port as highlighted below.

<reference name="EssService"
           ui:wsdlLocation="WSDLs/ESSWebServiceAbstract.wsdl">
  <interface.wsdl interface="
http://xmlns.oracle.com/scheduler#wsdl.interface(ESSWebService)"
                  callbackInterface="http://xmlns.oracle.com/scheduler#wsdl.interface(ESSWebServiceCallback)"/>
  <binding.ws port="
http://xmlns.oracle.com/scheduler#wsdl.endpoint(ESSWebService/SchedulerServiceImplPort)"
        location="WSDLs/ESSWebServiceAbstract.wsdl"/>
  <callback>
    <binding.ws port="
http://xmlns.oracle.com/scheduler#wsdl.endpoint(ESSWebServiceCallback/ESSWebServiceCallback_pt)"/>
  </callback>
</reference>

Or generate configuration plan for composite and give port and binding along with ESS Webservice location as shown below.

<reference name="EssService">
      <binding type="ws">
        <attribute name="port">
          <replace>
http://xmlns.oracle.com/scheduler#wsdl.endpoint(ESSWebService/SchedulerServiceImplPort)</replace>
        </attribute>
        <attribute name="location">
          <replace>
http://localhost:7015/ess/esswebservice?wsdl</replace>
        </attribute>
      </binding>
      <callback>
        <binding type="ws">
          <attribute name="port">
            <replace>
http://xmlns.oracle.com/scheduler#wsdl.endpoint(ESSWebServiceCallback/ESSWebServiceCallback_pt)</replace>
          </attribute>
        </binding>
      </callback>
    </reference>

We can always verify ESS Webservice WSDLs by navigating to Webservices section in url >:>/ess">http://<<host>>:<<port>>/ess.

Deploy your SOA project using above configuration plan and Test.  Now we will observe the following error as ESS Webservices can’t be run with anonymous user credentials. To get away with that, modify the ESS webservice by attaching OWSM policy as detailed by Lucas in his blog.

svcerror

Since ESS Webservice is secured we need to attach the corresponding client policy to our Partner link and need to pass on the credentials of valid user. So as a first step, create a credential store key ESS_KEY_USER with weblogic credentials using the following steps in EM Console.

security

credkey

credkey1

Now attach the corresponding client policy to our partner link as shown below.

owsm4req

attchedowsm

Click pencil icon and modify OWSM policy to specify csf-key as shown below.

csfkey

This would populate wsm-assembly.xml file with the policy details as below.

owsmpolicy

Now again deploy the SOA composite and run. This time composite run will be successful and can observe the Request ID of ESS job as the response.

flowtrace

Navigate to ESSAPP –> Search Job Requests to see our job is submitted as expected and shows user as weblogic which is used in csf-key.

jobrequest

You can find sample project here.

Observation:

There is some run time error coming during BPEL process testing when we specified job description for Schedule Job activity as above. This is due to the missing quotes around so we have to manually open assign activity and surround your job description in quotes as shown below.

essissue

Advertisement

5 Responses to “SOA 12c – Using Schedule Job activity in BPEL”


  1. 1 valerybonnet February 8, 2017 at 7:20 PM

    Hi Siva.

    Just a question about the wsm-assembly.xml file, where the OWSM Policy and the csf-key are defined….

    Do you know how it is possible to “override” this policy, in the “configuration plan” or somewhere else ? (In fact, I have to deploy my composite in different environments, and in DEV env (for instance), the REFERENCE service has no authentication set…)

    Regards,
    Val

    • 2 svgonugu February 9, 2017 at 10:27 PM

      Did not come across that option till now and I am back to 11g since some time.do policy sets work for your scenario. This way, during server provisioning itself you can setup policy set oe GPA.

  2. 3 Cham January 22, 2016 at 9:53 PM

    Hi Siva,
    I have seen you use {ESS_REQ:} to obtain input for the schedule job. Can you please provide a practical scenario for this if the scheduled job is running every 10 mins and where or how or what kind of input it obtains. I am pretty sure we cannot manually feed the input through em console every 10 mins. So I would like to know from where or how the application then new job accept the input to process.
    thx

    • 4 svgonugu January 25, 2016 at 11:16 AM

      Yes. you are right. typically when we schedule a job we will not be able to provide input for each job run. So it typically used for batch jobs, like process all inventory transaction for a day or something like that..


  1. 1 SOA 12c – ESS Articles | Siva's Blog Trackback on August 14, 2015 at 6:26 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.




Pages

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 379 other subscribers

Enter your email address to follow this blog and receive notifications of new posts by email.


%d bloggers like this: