Friday, October 18, 2013

Learner Series: Oracle BPEL Receive & Pick Activity With Example

This post is part of the Oracle SOA BPEL learner series.

I have been getting lots of requests to write on basic SOA BPEL use-cases from my blog readers who are starting up on SOA initiatives. One such request that often comes across is the basic difference  between the usage of a pick and receive constructs in a BPEL process.

I have created a working BPEL use-case which contains both pick & receive activities in one SOA project.

A quick introduction to BPEL Pick & Receive Constructs;

Receive Activity: This is the first activity in most of the BPEL processes. As the name indicates, this construct receives information/message from a partner link.

Pick Activity: This activity is very similar to the receive construct. But unlike the receive activity which gets triggered only when a partner link invokes it, the Pick activity has 2 choices (On Message & On Alarm) - It waits for a message from a partner link or triggers another set of activities on timeout.

Use-Case: (Hypothetical but conveys the message)

A BPEL process (ReceivePick) gets a "Customer Name" as input, calls another BPEL process (CustomerCreditScoreWS) to get the customer's credit score. The CustomerCreditScoreWS process validates if the customer name starts with "A" and returns a credit rating immediately; else the process waits for 10 seconds before returning a blank response. The ReceivePick BPEL process waits for a message (credit score) from the CustomerCreditScoreWS process. If it gets a response (On Message: credit score), the process completes by returning a "Success" message; otherwise in the event of not getting a response for 8 seconds (On Alarm: 8 seconds) the process waits and terminates by returning a "Failure".

Receive-Pick BPEL Constructs at a glance
You can download the source code for this sample here

Friday, July 12, 2013

OER (Oracle Enterprise Repository) Reporting Feature (BI Publisher)

Oracle Enterprise Repository (OER) provides total control and manageability of all your SOA assets and also tracing the relationships between various services, business processes and other assets in your enterprise.

By SOA governance through OER, you can gain greater visibility into your SOA assets, reduce redundancy, track usage, credit projects that reuse assets thereby promote reuse of the same - resulting in cost savings & better maintenance.

One of the core features of any SOA governance product is the support to render various reports;

In order to enable OER reports, you will need to have BI publisher installed which will augment detailed analytic & reporting capability to OER. Without this, OER reports screen will display the following message;

Please set the system setting for Report Server URL. Reports cannot be run until this has been properly set.

Once BI publisher is installed, perform the following configurations to enable OER reporting;

Configure BI Publisher with OER:

1. Stop BI Publisher server
2. In the OER server install, Extract the 11.1.1.7.0-OER-BIP11gReports.zip file [This zip file can be found under <OER_HOME>/core/tools/solutions/reports]
3. Copy "OER" folder from the "Oracle" folder (Assuming the install is on Oracle DB - else copy OER folder from appropriate DB folders that are supported) into the following BI publisher directory;

<BIDomain>/config/bipublisher/repository/reports

4. Start the BI Publisher server and verify whether the OER folder is shown under the "Shared Folders" by visiting the following URL;
http://<hostname>:<port>/xmlpserver

Configure OER JDBC Data Source:

1. Login to BI Publisher as admin user (eg. weblogic)
2. Click on the "Administration" tab

3. Under the "Data Sources" section, choose "JDBC Connection"

4. Click on "OER" data source and ensure that BI Publisher can successfully connect to OER

Configuring the Reporting settings on OER:

1. Login to OER as admin user and click on "Admin" tab

2. Click on "System Settings" in the left admin panel

3. In the "Search" text box, type "report" - This will automatically filter the setting results and show only the "Reports" section

4. Ensure that the following properties are set properly

  • Enable Reports - True
  • Report Server URL - http://<hostname>:&lt:port>/xmlpserver/OER
  • Report Server Endpoint URL - http://<hostname>:&lt:port>/xmlpserver/services/PublicReportService
  • Report Server Username: admin (user to connect to BI Publisher server)
  • Report Server Password: password for admin user
5. Save the settings

Now, go back to the "Reports" page in OER and enjoy generating reports. There are many out-of-box reports that OER provides. You can also create custom reports in BI publisher and make them available in OER - That will be a topic for my next post :)

If you want to enable single sign-on between OER & BI Publisher, then you will have to create a OER user on BI Publisher server and assign the BI groups (OER_Reports) to this user. You will have to then configure this user under the OER reports section for seamless access.

