Sunday, May 24, 2009

Runtime: BPEL Rules Engine

Steps to update the value of a certain field at runtime using Oracle Business Rules Engine (BRE) using version 10.1.3.4 of Oracle SOA Suite:

1. Log into BPEL Console -> Click on the process where you want to change the rule -> Click on the decision service as shown:





2. Click on Open Rules Author above which will prompt you to log in to the BRE.




3. Once logged in to BRE, change to the rule. In the case below: I have changed the user from "jlondon" to "jstein".

4. After changing the value -> save the dictionary and update the version as show below:


5. Go back to BPEL console -> All new instances of the BPEL process after the change will pick the updated user as shown below:

Note: If you are using version 10.1.3.3 of SOA Suite or below, you might have to clear the WSDL cache in order to pick the changes from the BRE.

Tuesday, May 19, 2009

Free space in Oracle tablespaces

I occasionally want to know what tablespaces I have defined, how big they are and how much free space is available.

Thanks to Praveen at http://www.expertsharing.com/2008/02/26/calculate-size-of-tablespace-free-space-of-a-tablespace/ for providing the following query, which makes this information available easily.

set pages 999;
set lines 132;
SELECT *
FROM
( SELECT
c.tablespace_name,
ROUND(a.bytes/1048576,2) MB_Allocated,
ROUND(b.bytes/1048576,2) MB_Free,
ROUND((a.bytes-b.bytes)/1048576,2) MB_Used,
ROUND(b.bytes/a.bytes * 100,2) tot_Pct_Free,
ROUND((a.bytes-b.bytes)/a.bytes,2) * 100 tot_Pct_Used
FROM
( SELECT
tablespace_name,
SUM(a.bytes) bytes
FROM
sys.DBA_DATA_FILES a
GROUP BY
tablespace_name
) a,
( SELECT
a.tablespace_name,
NVL(SUM(b.bytes),0) bytes
FROM
sys.DBA_DATA_FILES a,
sys.DBA_FREE_SPACE b
WHERE
a.tablespace_name = b.tablespace_name (+)
AND a.file_id = b.file_id (+)
GROUP BY
a.tablespace_name
) b,
sys.DBA_TABLESPACES c
WHERE
a.tablespace_name = b.tablespace_name(+)
AND a.tablespace_name = c.tablespace_name
)
WHERE
tot_Pct_Used >=0
ORDER BY
tablespace_name;

Monday, May 18, 2009

SOA SDLC using OER and OSR

I was asked by a customer how to do SOA SDLC in an Oracle SOA Suite environment.

The idea was to use dynamic lookups using UDDI in Oracle BPEL and the Oracle ESB components, thus migrating the same code between different environments. See Antony Reynolds' blogs -
http://blogs.oracle.com/reynolds/2008/11/bpel_deployment_framework.html and http://blogs.oracle.com/reynolds/2008/05/register_of_interest.html for detailed approach.

After creating entries and replicating the entries from one registry to another registry instance, simulating a dev->qa->dev migration, we figured out it is going to be a very difficult process to implement with no automation and a lot of 'search and replace'.

I investigated the use of the Oracle Enterprise Repository and was suprise that Oracle does not push the product harder into the market.

The steps I followed, after installation of the OER, SOA Suite (including Oracle Service Registry) and JDeveloper, was as follows:

1. Configured JDeveloper to use the OER plugin to deploy artifacts from JDeveloper directly into the repository. See instructions in BEA_HOME/repository103/core/tools/solutions/OER103-SOA-BPM-Harvester.zip readme file.



2. Configured the types which should be exposed in the UDDI registry to either a UDDI Business Entity or UDDI Business Service Entity. Documented in http://download.oracle.com/docs/cd/E13164_01/oer/docs10134/regman/index.html


3. Configured the OER103-RR-ExchangeUtility to talk to the UDDI Registry, with a query of what information should be published to the UDDI.


