Thursday, February 26, 2015

#379 Oracle RightNow Adapter















Just tried out the adapter...works a dream!

User Guide Doc here

This simple lab covers the simple scenario of getting Incident information from RightNow.

Get it from Google docs here

Wednesday, February 18, 2015

#378 Installing Oracle API Manager

Pre-requisite -

Oracle DB - I am using XE 11g.

Download the required software -

API Mgr, FMW 12.1.3 Infra, SB 12.1.3













Step 1 - Install FMW Infrastructure

My target directory is D:\Work\envs\FMW12c\APIMgr








Screenshot for Path setting is missing ; i.e. \bin;%PATH%























Step 2 - Install Service Bus 

Ensure your Oracle DB is up and running.

Install Service Bus -





























Step 3 - Install Oracle API Manager via OPatch on top of Service Bus












The API Manager is in the patch p2022...
The other patch - p203...is an RCU patch and needs to be installed as well.

Install API Manager -

Execute OPatch here -














Install the RCU Patch




Step 4 - Run RCU to create the API Mgr schemas


Now create the Repository.

























Configure API Manager domain -



















































Step 7 start the servers






































Start nodemanager
Go to the console -















Start osb_server1 

You can also check out the deployments -




The api manager portal is available at
http://localhost:7001/apimanager

login as weblogic/welcome1













Note the 3 functional area tabs -





Now, check out the docs here

Tuesday, February 17, 2015

#377 BPM12c Initiator Task Form patch released


Patch Number is 20440332




Stop BPM12c Quickstart (or equivalent).













Restart BPM 12c Quickstart  (or equivalent).

Create a simple BPM process, kicked off by an Initiator task.











Deploy and test

Here is the application link in workspace -










Check out your task form -





















btw. I noticed memory issues with my default settings, so I upped the settings in the setStartupEnv.cmd file.




#376 Oracle API Manager released

























Check it out on OTN here

Wednesday, January 21, 2015

#375 SOA / BPM 12c Bundle Patch released

















Upgrading to Bundle Patch 1

Here I am patching my SOA12c Quickstart environment.

Unzip to a directory of your choice.
Read the README.














The Readme mentions -

 Oracle recommends that all customers be on the latest version of OPatch for
their release. Download the latest version of OPatch 13.2.x via My Oracle
Support Patch 6880880. (Choose 13.2.0.0.0 or "OUI NextGen 13.2")

p6880880_132000_Generic.zip






So I install the newest OPatch first -

Install the newest version of OPatch


Here is its Readme -
















So here is my SOA Quickstart directory structure -

























Here are the contents of the patch -




















So we are essentially overwriting the OPatch directory.

Once that is done, we can install BP1.

Install BP1

Ensure that the integrated server is stopped.

Open a cmd window in the OPatch directory -

opatch lsinventory












Open another window in the patch directory -
Set oracle_home






Apply the patch -

opatch apply





























































Now I delete the following system--cache directory from the integrated server -

























I also have a BPM Quickstart on this machine and
I need to apply the patch to it, as well.




















Again, last step is to delete the system-cache directory.




Thursday, January 15, 2015

#374 MFT --> Creating Custom Callouts - A simple example

Introduction 

Let's go straight to the MFT docs -


Oracle Managed File Transfer provides built-in compression, decompression, encryption, and decryption actions for transfer preprocessing and postprocessing. See Setting Up Transfer Preprocessing and Postprocessing Actions and Setting Up Source Processing Actions for details.

You can create new preprocessing and postprocessing actions, which are called custom callout
Custom callouts can be associated with either the source or the target. The sequence of processing action execution during a transfer is as follows:

Source preprocessing actions
Target preprocessing actions

Payload delivery

Target postprocessing actions
Source postprocessing actions








Here is the jar containing the interfaces -
YourFMW4MFTDir\mft\modules\oracle.mft_12.1.3.0\core-12.1.1.0.jar



Now before I get to my simple example, I just want to highlight the
excellent MFT resources available on the Oracle SOA PM blog.
Check it out right here

The Simple Example 


So now to my simple example -
I need to parse the files and convert the contents as follows -

