SlideShare a Scribd company logo
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
An Oracle White Paper
August 2013
How to Get Started With Oracle Enterprise
Scheduler Service for Fusion Applications
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
Executive Overview........................................................................... 1
Introduction ....................................................................................... 1
Install and Configure JDeveloper....................................................... 2
Create and Configure Integrated WebLogic Server (WLS) ................ 2
Configure Domain.......................................................................... 3
Verify ESS installation ................................................................... 3
Creating Workspace.......................................................................... 5
Create Application ......................................................................... 5
Create ESS project........................................................................ 8
Configure UI project..................................................................... 11
Configure EAR ............................................................................ 12
Implement ESS application.............................................................. 12
Create Parameter View Object .................................................... 13
Create ESS Job........................................................................... 14
Implement UI................................................................................... 16
Create Page ................................................................................ 16
Add permissions.......................................................................... 17
Deployment ..................................................................................... 19
Testing ............................................................................................ 20
Troubleshooting............................................................................... 23
MDS-00521 ................................................................................. 23
ESS-02002 User weblogic does not have sufficient privilege to perform
operation ..................................................................................... 23
Conclusion ...................................................................................... 23
References...................................................................................... 23
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
1
Executive Overview
Concurrent or scheduled processes are programs that run in the background. Common use cases are:
 Scheduled action: an action needs to be executed at a predetermined schedule
 Time-consuming action: Users perform an action that could take a long time to finish
Oracle Enterprise Scheduler Service (ESS) provides the ability to manage the complete life cycle of a
scheduled process including: development, distribution, scheduling and monitoring
Introduction
This article will go through an example for ESS development for Fusion Applications including:
 Creation and configuration of a development environment for ESS development
 Implementation of a concurrent process
 Implementation of UI for submitting and monitoring the concurrent process
 Submitting and monitoring the concurrent process
The goal is not to cover the whole content of Oracle Fusion Middleware Developer's Guide for Oracle
Enterprise Scheduler and Fusion Applications Extensibility Guide rather to provide a quick view of the
components and illustrate the minimum steps to create an environment and use it to build a simple
applications.
This article covers Linux based environments, steps for Windows would be similar; however there
would be some differences e.g. on how the file paths are defined.
.
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
2
Install and Configure JDeveloper
JDeveloper installation and configuration is covered in this previous whitepaper.
Create and Configure Integrated WebLogic Server (WLS)
WLS configuration is covered in this previous whitepaper, the steps for ESS are the same except
before starting the domain creation on the last screen of the wizard we need to manually update the
properties file to tell the system to include ESS components into the domain. So before clicking the
Finish on the wizard:
Figure 1. Domain Configuration - Summary
Open the “fusion_apps_wls.properties” file in text editor and modify the following property to have
value of “yes”:
ESSrunTime=yes
Once the domain creation completes and the server is started the domain created should include the
following components:
 ESSAPP: the main Oracle Enterprise Scheduler application receiving, scheduling and executing
request. There are two main modules Dispatcher and Processor. Dispatcher module is responsible for
polling the Wait queue and retrieving next request to be processed. It then dispatches the request to
Ready queue when appropriate. Processor module retrieves request from Ready Queue and submits it
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
3
to the Application processing. Once the job runs to completion, Application puts the outcome on
Event Queue
 ESSJobTypesAPP: ESS JobTypes Metadata Application, this provides the Job Types in
"oracle/as/ess/ext/" namespace. These JobTypes are referred from ESS applications created by the
developers
 EssCentralUiApp: ESS Central UI Application is the UI for ESS job monitoring and submission
 DiagnosticsUI-Ess: ESS UI shell used by the ESS code, not relevant for developer in context of this
document
Configure Domain
The environment is configured to use LDAP as identity store. Some permissions used by the
verification scripts are granted to the WLS administrator, however the grant is for the administrator in
the local policy store which is different from the one in the LDAP. So OOTB when logging in with
"weblogic" user the permissions required to run the ESS verification scripts are not granted to the user
authenticated from the LDAP. Obviously this can be resolved by introducing the necessary grants into
the policy store, however a quicker approach is to change the order of the authentication provider by
navigating:
Domain -> Security Realms -> myrealm -> Providers
and re-order the providers such that the "DefaultAuthenticator" is before the "OIDAuthenticator".
This will check the local identity store before the LDAP when authenticating:
Note that the server needs to be restarted for the change to take effect.
Verify ESS installation
The ESS installation can be verified using the following URLs:
http://hostName:port/EssHealthCheck/checkHealth.jsp
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
4
Use the administrator (OOTB “weblogic”) to log in. The results should be as follows:
Figure 2.ESS Health Check
More comprehensive test can be executed with URL:
http://hostName:port/EssHealthCheck/diagnoseHealth.jsp
The results should be as follows:
Figure 3.ESS Diagnostic check
The host and port in these cases are for the AdminServer i.e. the same as when accessing the WLS Console.
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
5
Creating Workspace
Create Application
Start JDeveloper using "Oracle Fusion Applications Developer" role and create a new customization
application. Use “Fusion Web Application (ADF)” application template and enter name such as
“EssDemoApp”:
Figure 4.Fusion Web Application
This will create an application with “Model” and “ViewController” projects. The “Model” project will
be used to create ADFbc view object that is used to define parameters for an ESS job.
“ViewController” project will contain the UI that is used to submit and monitor the ESS job.
Create Metadata Archive (MAR) profile
A MAR profile is used to create a MAR archive that is used to package and deploy metadata defined
for the ESS application. To create the MAR profile navigate to “Application Properties ->
Deployment -> New” choose “MAR File” as the archive type and “EssMar” as name. At the moment
we do not have any metadata to include into the archive, the profile will need to be updated once ESS
metadata such as Job definition is created.
Set default MAR profile
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
6
Navigate to “Application Properties -> Run -> MDS” and set the “MAR Profile” to “EssMar”
Configure metadata usages
In order for us to use metadata provided by the ESS feature we need to define metadata usages. This
configuration includes the data source and namespace etc. that define how the seeded ESS metadata
such as job types are stored in the MDS repository. The definitions here are reflected on the
“Deployment Configuration” screen displayed to the developer when deploying the application.
Navigate to “Application Resources -> Descriptors -> ADF META-INF -> adf-config.xml”:
In the file add the following content:
<adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
<mds-config version="11.1.1.000" xmlns="http://xmlns.oracle.com/mds/config">
<persistence-config>
<metadata-namespaces>
<namespace path="/oracle/as/ess/ext"
metadata-store-usage="ess-cp-store-usage"/>
<namespace path="/oracle/as/ess/core"
metadata-store-usage="ess-cp-store-usage2"/>
</metadata-namespaces>
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
7
<metadata-store-usages>
<metadata-store-usage id="ess-cp-store-usage">
<metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
<property name="jndi-datasource" value="jdbc/mds-ESS_MDS_DS"/>
<property name="repository-name" value="mds-ESS_MDS_DS"/>
<property name="partition-name" value="extJobTypes"/>
</metadata-store>
</metadata-store-usage>
<metadata-store-usage id="ess-cp-store-usage2">
<metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
<property name="jndi-datasource" value="jdbc/mds-ESS_MDS_DS"/>
<property name="repository-name" value="mds-ESS_MDS_DS"/>
<property name="partition-name"
value="essapp-internal-partition"/>
</metadata-store>
</metadata-store-usage>
</metadata-store-usages>
</persistence-config>
</mds-config>
</adf-mds-config>
Configure weblogic-application.xml
Navigate to “Application Resources -> Descriptors -> META-INF -> weblogic-application.xml” and
add the following library references:
<library-ref>
<library-name>oracle.applcp.model</library-name>
</library-ref>
<library-ref>
<library-name>oracle.xdo.runtime</library-name>
</library-ref>
<library-ref>
<library-name>oracle.ess</library-name>
</library-ref>
Create jazn-data.xml
For the processing some security definitions will be needed for ESS. To create the definitions we need
to create a jazn-data.xml file that contains roles and permissions used for the application. Navigate to
“Application Resources –> Descriptors -> META-INF” and in context menu choose “New Oracle
Deployment Descriptor”:
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
8
On the wizard opened accept the defaults and click “Finish”.
Create ESS project
We will need a new project to contain the ESS related objects. Navigate “New -> Projects -> ADF
Model Project “and enter some name such as “Ess”.
Add required libraries
For “Ess” project navigate to “Project Properties -> Libraries and Classpath -> Add Library” and add
the following libraries:
 Enterprise Scheduler Extensions
 EJB 3.0