Solving BPM PS6 (11.1.1.7) Webform Rendering Issue

When the server host name is not properly set during SOA installation, BPM picks up the default server URL while rendering webforms. This could cause rendering issue since webform expects full server hostname (localhost or short server hostname will not render the webform content).

Check out here for further configuration required for BPM PS6 WebForms...

Often the easier fix would be to manually update the host name in the enterprise manager for each of the human tasks in the BPM process. But that could be time consuming especially if you have many human tasks in your process and redo this every time you redeploy the process.

To have a permanent fix in place so that all human task webforms in future use the fully qualified hostname, set the FusionAppsFrontEndHostUrl property in your soa-infra as shown below;

1. Login to EM console as administrator (eg. weblogic)

2. Expand SOA, Right-Click on soa-infra -> choose SOA Administration -> Workflow Properties

3. In the resulting "Workflow Notification Properties" screen click "More Workflow Notification Configuration Properties..."

4. Enter the required fully qualified URL in the "FusionAppsFrontEndHostUrl" property in the following format;
*=http://hostname:port
5. Click on "Apply" and save the settings.

Henceforth, all BPM deployments would make use of the FusionAppsFrontEndHostUrl to render the forms.

Saturday, June 22, 2013

BPM 11.1.1.7 Composer Web Form Creation

Web Forms are one of the most anticipated features delivered as part of the latest Oracle BPM PS6 release (11.1.1.7). What is so special about it? Well, until PS5 Oracle BPM supported only one form of human task UI development - the out of the box ADF style of development which required the use of Oracle JDeveloper IDE and in complex scenarios invariably required the help of IT dept.

Starting PS6, Oracle BPM supports Web Forms which is a welcome feature especially for business analysts/process owners who have very high business process knowledge but little IT/development. Oracle BPM PS6 allows business users to create & implement a complete end-to-end business process (including user task UIs) from a blank canvas via their web browsers.

However, while trying to create a web form from BPM composer, you may encounter the following error;

Error getting form: OrderProcessForm
Caused by: Could not instantiate form: got wrong status=500


This is just a configuration issue which can be resolved in a jiffy.

Just make a note of the fully qualified machine hostname where BPM PS6 is installed.
For eg., sathyam-lap.oracle.com

1. Login to WebLogic console [http://sathyam-lap.oracle.com:7001/console]
2. Expand Environment and choose Servers from the "Domain Structure" panel

3. Click on the managed server where SOA/BPM is installed from the list of servers [Generally, soa_server1 on port 8001]
4. In the "Settings for soa_server1" page, choose "Protocols" tab from top menu & "HTTP" tab in the sub menu bar [You can update this for all servers to keep the URLs uniform]
5. Update the "Frontend Host" entry with the fully qualified machine hostname


Now, login to BPM composer and try to create/access your webform and it must be rendered properly.
Note that you must always access all server URLs using the fully qualified hostname
eg., http://sathyam-lap.oracle.com:8001/bpm/composer

Tuesday, June 4, 2013

BPM 11g Workspace - Initiator Task: No Applications Found

Of late, I have been seeing users getting this issue of not being able to initiate the BPM process due to non-availability of the process under the "Available Processes" panel in the BPM workspace.

This issue is not specific to Initiator tasks and can occur for any human task in a BPM process. Note that this issue is tough to reproduce and is very intermittent.

Not to worry. It is curable ;)

Check 1:

Ensure that the role mapping is done for the BPM application roles in the BPM workspace

Check 2:

1. Login to EM console as administrator
2. Choose your BPM application under soa-infra -> default
3. On the RHS, click on the appropriate human task under the "Component Metrics" section
4. On the resulting screen, go to Administration tab
5. Check if taskform URI information is available

More often, this information might be missing and you may have to manually configure this;

Sample information is provided below (Click on the "Add URI" button)

Application Name: worklist
Host Name: localhost (provide appropriate hostname information here)
HTTP Port: 8001 (SOA managed server port)
HTTPS Port: 0
URI: /workflow/ManageOrderUI/faces/adf.task-flow?_id=ManageOrderTask_TaskFlow&_document=WEB-INF/ManageOrderTask_TaskFlow.xml

URI information is just an example. Update it to match your ADF taskflow definition.

Hope this helps in the resolution of the issue.

Saturday, June 1, 2013

Unable to Login BPM Workspace/Composer