<uddi:registryManagerSettings xmlns:uddi="http://www.bea.com/aler/integration/config/uddi">
<repository>
<uri>http://localhost:7101/oer</uri>
<credentials>
<user>admin</user>
<password>admin</password>
</credentials>
</repository>
<query>
<repositoryQuery> <-OER to OSR query
<businessEntities/>
<services>
<service name="%"/>
</services>
<destinationRegistries>
<destinationRegistry>TEST_UDDI</destinationRegistry>
</destinationRegistries>
</repositoryQuery>
<registryQuery>
<-OSR to OER query
<businessEntities/>
<services>
<service name="%"/>
</services>
<qualifiers>
<qualifier>approximateMatch</qualifier>
</qualifiers>
<sourceRegistry>TEST_UDDI</sourceRegistry>
</registryQuery>
</query>
<registries>
<registry name="TEST_UDDI">
<inquiryURI>http://localhost:8080/uddi/inquiry</inquiryURI>
<publishURI>http://localhost:8080/uddi/publishing</publishURI>
<securityURI>http://localhost:8080/uddi/security</securityURI>
<credentials>
<user>admin</user>
<password>admin</password>
</credentials>
</registry>
</registries>
</uddi:registryManagerSettings>

4. Deployed an existing BPEL Project from JDeveloper to OER. (As easy as right-click on the project and 'Submit this project to Oracle Enterprise Repository')