Add Dependency to the Model project
In our application we will use a VO to define parameters for the ESS job. This “parameter VO” is
referred from the ESS metadata and at run-time the system will prompt user input based on the
definitions for it. To use the VO the code in “Ess” project will need to have access to it so we will
need to add a dependency. Navigate to “Project Properties -> Dependencies” click the edit icon and
choose “Build Output” for the Model project.
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
9
Configure Project Source Paths
Next navigate to “Project Properties -> Project Source Paths -> Resources” and check the “Include
content from subfolders”. This is needed to include the resources created in the sub directories to the
project.
Create the ejb-jar.xml
Ejb-jar deployment descriptor contains EJB structural information and Application assembly
information (such as EJB references etc.). For our application we need to configure the EJBs used to
access the ESS functionality. These beans allow the application to submit request, access ESS metadata
etc. To create the file navigate “New->General->Deployment Descriptors->Java EE Deployment
Descriptor”, choose “ejb-jar.xml” and “3.0”. Open the file and enter the following content:
<?xml version = '1.0' encoding = 'UTF-8'?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0" xmlns="http://java.sun.com/xml/ns/javaee">
<display-name>ESS</display-name>
<enterprise-beans>
<message-driven>
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
10
<ejb-name>ESSAppEndpoint</ejb-name>
<ejb-class>oracle.as.scheduler.ejb.EssAppEndpointBean</ejb-class>
</message-driven>
<session>
<description>Async Request Bean</description>
<ejb-name>AsyncRequestBean</ejb-name>
<ejb-class>oracle.as.scheduler.ejb.AsyncRequestBean</ejb-class>
</session>
<session>
<description>Runtime Session Bean</description>
<ejb-name>RuntimeServiceBean</ejb-name>
<ejb-class>oracle.as.scheduler.ejb.RuntimeServiceBean</ejb-class>
</session>
<session>
<description>Metadata Session Bean</description>
<ejb-name>MetadataServiceBean</ejb-name>
<ejb-class>oracle.as.scheduler.ejb.MetadataServiceBean</ejb-class>
</session>
</enterprise-beans>
</ejb-jar>
Create weblogic-ejb-jar.xml
Weblogic-ejb-jar.xml is the WebLogic specific deployment descriptor. For our application we need to
configure the beans used to access the ESS functionality. These beans allow the application to submit
request, access ESS metadata etc. The configuration also includes the principal name to run the logic
with.
To create the file navigate “New -> WebLogic Deployment Descriptor”, choose “weblogic-ejb-
jar.xml” and “10.3”. Open the file and enter the following content (note that the content contains
references to the application name, if you used different name the bolded entries must be updated):
<?xml version = '1.0' encoding = 'UTF-8'?>
<weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar
http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd"
xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar">
<weblogic-enterprise-bean>
<ejb-name>ESSAppEndpoint</ejb-name>
<message-driven-descriptor>
<resource-adapter-jndi-name>ess/ra</resource-adapter-jndi-name>
</message-driven-descriptor>
<dispatch-policy>ESSRAWM</dispatch-policy>
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
11
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>RuntimeServiceBean</ejb-name>
<stateless-session-descriptor>
<business-interface-jndi-name-map>
<business-remote>oracle.as.scheduler.RuntimeServiceRemote</business-remote>
<jndi-name>EssDemoApp/runtimeservice</jndi-name>
</business-interface-jndi-name-map>
</stateless-session-descriptor>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>MetadataServiceBean</ejb-name>
<stateless-session-descriptor>
<business-interface-jndi-name-map>
<business-remote>oracle.as.scheduler.MetadataServiceRemote</business-remote>
<jndi-name>EssDemoApp/metadataservice</jndi-name>
</business-interface-jndi-name-map>
</stateless-session-descriptor>
</weblogic-enterprise-bean>
<run-as-role-assignment>
<role-name>essSystemRole</role-name>
<run-as-principal-name>weblogic</run-as-principal-name>
</run-as-role-assignment>
</weblogic-ejb-jar>
Create Deployment Profile
We need to create deployment profile to deploy the “Ess” project with the application. To create the
deployment profile navigate to “Project Properties -> Deployment -> New” choose “EJB JAR File” as
archive type and “ejb-jar” as the name. On the deployment profile set the following:
 “General-> Enterprise Application Name“ set the value to “EssDemoApp”
 “File Groups -> Project Output -> Contributors” add the “Ess/src” directory
 “File Groups -> Project Output -> Filters” make sure the ejb-jar.xml and weblogic-ejb-jar.xml are
