Friday, 18 May 2018

Building ADF applications using Developer cloud service

In this post I will be demonstrating the steps required to build ADF applications using Oracle Developer Cloud Service. I will be using ant to do the build activity, the steps are more or less same even if you are planning to use maven.

  • Create a project and repository in developer cloud service.
  • Check-in all your project code to GIT repository of developer cloud service.
  • Generate the build files (build.xml and build.properties) if not present in your project.
  • Jdeveloper generated build files will work when build in your local environment, when you need to build it in developer cloud service, you need to tweak the files a bit. 
build.properties file

oracle.commons=../../../../oracle_common/
install.dir=../../../..
oracle.home=${env.ORACLE_HOME_12C3}
oracle.jdeveloper.workspace.path=${env.WORKSPACE}/SampleBuildApp.jws
middleware.home=${env.MIDDLEWARE_HOME_12C3}
workspace=${env.WORKSPACE}
oracle.jdeveloper.ant.library=${env.ORACLE_HOME_12C3}/jdev/lib/ant-jdeveloper.jar
oracle.jdeveloper.deploy.dir=${env.WORKSPACE}/ViewController/deploy
oracle.jdeveloper.ojdeploy.path=${oracle.home}/jdev/bin/ojdeploy
javac.nowarn=off
oracle.jdeveloper.project.name=ViewController
oracle.jdeveloper.deploy.outputfile=${env.WORKSPACE}/deploy/${profile.name}
output.dir=classes
javac.deprecation=off
oracle.jdeveloper.deploy.profile.name=*
javac.debug=on

  • Change SampleBuildApp.jws to your application name.
build.xml file

<?xml version="1.0" encoding="windows-1252" ?>

<project xmlns="antlib:org.apache.tools.ant" name="SampleBuildApp" basedir=".">
  <property environment="env" />
  <property file="build.properties"/>
  <target name="deploy" description="Deploy JDeveloper profiles">
    <taskdef name="ojdeploy" classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask" uri="oraclelib:OJDeployAntTask"
             classpath="${oracle.jdeveloper.ant.library}"/>
    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask" executable="${oracle.jdeveloper.ojdeploy.path}"
                  ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
                  ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
      <ora:deploy>
        <ora:parameter name="workspace" value="${oracle.jdeveloper.workspace.path}"/>
        <ora:parameter name="profile" value="${oracle.jdeveloper.deploy.profile.name}"/>
        <ora:parameter name="nocompile" value="false"/>
        <ora:parameter name="outputfile" value="${oracle.jdeveloper.deploy.outputfile}"/>
      </ora:deploy>
    </ora:ojdeploy>
  </target>