Change any occurrences of Ireland to Eire
or
Change any occurrences Eire to Ireland and visa-versa.

The test file I use is as follows -









So I will expect the output to have Eire instead of Ireland.
Eire, for those interested is the Gaelic name for Emerald Isle.

Implement the Callout


I followed this section from the MFT docs to create the Java class that will
do the conversion.

The code is very simple - the main jar required is here -



I add this to the JDev project -










Here is the implementation -

package mftcallout;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

import java.util.Map;

import oracle.tip.mft.engine.processsor.plugin.PluginContext;
import oracle.tip.mft.engine.processsor.plugin.PluginOutput;
import oracle.tip.mft.engine.processsor.plugin.PreCalloutPlugin;

public class NcIECallout implements PreCalloutPlugin {
    public NcIECallout() {
        super();
    }
    // Callout changes the payload
    @Override
        public boolean isPayloadChangeRequired(PluginContext context,
                Map calloutParams) {
            return true;
        }
    
    @Override
       public PluginOutput process(PluginContext context, InputStream input,
               Map calloutParams) {
           return null;
       }
    
    @Override
       public PluginOutput process(PluginContext context, InputStream input,
               OutputStream out, Map calloutParams) {
           String type = calloutParams.get("Type");
           if ("Eire2Ireland".equals(type)) {
               doConversionEire2Ireland(input,out);
               
           }
           else{
               doConversionIreland2Eire(input,out);
           }
           return new PluginOutput();
       }
    
    private void doConversionIreland2Eire(InputStream in, OutputStream out) {
            BufferedReader bufferIn = null;
            BufferedWriter bufferOut = null;
            try {
                DataInputStream dataIn = new DataInputStream(in);
                bufferIn = new BufferedReader(new InputStreamReader(dataIn));
                DataOutputStream dataOut = new DataOutputStream(out);
                bufferOut = new BufferedWriter(new OutputStreamWriter(dataOut));
                // For each line in the un-normalized file
                String line;
                while ((line = bufferIn.readLine()) != null) {
                    if(line.equalsIgnoreCase("Ireland")){
                        line = "Eire";
                    }
                    bufferOut.write(line);
                    bufferOut.write("\r\n");
                          }
            } catch (Exception e) {
                throw new RuntimeException(e);
            } finally {
                try {
                    bufferIn.close();
                    bufferOut.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    private void doConversionEire2Ireland(InputStream in, OutputStream out) {
            BufferedReader bufferIn = null;
            BufferedWriter bufferOut = null;
            try {
                DataInputStream dataIn = new DataInputStream(in);
                bufferIn = new BufferedReader(new InputStreamReader(dataIn));
                DataOutputStream dataOut = new DataOutputStream(out);
                bufferOut = new BufferedWriter(new OutputStreamWriter(dataOut));
                // For each line in the un-normalized file
                String line;
                while ((line = bufferIn.readLine()) != null) {
                    if(line.equalsIgnoreCase("Eire")){
                        line = "Ireland";
                    }
                    bufferOut.write(line);
                    bufferOut.write("\r\n");
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            } finally {
                try {
                    bufferIn.close();
                    bufferOut.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
}

Now to the creation of the callout definition file -
The details here surface in the MFT console - i.e. the MFT user will be
able to add a pre-processing action - "Eire to Ireland text conversion"









I jar up the Java class and copy it, along with the xml file above to the following directory -
YourFMW4MFTDir\user_projects\domains\mft_domain\mft\callouts e.g.










Create this directory, is it doesn't already exist.








Now the next step is to register the new callout with MFT. We do this via WLST -



wls:/mft_domain/serverConfig> crtCalls('D:\Work\envs\FMW12c\MFT\user_projects\do
mains\mft_domain\mft\callouts\EireCalloutDef.xml')

Create a simple MFT Transfer to leverage the callout


Now I create a new source (File) in MFT and add a pre-processing step -










Now you can see how all of these values come from the callout definition file.
I then create a target and a transfer and test with the following file -







the output file is as follows -







btw. the Gaelic for England is Sasana, for France, is an Fhrainc.
  
Java Project here