selected
Configure UI project
For “ViewController” project navigate to “Project Properties -> Add Library” and add the following
libraries:
 Application Core (ViewController)
 EnterpriseSchedulerExtensions
 EJB 3.0
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
12
Next navigate to “Project Properties -> Deployment -> Edit (War File) -> General“ and set the “Java
EE Web Context Root” to “EssDemo”. This value is used in the URL with which the application is
accessed with.
Configure web.xml
For the UI we need to configure the references to the EJBs used to access the ESS functionality. These
beans allow the application to submit request, access ESS metadata etc. Add the following
configuration under the “web-app” element in the web.xml:
<ejb-local-ref>
<ejb-ref-name>ess/metadata</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>oracle.as.scheduler.MetadataServiceLocal</local>
<ejb-link>MetadataServiceBean</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ess/runtime</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>oracle.as.scheduler.RuntimeServiceLocal</local>
<ejb-link>RuntimeServiceBean</ejb-link>
</ejb-local-ref>
Configure weblogic.xml
We need to add library references into weblogic.xml:
<library-ref>
<library-name>oracle.applcp.view</library-name>
</library-ref>
<library-ref>
<library-name>oracle.xdo.webapp</library-name>
</library-ref>
Configure EAR
Navigate to “Application Properties -> Deployment -> Edit (Ear File) “ and modify the following:
 “General -> Application Name” set the value to “EssDemoApp”. The application name will be used
as the name with which the application is deployed to WLS. Some of the ESS configuration must
match this value otherwise the system will not be able to find the metadata
 “Application Assembly” make sure that “EssMar”, “EssDemoApp_ViewController_webapp1” and
“ejb-jar” modules are checked.
Implement ESS application
Next we implement the ESS program and UI to test it with. For the application we need the following:
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
13
 ESS Job which consists of
o Job metadata defines how a process is going to be run, parameters needed for the
processing and who is allowed to execute the job
o Job implementation that does the actual processing
 View Object that is used to obtain the parameters from the user when submitting the ESS Job
 UI that can be used to submit the job and monitor its progress for testing purposes.
Create Parameter View Object
The parameter view object is used to obtain the parameters from the user when submitting the ESS
Job. In our example project we will have two parameters; a string that the user will define by selecting
from a choice list and a date.
Create View Object for the Choice List
In order to provide the user with a choice list when entering the parameters we need to first define a
view object that contains the values available. Select the “Model” project and navigate “New -> ADF
Business Components -> View Object”. When prompted enter the connection details to your local
database. Enter “StatusVO” as the name and choose “Rows populated at design time (Static List)” as
the data source. Add 2 attributes “Code” and “Value”, set the code as primary key. “Code” will be used
as the value passed to the job, the user will see the “Value”. Enter some data for the attributes such as
“NEW” / “New” and “COMPLETE” / “Complete”.
Create View Object for parameter
Select the “Model” project and navigate “New -> ADF Business Components -> View Object”. When
prompted enter the connection details to your local database. Enter “ParameterVO” as the name and
choose “Read-only access through SQL query as the data source. Use the following as the query:
SELECT NULL AS ATTRIBUTE1, to_date(NULL) AS ATTRIBUTE2 FROM DUAL
Set each attribute to be updatable “always”.
Select “Attribute1” and click “plus” icon on the “List of Values: Attribute1”. Choose “StatusVO1” as
the “List Data Source” and “Code” as the “List Attribute. Click “UI Hints” and move “Value” to the
selected on the “Display Attributes” component.
For each attribute on the VO click “Edit” and in the “Control Hints” set the following:
 Attribute1:
o “Label Text” to “Status”
o “Display Width” to “10”
 Attribute2:
o “Label Text” to “Date”
o “Format Type” to “Simple Date”
o “Format“ to “dd-MMM-yyyy”
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
14
Create ESS Job
Select the “Ess” project and navigate “New -> Enterprise Scheduler Metadata -> Job Definition”.
Enter data such as:
 Name: EssDemoJob
 Package: oracle.apps.demo
 Job Type: /oracle/as/ess/core/JavaJobType
 Create Java Class: Checked
 Java Package: oracle.apps.demo
 Class Name: EssDemoJob
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
15
Set job properties
Next we need to set some properties on the Job in order for us to use it with the submission and
monitoring UIs provided by Fusion Applications. Navigate to the job definition and set the following:
 Application Defined properties:
o “JobDefinitionName” to “EssDemoJob”
o “JobPackageName” to “oracle.apps.demo”
o “JobDefintionApplication” to “EssDemoApp”
o “srsFlag” to “Y”
o “parametersVO” to “oracle.apps.model.view.ParameterVO”
 System Properties:
o “SYS_effectiveApplication” to “EssDemoApp”
For details on the Job definition and its parameters refer to this section of Developer's Guide for ESS.
Implement processing logic
Next we need to implement the actual processing for the job. In our case we are simply going to print
out the values passed in by the user. Open the “EssDemoJob.java” generated on job creation and add
the following content:
package oracle.apps.demo;
import oracle.as.scheduler.Cancellable;
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
16
import oracle.as.scheduler.Executable;
import oracle.as.scheduler.ExecutionCancelledException;
import oracle.as.scheduler.ExecutionErrorException;
import oracle.as.scheduler.ExecutionPausedException;
import oracle.as.scheduler.ExecutionWarningException;
import oracle.as.scheduler.RequestExecutionContext;
import oracle.as.scheduler.RequestParameters;
public class EssDemoJob implements Executable, Cancellable
{
public void execute(RequestExecutionContext ctx, RequestParameters params)
throws ExecutionErrorException, ExecutionWarningException,
ExecutionCancelledException, ExecutionPausedException
{
System.out.println("**** Sample Job Running, Request ID: " + ctx.getRequestId());
String arg1 = ((String)params.getValue("submit.argument1"));
System.out.println("**** Argument 1 = " + arg1);
String arg2 = ((String)params.getValue("submit.argument2"));
System.out.println("**** Argument 2 = " + arg2);
}
public void cancel()
{
}
}
Add metadata to the MAR file
Navigate to “Application Properties -> Deployment -> Edit (MAR File)” and set the following:
 “Metadata File Groups -> User Metadata -> Add” and add the “essmeta” directory under “Ess”
project
 “Metadata File Groups -> User Metadata -> Directories” check the “oracle.apps.demo” directory
