Wednesday, June 15, 2016

Oracle® SOA 12c (12.1.3 and 12.2.1) Setting Composite Title using a mediator

The setCompositeInstanceTitle operation is no longer supported in 12c. It has been replaced with oraext:setFlowInstanceTitle operation. 

To use this operation in SOA 12c (12.1.3) specifically , we need to install Patch 18310693.

Pre-install Instructions for the patch



  • Set the ORACLE_HOME environment variable to the directory where you have installed Oracle SOA Suite.



  • Stop all servers (AdminServer and all Managed server(s)).

Installation Instructions

  • Unzip the patch zip file into the PATCH_TOP.

   $ unzip -d PATCH_TOP p18310693_121301_Generic.zip

  • Set your current directory to the directory where the patch is located.

    $ cd PATCH_TOP/18310693

  • Run OPatch to apply the patch.

   $ opatch apply





  • Once the patch has checked all the imperative prerequisites, it will prompt to proceed with installation. Please enter Y and press Enter.


  • On successful installation, you should see the following results.



SOA 12c 12.1.3 is now ready testing the setSlowInstanceTitle.


Changes to the Mediator

  • Click on the Assign button of the Mediator and setthe following property





  • Please ensure that you use the operation setFlowInstanceTitle() as shown below
         oraext:setFlowInstanceTitle(string('The tilte is'))




  • Build your code and deploy it. You should be able to the Tile in the Enterprise Manager







Monday, June 13, 2016

Oracle® Weblogic 12.2.1: How to implement a custom UUID in for Toplink EJB 3.0

To implement a custom sequence strategy you can subclass org.eclipse.persistence.sequencing.Sequenceor StandardSequence 

StandardSequence assumes a numeric value being used so Sequence will be used for this example to return a random UUID value.

Implementation of UUIDSequence
                                                             
package com.mindtelligent.worklist.model;


import java.util.UUID;
import java.util.Vector;

import org.eclipse.persistence.config.SessionCustomizer;
import org.eclipse.persistence.internal.databaseaccess.Accessor;
import org.eclipse.persistence.internal.sessions.AbstractSession;
import org.eclipse.persistence.sequencing.Sequence;
import org.eclipse.persistence.sessions.Session;

public class UUIDSequence extends Sequence implements SessionCustomizer {

public UUIDSequence() {
super();
}

public UUIDSequence(String name) {
super(name);
}

@Override
public Object getGeneratedValue(Accessor accessor,
AbstractSession writeSession, String seqName) {
return UUID.randomUUID().toString().toUpperCase();
}

@Override
public Vector getGeneratedVector(Accessor accessor,
AbstractSession writeSession, String seqName, int size) {
return null;
}

@Override
public void onConnect() {
}

@Override
public void onDisconnect() {
}

@Override
public boolean shouldAcquireValueAfterInsert() {
return false;
}

 

@Override
public boolean shouldUseTransaction() {
return false;
}

@Override
public boolean shouldUsePreallocation() {
return false;
}

public void customize(Session session) throws Exception {
UUIDSequence sequence = new UUIDSequence("system-uuid");

session.getLogin().addSequence(sequence);
}

}

                                                             

Registering Sequence


Add a property to persistence.xml

 <property name="eclipselink.session.customizer" value="com.mindtelligent.worklist.model.UUIDSequence"/> 

 

                                                             

Change the EJB 3.0 Class 



@Id
@GeneratedValue(generator="system-uuid")    
@Column(name="ADDRESS_ID", nullable = false, length = 50)


Where ADDRESS_ID is the Primary Key of the table

OCI Knowledge Series: OCI Infrastructure components

  Oracle Cloud Infrastructure (OCI) provides a comprehensive set of infrastructure services that enable you to build and run a wide range of...