</project>

  • Don't forget to add the property environment (highlighted in red).
  • Check-in these files to developer cloud service.
  • Create a new build job by selecting the application git repository as source and deploy as build task and in the post build steps select Archive the artifact option and enter deploy/*.ear in files to archive field.
.

  • Run the build operation by clicking build now button.
  • Once the build is completed, you can find the .ear file under deploy folder of artifacts.

  • You can take this file and deploy in you JCS or on-premises environment.

Friday, 19 January 2018

Oracle Intelligent bot platform - Introduction

I am going through an online course from oracle on their Intelligent bot platform of. I will be jotting down the key concepts of this course and platform so that it will act as a quick reference guide for anyone who is starting to work on this technology and for people (like me) who want a quick reference. Let’s get started,

What are Intelligent bots??
A computer program that you can interact with in a conversational manner. The user experience of intelligent bot is to simulate a human being as a conversational partner. There are majorly two types of bots, the simpler ones scans for the keywords in the user input and more sophisticated ones which uses natural language processing (NLP) systems (to understand natural human conversations) .

Building blocks and terminology of Oracle intelligent bots
  •        Intents  
  •        Utterances
  •        Entity
  •        Intelligence
  •        Flow

Let us understand each one of them,

Intent:  Intent is like an use case a bot supports, any unit of work a bot supposed to handle. The key feature of any intelligent bot is “ A bot should be able to resolve the input to the same intention of the user”. Example: Check balance, transfer money etc.

Utterance: The way to connect user input to intents. You need to train the bot by giving utterances. Example for check balance can be what is my balance, tell my balance, how much money in my savings account etc

Entity: A variable element of an intent that you want to parameterize to allow input of different values. Bot resolves intent and then entity. Entity example for check balance intent will be savings, current and credit card.
Oracle intelligent bot has built in entities for common entities like date, currency, address etc.

Intelligence: Heart of any chat bot platform. The ability to understand users natural language conversations using natural language processing (NLP) capability.

Flow: Any Conversion will always have a flow to handle the user interactions.


Sunday, 12 November 2017

Configuring Oracle PCS with Oracle IDCS

This post covers the steps required to configure Oracle PCS (Process Cloud Service) as and application (for SSO) in IDCS (Identity Cloud Service). So let us start,


Configuration in IDCS
  • Login to the IDCS console
  • Go to Applications tab and click on Add
  • Select App Catalog in the pop up
  • Search for Oracle  and select Oracle Cloud.
  • Enter basic details and select Oracle Process Cloud Service in the App links section
  • Enter identity domain, domain name and SSO domain name
    • Identity Domain: your identity domain you can find it in my services dashboard
    • Domain Name: You can find it from your cloud url Eg: XXX.oraclecloud.com
    • SSO Domain name: Same as domain name
  • SSO Configuration
    • Entity ID: “entityID” attribute value from the PCS metadata file
    • Signing Certificate: the Signing certificate downloaded from PCS SSO configuration
  • Download the Signing Certificate and Identity Provider Metadata from this page (which will be used in PCS sso configuration page)
  • Save the configuration and Activate it.
Configuration in PCS


  • Login to PCS cloud services dashboard
  • Click on Users on the top right side
  • Click on SSO Configuration tab and click on Configure SSO button
  • Select import identity provider metadata
  • Choose File and upload the identity provider metadata file (such as idcs_metadata.xml, the one downloaded in IDCS page).
  • Select HTTP POST as SSO protocol.
  • Select User’s Email Address as User Identifier.
  • Select the Name ID as the contained in field
  •  Save the details and you are ready to test it and enable the SSO

Friday, 16 June 2017

Unlocking oracle ICS flows

The new ICS release (17.2.5) has unlock feature,
​

To unlock the connection:
​
1. Log in again as the same user who was editing the connection when the browser crashed, then log out.
For example, if you were logged in as icsdeveloper when the browser crashed, log in again as icsdeveloper, and log out. This action unlocks the connection.
​

Monday, 20 March 2017

Error while deploying oracle BPM case management project

Version : Oracle BPM 12.2.1
You might face any of the following errors while deploying a BPM case management project.

- The process domain is encountering the following errors while loading the process "ProcessName" (composite "CompositeName"): Could not initialize variable.

- ":" is not allowed in the schema file (pointing to your base schema)

- Can't load case data for the process activity <Activity Name>


Resolution:

All the above errors are because of an error in auto generated schema file for case management rules (jdeveloper generates this file when you create a case). Go to Schemas folder and open the <CaseName>Rules_<CaseName>RulesMessageTypes.xsd and verify the import schema of you base payload schema.

It will have the complete path of your payload schema which is the root cause for the above errors (engine is not able to locate the complete path, it should always be relative path)

<import namespace="http://www.example.org" schemaLocation="../C:/XXXX/XXX/YYY/Payload.xsd"/>

Change the schema location to the relative path and the deployment will be successful.
<import namespace="http://www.example.org" schemaLocation="../Payload.xsd"/>

Wednesday, 6 January 2016

Invoking a REST service in Oracle BPM/PCS webform

One of the common requirement in oracle BPM/PCS webforms is to populate the dropdowns by calling a REST service. Below java script code shows populating the dropdown values by calling the REST service.

This code assumes the rest service returns list of items which is name/value pair.
/*member count, items*/
/*member id */
var x;
if (form.load)
{

   Status.value = 'No errors';
   try {
      var uri = "REST_SERVICE_URL";
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value = 'got exception' + e ;
   }
   var lovArray = [];
   for (var i=0; i< x.items.length; i++)
   {
      lovArray[i]=x.items[i].name;

   }

   DepartmentsList.options = lovArray;

}

This code assumes the rest service returns just list of values which needs to be displayed in dropdown

/* member items, id */
if(DepartmentsList.value.length>0)
{
  
  try {

      var uri = 'REST_SERVICE_URL;
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value =  uri + e;
   }
   approverList.options =x;

}

Monday, 23 November 2015

Invoking a cross domain webservice from jquery

I am going to share the jquery code that I used to invoke a cross domain webservice (for more details on cross domain requests, please click here)

We need to pass following couple of important fields while invoking the cors webservice.

  • dataType: 'json'
  • crossDomain : true
  • and I have the basic authentication as well for my webservice, so I am passing xhrFields.

xhrFields: {   
    withCredentials: true
  }


Here is the full jquery code snippet, 


$.ajax({
 
url:'URL_TO_MY_WEBSERVICE',

headers: {
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Headers':'Origin, X-Requested-With, Content-Type, Accept',
'Access-Control-Allow-Methods':'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Max-Age': '86400',
'Access-Control-Allow-Credentials':true,
        'Authorization':setAuthHeader("userName", "password"),
        'Content-Type':'application/json'

    },xhrFields: {   
    withCredentials: true
  },
type: 'GET',
dataType: 'json',

crossDomain : true



Note: My webservice requires the users to be authenticated with http basic authentication. You can see the Authorization uses a method called setAuthHeader() which intern uses btoa() function to generate the base 64 encoded string which is required for basic authentication. Please find the setAuthHeader() source code below,

function setAuthHeader(username,password){
var cred = username +":"+ password;
var basic = btoa(cred);
var hashstr = "Basic "+basic;
return hashstr;

}