Implement UI
To test the application we need UI for submitting and monitoring the job. For this we will use Fusion
Applications ESS UI,
Create Page
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
17
For the test we create a test page, on the “ViewController” project navigate “New -> Web Tier -> JSF
-> JSF Page” and enter name “EssDemo.jspx”. Inside the “form” component add a “Panel Stretch
Layout” component. For the “Panel Stretch Layout” add attribute “styleClass="AFStretchWidth"”,
this will ensure that the embedded UI will display correctly. Next navigate to “Resource Palette -> File
System -> Applications Core -> MonitorProcesses-View.jar -> ADF Task Flows”, drag and drop the
“MonitorProcessesMainAreaFlow” to the center facet of the “Panel Stretch Layout”. When prompted
add the ADF library. No parameters need to be entered to the taskflow. The page should look
something like this:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view locale="#{applCorePrefs.locale}">
<af:document id="d1">
<af:form id="f1">
<af:panelStretchLayout id="psl1" styleClass="AFStretchWidth">
<f:facet name="bottom"/>
<f:facet name="center">
<af:region value="#{bindings.MonitorProcessesMainAreaFlow1.regionModel}"
id="r1"/>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>
Add permissions
We need to add permission to the jazn-data.xml to allow the system access to the metadata and ESS
functionality. In our case for simplicity we are granting the access to anonymous so the application can
be accessed without authentication. Navigate to the “Application Resources->Descriptors->META-
INF -> jazn-data.xml” and replace the content with the following content:
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
18
<?xml version='1.0' encoding='utf-8'?>
<jazn-data>
<jazn-realm default="jazn.com"><realm><name>jazn.com</name><users></users></realm>
</jazn-realm>
<policy-store>
<applications>
<application>
<name>EssDemoApp</name>
<jazn-policy>
<grant>
<grantee>
<principals>
<principal>
<class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class>
<name>anonymous-role</name>
</principal>
</principals>
</grantee>
<permissions>
<permission>
<class>oracle.as.scheduler.security.MetadataPermission</class>
<name>*</name>
<actions>READ,EXECUTE,CREATE,DELETE</actions>
</permission>
</permissions>
</grant>
<grant>
<grantee>
<principals>
<principal>
<class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class>
<name>anonymous-role</name>
</principal>
</principals>
</grantee>
<permissions>
<permission>
<class>oracle.adf.share.security.authorization.RegionPermission</class>
<name>view.pageDefs.loginPageDef</name>
<actions>view</actions>
</permission>
<permission>
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
19
<class>oracle.as.scheduler.security.MetadataPermission</class>
<name>*</name>
<actions>READ,EXECUTE,CREATE,DELETE</actions>
</permission>
</permissions>
</grant>
</jazn-policy>
</application>
</applications>
</policy-store>
</jazn-data>
Deployment
The application needs to be deployed in separate step. First start the server:
Once the service is up and running we deploy the application. Navigate “Application -> Deploy ->
EssDemoApp_application1”, choose to deploy on the “IntegratedWeblogicServer”, “Deploy to all
instances in the domain” and “Deploy as standalone Application”, on the “Deployment
Configuration” accept the defaults:
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
20
Testing
Once deployed we can access the application with URL such as:
http://host:port/EssDemo/faces/EssDemo.jspx
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
21
To test the application click the “Schedule New Process” and choose the “EssDemoJob” from the
“Schedule New Process” popup.
On the “Process Details” popup the parameters displayed are derived from the ParameterVO that we
associated with the Job. Note that:
 The label of the field comes from the control hints on the VO
 The String parameter has choice list from which the value can be obtained
 The date field has a icon that can be used to invoke component to select the date
 The date field has a format that matches the control hint defined on the VO
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
22
Once submitted we can observe from the Integrated WLS log that the processing enters our java logic:
The result can also be queried from the UI:
How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications
23
Troubleshooting
MDS-00521
Sometimes when trying to access the URL for the application get:
oracle.mds.exception.MDSRuntimeException: MDS-00521: error while reading document
/META-INF/adfc-config.xml from metadata repository error reading zip file
It is unclear why this happens as the deployment succeeded without problems. The resolution is to re-
deploy the application.
ESS-02002 User weblogic does not have sufficient privilege to perform operation
It the ESS health check scripts fail with:
oracle.as.scheduler.MetadataServiceAccessControlException: ESS-02002 User weblogic does
not have sufficient privilege to perform operation READ. at
oracle.as.scheduler.metadata.mds.MetadataDelegator._checkPermission(MetadataDelegator.ja
va:127)
This can be fixed by changing the order of the authenticators as described in section "Create and
Configure Integrated WebLogic Server (WLS) -> Configure Domain". Also make sure that the server
was restarted after the change.
Conclusion
In this article we have covered an overview of the components related to ESS and illustrated the
minimum steps to create environment and use it to build and test a simple ESS job.
References
 Oracle Fusion Middleware Developer's Guide for Oracle Enterprise Scheduler
 Oracle Fusion Applications Extensibility Guide
 Fusion Developer's Guide for Oracle Application Development Framework - Deploying Fusion Web
Applications
 EJB Deployment Descriptor Reference
 weblogic-ejb-jar.xml
How to Get Started With Oracle Enterprise
Scheduler Service for Fusion Applications
August 2013
Author: Jani Rautiainen
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
oracle.com
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
This document is provided for information purposes only, and the contents hereof are subject to change without notice. This
document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in
law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any
liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This
document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our
prior written permission.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0113

More Related Content

PDF
Bridging The Gap: SAP Solution Manager To ServiceNow Integration
PDF
Microsoft SQL Server Analysis Services Multidimensional
PDF
DOAG Oracle Database Vault
PPT
Sql server performance tuning
PPTX
MySQL Architecture and Engine
PDF
SAP GRC 10 Access Control
PDF
Grc 10 training
PPTX
SQL(NEW).pptx
Bridging The Gap: SAP Solution Manager To ServiceNow Integration
Microsoft SQL Server Analysis Services Multidimensional
DOAG Oracle Database Vault
Sql server performance tuning
MySQL Architecture and Engine
SAP GRC 10 Access Control
Grc 10 training
SQL(NEW).pptx

What's hot (10)

PPT
PPTX
Sql Server Management Studio Tips and Tricks
PPT
Anatomy of Autoconfig in Oracle E-Business Suite
PPTX
Sql server performance tuning
PDF
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
PDF
Designing a Chart of Accounts for a Global Company Going to Oracle E-Business...
PDF
Bi Publisher 11g: Only good news
PDF
Basics of fdmee
PDF
Calculation Manager: The New and Improved Application to Create Hyperion Plan...
PPTX
Oracle GoldenGate Microservices Overview ( with Demo )
Sql Server Management Studio Tips and Tricks
Anatomy of Autoconfig in Oracle E-Business Suite
Sql server performance tuning
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Designing a Chart of Accounts for a Global Company Going to Oracle E-Business...
Bi Publisher 11g: Only good news
Basics of fdmee
Calculation Manager: The New and Improved Application to Create Hyperion Plan...
Oracle GoldenGate Microservices Overview ( with Demo )
Ad