[repository.submit] Saving the attributes for asset {http://xmlns.oracle.com/OERDemoBPEL}OERDemoBPEL.wsdl
[repository.submit] Saving the attributes for asset {http://xmlns.oracle.com/OERDemoBPEL}__OERDemoBPEL.wsdl
[repository.submit] Saving the attributes for asset {http://xmlns.oracle.com/OERDemoBPEL}OERDemoBPEL.bpel-2
[repository.submit] Saving the attributes for asset {OERDemoBPEL.jpr}BusinessProcess/OERDemoBPEL
[repository.submit] Saving the attributes for asset {OERDemoBPEL.jpr}Interface/OERDemoBPEL
[repository.submit] Saving the attributes for asset {OERDemoBPEL.jpr}Interface/OERDemoBPELCallback
[repository.submit] Saving the attributes for asset {OERDemoBPEL.jpr}Interface/OERDemoBPEL
[repository.submit] Saving the attributes for asset {http://xmlns.oracle.com/OERDemoBPEL}OERDemoBPEL.xsd
[repository.submit] Saving the attributes for asset {OERDemoBPEL.jpr}Interface/OERDemoBPELCallback


5. Manually executed the Registry Exchange tool in a publish mode.

OER Exchange Utility : v10.3 - 09/29/2008
usage:alrrx <-mode-map-publish_tmodel-link>

-mode : "publish" to publish Services
: "receive" to receive Services
-config : File that configures the Registry Manager
-map : Generate the UDDI Mapping file
-publish_tmodel : Publish the t-models
-link : Link a Service in OER to a Service in OSR.

OK, maybe it was not that easy, as I still have to figure out why the actual BPEL invocation endpoint did not filter through.


A couple of interesting facts:
  • The registry entries can be filter to go to different UDDI registries, depending on the query specified. An example might be to send SOA artifacts which got a status of 'In development' to a development registry and a status of 'Production' to a production registry.
  • The UDDI registry key stays the same, even if a new version of an artifact is created.
  • Existing information can be harvested using various methods. Introspection of code, HTTP, UDDI imports and directory harvesting is some of the options available to gather artifacts and populate the repository.

By using the dynamic UDDI functionality of the Oracle SOA Suite components, the above method can expose an easy way of controlling the life-cycle of your SOA artifacts. AND that is not even taken the standard functionality of OER into account.

Another interesting aspect of the OER is the emission of events. These events can be interrogated and automatic deployment can be triggered. An example might be if an artifact is mark as production ready, it can be deployed automatically to the production environment. - But I leave that investigation for another day !

Monday, May 11, 2009

ODI BPEL Integration

ODI exposes scenarios as webservices, which can be consumed in BPEL.


1.Configure AXIS2 follow the steps in documentation $ORACLE_HOME/doc/webhelp/en/setup/install_snpsws.htm


Make sure you use the Axis2 1.2 version and the administrator username is admin, with a password of axis2.


The test URL is:http://yoursever:port/axis2/axis2-web/HappyAxis.jsp


2.In you BPEL process create a Partner Link to point to http://yourserver:port/axis2/services/OdiInvoke?wsdl


3.Create an Invoke node and select the partner link created in above step.


4.Select the operation to be invokeScenario and create the input and output variables for the invoke.


5.Assign the values to the input variables defined above, to reflect the connection to the repository you have defined your scenario in:


oracle.jdbc.driver.OracleDriver to RepositoryConnection->JdbcDriver

jdbc:oracle:thin:@yourhost:1521:SID to RepositoryConnection->JdbcUrl

Odi to RepositoryConnection->JdbcUser

Odi to RepositoryConnection->JdbcPassword

SUPERVISOR to RepositoryConnection->OdiUser

SUNOPSIS to RepositoryConnection->OdiPassword

DEVELOPMENT to RepositoryConnection->WorkRepository


6.Assign the values to the input variables defined above, to reflect the command to execute:




SCENARIONAME to Command->ScenName

001 to Command ->ScenVersion

GLOBAL to Command ->Context

5 – defaults to 5 if not set to Command ->LogLevel

1 – defaults to 1 if not set to Command ->SyncMode

AsynchronousBPEL Process to Command->SessionName

Not Required to Command->Keywords

Name value pairs, if variables is in use to Command->Variables


7.Assign the values to the input variables defined above, to reflect the agent to execute the command on:


Yourhost to Agent->Host

20910 to Agent ->Port


8.After the invocation of the ODI partner link, the output variable will contain the status in CommandResultType structure: Ok (boolean), the created SessionNumber and the ErrorMessage (if any).


9.If the SyncMode was specified as asynchronous, the status of the process can be queried using the invokeSession operation on the partner link. The status returned is the same as in 8 above.

Sunday, May 10, 2009

ODI for eBusiness Suite Integration - in 4 Steps

1.Connect
Create an Oracle Database Server to connect to Oracle eBusiness Suite schema, ‘apps’ in the Topology Manager:






2.Reverse Engineer

The next step is to reverse engineer the Oracle eBusiness schema, using the Oracle Data Integrator’s Reverse Engineering Knowledge Module for eBusiness Suite.

Create a new Model as follow, using Oracle as technology:




In the ‘Reverse’ tab, select ‘Customized’ and select the ‘RKM E-Business Suite XML to eBusiness’ knowledge module.




Before clicking ‘Apply’ select the ‘Application List’ and define the value of the list of application modules you want to reverse engineer. Remember also to select the ‘Types of objects to reverse-engineer’. If you forget to select the ‘View’ object, you would not be able to get a list open interface tables, as most of them are based on view objects. The value specified takes the form of ‘xxx’,’yyy’ if you want to specify multiple application modules to reverse engineer.

In our example we will use ‘SQLAP’.

A list of the available modules can be extracted by running a select query against the table ‘APPLSYS.FND_APPLICATION’.

select application_short_name from APPLSYS.FND_APPLICATION;

APPLICATION_SHORT_NAME
--------------------------------------------------
ABM
AD
ADS
ADS_DEV
AHL
AHM
ASG
....


Click on ‘Reverse’. Select the agent where the reverse engineering process would be executed.

Open the Operator utility and monitor the progress on the reverse engineering process, if required. This process can run a couple of minutes, depending on the implementation of the Oracle eBusiness Suite.


After the above process finishes, the Model will contain all the available interfaces and public tables for the selected module(s).



3.Integrate

Design your interface, for example reading an XML-file into the invoice open interface table.

On the flow tab of the designed interface, select the target. Change the IKM (Integration Knowledge Module) to ‘IKM E-Business Suite (Open Interface):



You will notice the configuration parameters at the bottom of the screen, starting with the OA_, and the ‘SUBMIT_PROGRAM’. These parameters are the information required by ODI to fire off a concurrent program in eBusiness Suite, after completion of the load of the data into the open interface table.

4.Execution

After execution of this interface, you would notice the new steps, which does the integration using the Oracle eBusiness Suite Concurrent Manager to suck in the information from the Open Interface Tables.



Thursday, May 7, 2009

SOA-OID Integration

Steps to configure Oracle BPEL PM and OID:

Step 1: Perform Pre-configuration Procedures

1. Log in to the Oracle Enterprise Manager 10g Application Server Control Console: http://hostname:port/em

2. Click the OC4J instance name in the Members section OC4J: oc4j_name page appears

3. Click the Administration tab

4. Go to the Security section in the Task Name column

5. Click the icon in the Go to Task column for Identity Management and configure the OID host and port as show below:

6. Click the icon in the oc4j_name link

7. Click the icon in the Go to Task column for Security Providers
Application names --> Security Provider changed to Oracle Identity Management Security Provider as shown in the figure below:
* Orabpel
* BPELPortlet
* hw_services
* worklist
* deploy_service

8. If the password is not alpha-numeric do the following: Set Number of Numeric characters to "0".



Step 2: Perform Configuration Procedures

1. Ensure that the ORACLE_HOME environment variable is set to the root directory of the Oracle Application Server instance being configured.
Example: set ORACLE_HOME = c:\soa

2. cd SOA_Oracle_Home/bpel/system/services/install/ant-tasks

3. configure_oid.bat oid_admin_user oid_admin_passwd oid_nonssl_port ssl_enabled oid_realm_name seedAllUsers seedRequiredUsers oc4j_admin_user oc4j_admin_passwd oc4j_container_name

Example: configure_oid.bat orcladmin welcome1 389 false gen2 seedAllUsers oc4jadmin welcome1 oc4j_soa

On Successful build: The execution of this command internally modifies the SOA_Oracle_Home/bpel/system/services/config/is_config.xml file. The file contents look as follows:

<?xml version ='1.0' encoding = 'UTF-8'?>
<ISConfiguration xmlns="http://www.oracle.com/pcbpel/identityservice/isconfig">
<configurations>
<configuration realmName="gen2" displayName="gen2 Realm">
<provider providerType="JAZN" name="OID" service="Identity">
<connection url="ldap://ofm-poc2.au.oracle.com:389" binddn="cn=orcladmin" password="blah!==" encrypted="true"/>
</provider>
</configuration>
</configurations>
</ISConfiguration>


4. If the build fails for reasons below:
bpel-grant-privileges:
[echo] Granting Server privileges to BPMSystemAdmin role...
[java] May 04, 2008 9:46:17 AM oracle.security.jazn.login.module.RealmLogin
Module authenticate
[java] SEVERE: [RealmLoginModule] authentication failed
[java] Authentication Failed

It was because there was an old account with same username (such as bpeladmin, oc4jadmin) on the OID server. The setup script tried to authenticate with the old accounts with different passwords and failed. The solution is to delete and re-create those accounts, and reset the passwords.

5. Configure OID as shown in the figure below:


6. Create Users jcooper, jstein etc

7. Assign the users created in step #6 above to BPMPublic group as shown in the figure below:

8. Navigate to SOA_Oracle_Home/bpel/system/services/config/ wf_client_config.xml ,
Change the following setting:

<!-- specifies the mapping for portal realm to is_config realm-->
<portal>
<realmMapping>gen2</realmMapping>
</portal>

9. Navigate to C:\soa\j2ee\home\config\jazn.xml and change the following to:

<jazn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/jazn-10_0.xsd" schema-major-version="10" schema-minor-version="0" provider="LDAP" location="ldap://ofm-poc2.au.oracle.com:389" default-realm="gen2" >

10. Navigate to C:\soa\j2ee\home\config\jazn.xml and change the following to:

<jazn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/jazn-10_0.xsd" schema-major-version="10" schema-minor-version="0" provider="LDAP" location="ldap://ofm-poc2.au.oracle.com:389" default-realm="gen2" >


I would like to thank Pieter, Mark and Clarence for their contribution.