Last week I installed BPM PS6 on one of my local servers. Since it was intended to be a development environment, I configured my WebLogic domain to have a single server which would double up as my SOA/BPM server in additions to its Admin server capabilities.

After a clean install, while trying to login as weblogic [the administrator user] in to the BPM workspace or BPM composer, these applications wouldn't allow access throwing "Login Error" & "Authentication Error" respectively. However, I was successfully able to login to the WebLogic console & EM with same credentials.

On investigating the server logs, the following errors were reported by the managed server;

[APP: BPMComposer] BPM-80102: Error while creating the security service.  Cause: Identity Service Configuration error.[[ Identity Service Configuration has error.
Please refer to the identity service configuration guidelines and correct the Identity Service configurations. Contact Oracle Support Services if error is not fixable.
javax.security.auth.login.LoginException: BPM-80102: Error while creating the security service.  Cause: Identity Service Configuration error.
........
........
........
Caused by: ORABPEL-10555
Identity Service Configuration error.
Identity Service Configuration has error.
........
........
Caused by: oracle.bpel.services.workflow.client.WorkflowServiceClientException: javax.xml.ws.WebServiceException: oracle.fabric.common.PolicyEnforcementException: PolicySet Invalid: WSM-02557 oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "&(policysets:global/%)(@appliesTo~="WS-Client()")" is queued for later retrieval. WSM-02557 oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "/policies/oracle/no_authentication_client_policy" is queued for later retrieval.

Clearly the error states an issue with the policy manager under OWSM (Oracle WebServices Manager).

If this is not the error message in your logs, you may review the blog post here to see if that helps.

Solution:

Step 1:

1. Login to WLS console (http://hostname:port/console) as weblogic [Admin user]
2. Under the Data Sources, ensure that the mds-owsm jdbc data source is targeted at the SOA managed server [If you have a single server install verify that it is targeted at AdminServer]. If not, edit the data source & update targets

Step 2:

1. Under the "Deployments" section of WLS console, make sure that the wsm-pm enterprise application is running. If the deployment state is other than "Active", there is a good posibility that this application is not targeted on the SOA managed server.
2. Solution here is to target this application manually on the SOA server. To do this, click on the wsm-pm application -> Go to Targets tab -> choose the wsm-pm root component -> Click on "Change Targets" -> Check the SOA managed server (or AdminServer in case of single server install) and choose "Yes".

Now, you should be able to successfully login to the BPM workspace & BPM composer applications.

Wednesday, April 24, 2013

JDeveloper SOA Deployment Error: Unable to find a WSDL that has a definition for service

This is one of the strange errors that I encountered recently. While trying to deploy a SOA project, JDeveloper reported the following error;


Received HTTP response from the server, response code=500
Error deploying archive sca_CreditCardProcess_rev1.0.jar to partition "default" on server soa_server1 [http://bpmsrv.example.com:8001] 
HTTP error code returned [500]
Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed: Unable to find a WSDL that has a definition for service {http://xmlns.oracle.com/bpmn/bpmnProcess/CreditCardProcess}CreditCardProcess.service and port CreditCardProcessPort.  Please make sure that the port attribute for the binding defined in the composite file is correct by checking the namespace, service name, and port name.  In addition, check that the WSDL associated with the binding namespace is imported and currently reachable (check the import nodes at the top of the composite file). Finally, validate the HTTP proxy settings for the server..

Check server log for more details.
Error deploying archive sca_CreditCardProcess_rev1.0.jar to partition "default" on server soa_server1 [http://bpmsrv.example.com:8001] 
####  Deployment incomplete.  ####

The error reported in JDeveloper is very misleading and it took me significant amount of time & effort to figure out the actual root cause. This was particularly strange in my case because the code was deployed multiple times successfully without errors in my dev environment.

Root Cause:

On closer observation into the soa server logs, I noted that a webservice reference was not "reachable" by the SOA composite and hence this error. This had nothing to do with the "exposed" service, its port or definitions whatsoever.

Fix:

In my case, the referenced webservice's hostname mapping was missing in my "new" environment because of which the SOA composite was unable to find the WSDL during deployment. It is fair for JDeveloper not to complain because it usually runs on client machine/laptop where the hostname mappings might exist. The deployment error is thrown at the server side and hence the key is to analyze the SOA server logs to figure the actual issue for a fix.

Hope this will help users with similar issues.