Similar to Developing with oracle enterprise scheduler service for fusion applications (20)

PDF
Oracle Enterprise Scheduler(ESS Job Scheduling)
PDF
PDF
Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2
PDF
Best practices for large oracle apps r12 implementations apps14
PDF
OOW16 - Deploying Oracle E-Business Suite for On-Premises Cloud and Oracle Cl...
PPSX
E scheduler
PDF
OOW15 - Oracle Enterprise Manager Cloud Control for Managing Oracle E-Busines...
PDF
Odi 12c-getting-started-guide-2032250
PDF
Fusion Applications Administration Overview
PPT
Fusion - iBank.uk.com 07474222079
PPT
Fusion - IBANK
PPTX
Uponor Exadata e-Business Suite Migration Case Study
PDF
27 appendix
PPT
Oracle_EBS
PDF
ORACLE SOA Admin Online Training.pdf
PDF
PPT
R12 d49656 gc10-apps dba 03
PDF
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
PDF
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
PDF
ebs-adapter-webcast12345678900000000.pdf
Oracle Enterprise Scheduler(ESS Job Scheduling)
Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2
Best practices for large oracle apps r12 implementations apps14
OOW16 - Deploying Oracle E-Business Suite for On-Premises Cloud and Oracle Cl...
E scheduler
OOW15 - Oracle Enterprise Manager Cloud Control for Managing Oracle E-Busines...
Odi 12c-getting-started-guide-2032250
Fusion Applications Administration Overview
Fusion - iBank.uk.com 07474222079
Fusion - IBANK
Uponor Exadata e-Business Suite Migration Case Study
27 appendix
Oracle_EBS
ORACLE SOA Admin Online Training.pdf
R12 d49656 gc10-apps dba 03
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
ebs-adapter-webcast12345678900000000.pdf
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
sap open course for s4hana steps from ECC to s4
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
sap open course for s4hana steps from ECC to s4
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology

Developing with oracle enterprise scheduler service for fusion applications

  • 1. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications An Oracle White Paper August 2013 How to Get Started With Oracle Enterprise Scheduler Service for Fusion Applications
  • 2. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications Executive Overview........................................................................... 1 Introduction ....................................................................................... 1 Install and Configure JDeveloper....................................................... 2 Create and Configure Integrated WebLogic Server (WLS) ................ 2 Configure Domain.......................................................................... 3 Verify ESS installation ................................................................... 3 Creating Workspace.......................................................................... 5 Create Application ......................................................................... 5 Create ESS project........................................................................ 8 Configure UI project..................................................................... 11 Configure EAR ............................................................................ 12 Implement ESS application.............................................................. 12 Create Parameter View Object .................................................... 13 Create ESS Job........................................................................... 14 Implement UI................................................................................... 16 Create Page ................................................................................ 16 Add permissions.......................................................................... 17 Deployment ..................................................................................... 19 Testing ............................................................................................ 20 Troubleshooting............................................................................... 23 MDS-00521 ................................................................................. 23 ESS-02002 User weblogic does not have sufficient privilege to perform operation ..................................................................................... 23 Conclusion ...................................................................................... 23 References...................................................................................... 23
  • 3. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 1 Executive Overview Concurrent or scheduled processes are programs that run in the background. Common use cases are:  Scheduled action: an action needs to be executed at a predetermined schedule  Time-consuming action: Users perform an action that could take a long time to finish Oracle Enterprise Scheduler Service (ESS) provides the ability to manage the complete life cycle of a scheduled process including: development, distribution, scheduling and monitoring Introduction This article will go through an example for ESS development for Fusion Applications including:  Creation and configuration of a development environment for ESS development  Implementation of a concurrent process  Implementation of UI for submitting and monitoring the concurrent process  Submitting and monitoring the concurrent process The goal is not to cover the whole content of Oracle Fusion Middleware Developer's Guide for Oracle Enterprise Scheduler and Fusion Applications Extensibility Guide rather to provide a quick view of the components and illustrate the minimum steps to create an environment and use it to build a simple applications. This article covers Linux based environments, steps for Windows would be similar; however there would be some differences e.g. on how the file paths are defined. .
  • 4. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 2 Install and Configure JDeveloper JDeveloper installation and configuration is covered in this previous whitepaper. Create and Configure Integrated WebLogic Server (WLS) WLS configuration is covered in this previous whitepaper, the steps for ESS are the same except before starting the domain creation on the last screen of the wizard we need to manually update the properties file to tell the system to include ESS components into the domain. So before clicking the Finish on the wizard: Figure 1. Domain Configuration - Summary Open the “fusion_apps_wls.properties” file in text editor and modify the following property to have value of “yes”: ESSrunTime=yes Once the domain creation completes and the server is started the domain created should include the following components:  ESSAPP: the main Oracle Enterprise Scheduler application receiving, scheduling and executing request. There are two main modules Dispatcher and Processor. Dispatcher module is responsible for polling the Wait queue and retrieving next request to be processed. It then dispatches the request to Ready queue when appropriate. Processor module retrieves request from Ready Queue and submits it
  • 5. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 3 to the Application processing. Once the job runs to completion, Application puts the outcome on Event Queue  ESSJobTypesAPP: ESS JobTypes Metadata Application, this provides the Job Types in "oracle/as/ess/ext/" namespace. These JobTypes are referred from ESS applications created by the developers  EssCentralUiApp: ESS Central UI Application is the UI for ESS job monitoring and submission  DiagnosticsUI-Ess: ESS UI shell used by the ESS code, not relevant for developer in context of this document Configure Domain The environment is configured to use LDAP as identity store. Some permissions used by the verification scripts are granted to the WLS administrator, however the grant is for the administrator in the local policy store which is different from the one in the LDAP. So OOTB when logging in with "weblogic" user the permissions required to run the ESS verification scripts are not granted to the user authenticated from the LDAP. Obviously this can be resolved by introducing the necessary grants into the policy store, however a quicker approach is to change the order of the authentication provider by navigating: Domain -> Security Realms -> myrealm -> Providers and re-order the providers such that the "DefaultAuthenticator" is before the "OIDAuthenticator". This will check the local identity store before the LDAP when authenticating: Note that the server needs to be restarted for the change to take effect. Verify ESS installation The ESS installation can be verified using the following URLs: http://hostName:port/EssHealthCheck/checkHealth.jsp
  • 6. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 4 Use the administrator (OOTB “weblogic”) to log in. The results should be as follows: Figure 2.ESS Health Check More comprehensive test can be executed with URL: http://hostName:port/EssHealthCheck/diagnoseHealth.jsp The results should be as follows: Figure 3.ESS Diagnostic check The host and port in these cases are for the AdminServer i.e. the same as when accessing the WLS Console.
  • 7. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 5 Creating Workspace Create Application Start JDeveloper using "Oracle Fusion Applications Developer" role and create a new customization application. Use “Fusion Web Application (ADF)” application template and enter name such as “EssDemoApp”: Figure 4.Fusion Web Application This will create an application with “Model” and “ViewController” projects. The “Model” project will be used to create ADFbc view object that is used to define parameters for an ESS job. “ViewController” project will contain the UI that is used to submit and monitor the ESS job. Create Metadata Archive (MAR) profile A MAR profile is used to create a MAR archive that is used to package and deploy metadata defined for the ESS application. To create the MAR profile navigate to “Application Properties -> Deployment -> New” choose “MAR File” as the archive type and “EssMar” as name. At the moment we do not have any metadata to include into the archive, the profile will need to be updated once ESS metadata such as Job definition is created. Set default MAR profile
  • 8. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 6 Navigate to “Application Properties -> Run -> MDS” and set the “MAR Profile” to “EssMar” Configure metadata usages In order for us to use metadata provided by the ESS feature we need to define metadata usages. This configuration includes the data source and namespace etc. that define how the seeded ESS metadata such as job types are stored in the MDS repository. The definitions here are reflected on the “Deployment Configuration” screen displayed to the developer when deploying the application. Navigate to “Application Resources -> Descriptors -> ADF META-INF -> adf-config.xml”: In the file add the following content: <adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config"> <mds-config version="11.1.1.000" xmlns="http://xmlns.oracle.com/mds/config"> <persistence-config> <metadata-namespaces> <namespace path="/oracle/as/ess/ext" metadata-store-usage="ess-cp-store-usage"/> <namespace path="/oracle/as/ess/core" metadata-store-usage="ess-cp-store-usage2"/> </metadata-namespaces>
  • 9. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 7 <metadata-store-usages> <metadata-store-usage id="ess-cp-store-usage"> <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore"> <property name="jndi-datasource" value="jdbc/mds-ESS_MDS_DS"/> <property name="repository-name" value="mds-ESS_MDS_DS"/> <property name="partition-name" value="extJobTypes"/> </metadata-store> </metadata-store-usage> <metadata-store-usage id="ess-cp-store-usage2"> <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore"> <property name="jndi-datasource" value="jdbc/mds-ESS_MDS_DS"/> <property name="repository-name" value="mds-ESS_MDS_DS"/> <property name="partition-name" value="essapp-internal-partition"/> </metadata-store> </metadata-store-usage> </metadata-store-usages> </persistence-config> </mds-config> </adf-mds-config> Configure weblogic-application.xml Navigate to “Application Resources -> Descriptors -> META-INF -> weblogic-application.xml” and add the following library references: <library-ref> <library-name>oracle.applcp.model</library-name> </library-ref> <library-ref> <library-name>oracle.xdo.runtime</library-name> </library-ref> <library-ref> <library-name>oracle.ess</library-name> </library-ref> Create jazn-data.xml For the processing some security definitions will be needed for ESS. To create the definitions we need to create a jazn-data.xml file that contains roles and permissions used for the application. Navigate to “Application Resources –> Descriptors -> META-INF” and in context menu choose “New Oracle Deployment Descriptor”:
  • 10. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 8 On the wizard opened accept the defaults and click “Finish”. Create ESS project We will need a new project to contain the ESS related objects. Navigate “New -> Projects -> ADF Model Project “and enter some name such as “Ess”. Add required libraries For “Ess” project navigate to “Project Properties -> Libraries and Classpath -> Add Library” and add the following libraries:  Enterprise Scheduler Extensions  EJB 3.0 Add Dependency to the Model project In our application we will use a VO to define parameters for the ESS job. This “parameter VO” is referred from the ESS metadata and at run-time the system will prompt user input based on the definitions for it. To use the VO the code in “Ess” project will need to have access to it so we will need to add a dependency. Navigate to “Project Properties -> Dependencies” click the edit icon and choose “Build Output” for the Model project.
  • 11. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 9 Configure Project Source Paths Next navigate to “Project Properties -> Project Source Paths -> Resources” and check the “Include content from subfolders”. This is needed to include the resources created in the sub directories to the project. Create the ejb-jar.xml Ejb-jar deployment descriptor contains EJB structural information and Application assembly information (such as EJB references etc.). For our application we need to configure the EJBs used to access the ESS functionality. These beans allow the application to submit request, access ESS metadata etc. To create the file navigate “New->General->Deployment Descriptors->Java EE Deployment Descriptor”, choose “ejb-jar.xml” and “3.0”. Open the file and enter the following content: <?xml version = '1.0' encoding = 'UTF-8'?> <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"> <display-name>ESS</display-name> <enterprise-beans> <message-driven>
  • 12. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 10 <ejb-name>ESSAppEndpoint</ejb-name> <ejb-class>oracle.as.scheduler.ejb.EssAppEndpointBean</ejb-class> </message-driven> <session> <description>Async Request Bean</description> <ejb-name>AsyncRequestBean</ejb-name> <ejb-class>oracle.as.scheduler.ejb.AsyncRequestBean</ejb-class> </session> <session> <description>Runtime Session Bean</description> <ejb-name>RuntimeServiceBean</ejb-name> <ejb-class>oracle.as.scheduler.ejb.RuntimeServiceBean</ejb-class> </session> <session> <description>Metadata Session Bean</description> <ejb-name>MetadataServiceBean</ejb-name> <ejb-class>oracle.as.scheduler.ejb.MetadataServiceBean</ejb-class> </session> </enterprise-beans> </ejb-jar> Create weblogic-ejb-jar.xml Weblogic-ejb-jar.xml is the WebLogic specific deployment descriptor. For our application we need to configure the beans used to access the ESS functionality. These beans allow the application to submit request, access ESS metadata etc. The configuration also includes the principal name to run the logic with. To create the file navigate “New -> WebLogic Deployment Descriptor”, choose “weblogic-ejb- jar.xml” and “10.3”. Open the file and enter the following content (note that the content contains references to the application name, if you used different name the bolded entries must be updated): <?xml version = '1.0' encoding = 'UTF-8'?> <weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar"> <weblogic-enterprise-bean> <ejb-name>ESSAppEndpoint</ejb-name> <message-driven-descriptor> <resource-adapter-jndi-name>ess/ra</resource-adapter-jndi-name> </message-driven-descriptor> <dispatch-policy>ESSRAWM</dispatch-policy>
  • 13. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 11 </weblogic-enterprise-bean> <weblogic-enterprise-bean> <ejb-name>RuntimeServiceBean</ejb-name> <stateless-session-descriptor> <business-interface-jndi-name-map> <business-remote>oracle.as.scheduler.RuntimeServiceRemote</business-remote> <jndi-name>EssDemoApp/runtimeservice</jndi-name> </business-interface-jndi-name-map> </stateless-session-descriptor> </weblogic-enterprise-bean> <weblogic-enterprise-bean> <ejb-name>MetadataServiceBean</ejb-name> <stateless-session-descriptor> <business-interface-jndi-name-map> <business-remote>oracle.as.scheduler.MetadataServiceRemote</business-remote> <jndi-name>EssDemoApp/metadataservice</jndi-name> </business-interface-jndi-name-map> </stateless-session-descriptor> </weblogic-enterprise-bean> <run-as-role-assignment> <role-name>essSystemRole</role-name> <run-as-principal-name>weblogic</run-as-principal-name> </run-as-role-assignment> </weblogic-ejb-jar> Create Deployment Profile We need to create deployment profile to deploy the “Ess” project with the application. To create the deployment profile navigate to “Project Properties -> Deployment -> New” choose “EJB JAR File” as archive type and “ejb-jar” as the name. On the deployment profile set the following:  “General-> Enterprise Application Name“ set the value to “EssDemoApp”  “File Groups -> Project Output -> Contributors” add the “Ess/src” directory  “File Groups -> Project Output -> Filters” make sure the ejb-jar.xml and weblogic-ejb-jar.xml are selected Configure UI project For “ViewController” project navigate to “Project Properties -> Add Library” and add the following libraries:  Application Core (ViewController)  EnterpriseSchedulerExtensions  EJB 3.0
  • 14. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 12 Next navigate to “Project Properties -> Deployment -> Edit (War File) -> General“ and set the “Java EE Web Context Root” to “EssDemo”. This value is used in the URL with which the application is accessed with. Configure web.xml For the UI we need to configure the references to the EJBs used to access the ESS functionality. These beans allow the application to submit request, access ESS metadata etc. Add the following configuration under the “web-app” element in the web.xml: <ejb-local-ref> <ejb-ref-name>ess/metadata</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>oracle.as.scheduler.MetadataServiceLocal</local> <ejb-link>MetadataServiceBean</ejb-link> </ejb-local-ref> <ejb-local-ref> <ejb-ref-name>ess/runtime</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>oracle.as.scheduler.RuntimeServiceLocal</local> <ejb-link>RuntimeServiceBean</ejb-link> </ejb-local-ref> Configure weblogic.xml We need to add library references into weblogic.xml: <library-ref> <library-name>oracle.applcp.view</library-name> </library-ref> <library-ref> <library-name>oracle.xdo.webapp</library-name> </library-ref> Configure EAR Navigate to “Application Properties -> Deployment -> Edit (Ear File) “ and modify the following:  “General -> Application Name” set the value to “EssDemoApp”. The application name will be used as the name with which the application is deployed to WLS. Some of the ESS configuration must match this value otherwise the system will not be able to find the metadata  “Application Assembly” make sure that “EssMar”, “EssDemoApp_ViewController_webapp1” and “ejb-jar” modules are checked. Implement ESS application Next we implement the ESS program and UI to test it with. For the application we need the following:
  • 15. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 13  ESS Job which consists of o Job metadata defines how a process is going to be run, parameters needed for the processing and who is allowed to execute the job o Job implementation that does the actual processing  View Object that is used to obtain the parameters from the user when submitting the ESS Job  UI that can be used to submit the job and monitor its progress for testing purposes. Create Parameter View Object The parameter view object is used to obtain the parameters from the user when submitting the ESS Job. In our example project we will have two parameters; a string that the user will define by selecting from a choice list and a date. Create View Object for the Choice List In order to provide the user with a choice list when entering the parameters we need to first define a view object that contains the values available. Select the “Model” project and navigate “New -> ADF Business Components -> View Object”. When prompted enter the connection details to your local database. Enter “StatusVO” as the name and choose “Rows populated at design time (Static List)” as the data source. Add 2 attributes “Code” and “Value”, set the code as primary key. “Code” will be used as the value passed to the job, the user will see the “Value”. Enter some data for the attributes such as “NEW” / “New” and “COMPLETE” / “Complete”. Create View Object for parameter Select the “Model” project and navigate “New -> ADF Business Components -> View Object”. When prompted enter the connection details to your local database. Enter “ParameterVO” as the name and choose “Read-only access through SQL query as the data source. Use the following as the query: SELECT NULL AS ATTRIBUTE1, to_date(NULL) AS ATTRIBUTE2 FROM DUAL Set each attribute to be updatable “always”. Select “Attribute1” and click “plus” icon on the “List of Values: Attribute1”. Choose “StatusVO1” as the “List Data Source” and “Code” as the “List Attribute. Click “UI Hints” and move “Value” to the selected on the “Display Attributes” component. For each attribute on the VO click “Edit” and in the “Control Hints” set the following:  Attribute1: o “Label Text” to “Status” o “Display Width” to “10”  Attribute2: o “Label Text” to “Date” o “Format Type” to “Simple Date” o “Format“ to “dd-MMM-yyyy”
  • 16. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 14 Create ESS Job Select the “Ess” project and navigate “New -> Enterprise Scheduler Metadata -> Job Definition”. Enter data such as:  Name: EssDemoJob  Package: oracle.apps.demo  Job Type: /oracle/as/ess/core/JavaJobType  Create Java Class: Checked  Java Package: oracle.apps.demo  Class Name: EssDemoJob
  • 17. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 15 Set job properties Next we need to set some properties on the Job in order for us to use it with the submission and monitoring UIs provided by Fusion Applications. Navigate to the job definition and set the following:  Application Defined properties: o “JobDefinitionName” to “EssDemoJob” o “JobPackageName” to “oracle.apps.demo” o “JobDefintionApplication” to “EssDemoApp” o “srsFlag” to “Y” o “parametersVO” to “oracle.apps.model.view.ParameterVO”  System Properties: o “SYS_effectiveApplication” to “EssDemoApp” For details on the Job definition and its parameters refer to this section of Developer's Guide for ESS. Implement processing logic Next we need to implement the actual processing for the job. In our case we are simply going to print out the values passed in by the user. Open the “EssDemoJob.java” generated on job creation and add the following content: package oracle.apps.demo; import oracle.as.scheduler.Cancellable;
  • 18. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 16 import oracle.as.scheduler.Executable; import oracle.as.scheduler.ExecutionCancelledException; import oracle.as.scheduler.ExecutionErrorException; import oracle.as.scheduler.ExecutionPausedException; import oracle.as.scheduler.ExecutionWarningException; import oracle.as.scheduler.RequestExecutionContext; import oracle.as.scheduler.RequestParameters; public class EssDemoJob implements Executable, Cancellable { public void execute(RequestExecutionContext ctx, RequestParameters params) throws ExecutionErrorException, ExecutionWarningException, ExecutionCancelledException, ExecutionPausedException { System.out.println("**** Sample Job Running, Request ID: " + ctx.getRequestId()); String arg1 = ((String)params.getValue("submit.argument1")); System.out.println("**** Argument 1 = " + arg1); String arg2 = ((String)params.getValue("submit.argument2")); System.out.println("**** Argument 2 = " + arg2); } public void cancel() { } } Add metadata to the MAR file Navigate to “Application Properties -> Deployment -> Edit (MAR File)” and set the following:  “Metadata File Groups -> User Metadata -> Add” and add the “essmeta” directory under “Ess” project  “Metadata File Groups -> User Metadata -> Directories” check the “oracle.apps.demo” directory Implement UI To test the application we need UI for submitting and monitoring the job. For this we will use Fusion Applications ESS UI, Create Page
  • 19. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 17 For the test we create a test page, on the “ViewController” project navigate “New -> Web Tier -> JSF -> JSF Page” and enter name “EssDemo.jspx”. Inside the “form” component add a “Panel Stretch Layout” component. For the “Panel Stretch Layout” add attribute “styleClass="AFStretchWidth"”, this will ensure that the embedded UI will display correctly. Next navigate to “Resource Palette -> File System -> Applications Core -> MonitorProcesses-View.jar -> ADF Task Flows”, drag and drop the “MonitorProcessesMainAreaFlow” to the center facet of the “Panel Stretch Layout”. When prompted add the ADF library. No parameters need to be entered to the taskflow. The page should look something like this: <?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <jsp:directive.page contentType="text/html;charset=UTF-8"/> <f:view locale="#{applCorePrefs.locale}"> <af:document id="d1"> <af:form id="f1"> <af:panelStretchLayout id="psl1" styleClass="AFStretchWidth"> <f:facet name="bottom"/> <f:facet name="center"> <af:region value="#{bindings.MonitorProcessesMainAreaFlow1.regionModel}" id="r1"/> </f:facet> <f:facet name="start"/> <f:facet name="end"/> <f:facet name="top"/> </af:panelStretchLayout> </af:form> </af:document> </f:view> </jsp:root> Add permissions We need to add permission to the jazn-data.xml to allow the system access to the metadata and ESS functionality. In our case for simplicity we are granting the access to anonymous so the application can be accessed without authentication. Navigate to the “Application Resources->Descriptors->META- INF -> jazn-data.xml” and replace the content with the following content:
  • 20. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 18 <?xml version='1.0' encoding='utf-8'?> <jazn-data> <jazn-realm default="jazn.com"><realm><name>jazn.com</name><users></users></realm> </jazn-realm> <policy-store> <applications> <application> <name>EssDemoApp</name> <jazn-policy> <grant> <grantee> <principals> <principal> <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class> <name>anonymous-role</name> </principal> </principals> </grantee> <permissions> <permission> <class>oracle.as.scheduler.security.MetadataPermission</class> <name>*</name> <actions>READ,EXECUTE,CREATE,DELETE</actions> </permission> </permissions> </grant> <grant> <grantee> <principals> <principal> <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class> <name>anonymous-role</name> </principal> </principals> </grantee> <permissions> <permission> <class>oracle.adf.share.security.authorization.RegionPermission</class> <name>view.pageDefs.loginPageDef</name> <actions>view</actions> </permission> <permission>
  • 21. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 19 <class>oracle.as.scheduler.security.MetadataPermission</class> <name>*</name> <actions>READ,EXECUTE,CREATE,DELETE</actions> </permission> </permissions> </grant> </jazn-policy> </application> </applications> </policy-store> </jazn-data> Deployment The application needs to be deployed in separate step. First start the server: Once the service is up and running we deploy the application. Navigate “Application -> Deploy -> EssDemoApp_application1”, choose to deploy on the “IntegratedWeblogicServer”, “Deploy to all instances in the domain” and “Deploy as standalone Application”, on the “Deployment Configuration” accept the defaults:
  • 22. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 20 Testing Once deployed we can access the application with URL such as: http://host:port/EssDemo/faces/EssDemo.jspx
  • 23. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 21 To test the application click the “Schedule New Process” and choose the “EssDemoJob” from the “Schedule New Process” popup. On the “Process Details” popup the parameters displayed are derived from the ParameterVO that we associated with the Job. Note that:  The label of the field comes from the control hints on the VO  The String parameter has choice list from which the value can be obtained  The date field has a icon that can be used to invoke component to select the date  The date field has a format that matches the control hint defined on the VO
  • 24. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 22 Once submitted we can observe from the Integrated WLS log that the processing enters our java logic: The result can also be queried from the UI:
  • 25. How to Get Started With Oracle Enterprise Scheduler Service (ESS) for Fusion Applications 23 Troubleshooting MDS-00521 Sometimes when trying to access the URL for the application get: oracle.mds.exception.MDSRuntimeException: MDS-00521: error while reading document /META-INF/adfc-config.xml from metadata repository error reading zip file It is unclear why this happens as the deployment succeeded without problems. The resolution is to re- deploy the application. ESS-02002 User weblogic does not have sufficient privilege to perform operation It the ESS health check scripts fail with: oracle.as.scheduler.MetadataServiceAccessControlException: ESS-02002 User weblogic does not have sufficient privilege to perform operation READ. at oracle.as.scheduler.metadata.mds.MetadataDelegator._checkPermission(MetadataDelegator.ja va:127) This can be fixed by changing the order of the authenticators as described in section "Create and Configure Integrated WebLogic Server (WLS) -> Configure Domain". Also make sure that the server was restarted after the change. Conclusion In this article we have covered an overview of the components related to ESS and illustrated the minimum steps to create environment and use it to build and test a simple ESS job. References  Oracle Fusion Middleware Developer's Guide for Oracle Enterprise Scheduler  Oracle Fusion Applications Extensibility Guide  Fusion Developer's Guide for Oracle Application Development Framework - Deploying Fusion Web Applications  EJB Deployment Descriptor Reference  weblogic-ejb-jar.xml
  • 26. How to Get Started With Oracle Enterprise Scheduler Service for Fusion Applications August 2013 Author: Jani Rautiainen Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 oracle.com Copyright © 2013, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0113