Saturday 22 November 2014

SOA11 and Coherence integration case study

In one of the project where I've worked on, the customer was facing issues due to the many web services calls triggered by their portal. Basically the Service Bus was crashing since it was reaching its limit in terms of web services transactions supported.

The initial architecture



The logged in users in Web Center portal were triggering calls trough the ADF framework to the OSB, and those calls were validated and enriched and then routed to the target third party services. All those operation were synchronous.

The analysis

We decided to take a deeper look to understand which services were being called, how many times and with which frequency, etc.
The tool we used here, was the Statistics in the OSB. We enabled them on all the Web Services, we run the Portal, and played with the functionality, which were calling the WS under analysis.

After 10 minutes we got the following result, where we noted 2 main things:

  1. There were some WS operations called very frequently (1 each 20 msecs for each logged users) like GetTask and GetCurrentState, while all the others were being called only few times.
  2.  The WS calls were getting information only for the specified WC Portal user which was triggering theggering thise calls.




The Solution

We spoke with the developers of the third party WS, proposing them to move to a "bundle" approach. Basically we asked them to expose two more operations, GetBundleTask and GetBundleState, which respectively were like GetTask and GetCurrentState, but with a list of usersId/taskId in input.
We configured a new Coherence server, thinking about using an asynchronous approach and the caching of the data. The architecture now looks like this:


Benefits:
  • The WebCenter/ADF layer did not need any modification since we did not touch the OSB WS interfaces.
  • The SOA Async process was getting data in bundle for all the Users logged in in one call (or very few) with much better results.
  • The services exposed on the OSB were getting the data 99% of the time from the local cache, so the network latency was now almost zero and the average response time was 30 times less.


Here are the new statistics after applying those changes. The number of calls to getTask and getCurrent state external WebServices from the OSB were dropped of the 99%, all the data were coming from the cache.



Here the Async BPEL service was facing the same latency calling the bundle services then the singe OSB services, but at least this time we were calling them with a list of users.

Here are some sequence diagram which explains now the sequence of the operations. The OSB Service now try to get the data from Coherence, if it is  not found it get the same from the OLD external services, and "subscribe" the users for update.

The SOA Business service was calling the external bundle services based on the "subscribed" users list.  





Thursday 13 November 2014

SOA Testing in Maven

Currently there are few tools that can support testing SOAP interfaces.

For instance Jmeter and SoapUI are suited for testing soap interfaces.

  • SoapUI is explicitly created for testing SOAP interfaces
  • Jmeter has a SOAP support since version 2.3.x. 


SoapUI, has an intuitive user interface and is flexible.
You can run SoapUI stand alone and it can be to integrated within an automated process.

Below you will find instructions for running SoapUI as a part of a maven build. This makes it possible to run your automated SOAP tests in Maven with a build process like Jenkins. Combined with automatic deployment it is possible to support an agile software development process that supports frequent delivery of versions and continuous integration and testing.

Maven2 supports SoapUI with the Maven SoapUI plugin.

Usage:

Add the eviware plugin repository to your repository list.

 
<pluginRepositories>
  <pluginRepository>
    <id>eviwarePluginRepository</id>
    <url>http://www.eviware.com/repository/maven2/</url>
  </pluginRepository>
</pluginRepositories>


Attach to verify phase

By attaching the SoapUI maven plugin to the verify phase your build process runs it automatically in the integration-test phase. The “iso-soapui-project.xml” is the reference to the SoapUI xml file.

 
<plugin>
  <groupId>eviware</groupId>
  <artifactId>maven-soapui-plugin</artifactId>
  <version>2.0.2</version>
  <executions>
    <execution>
      <phase>verify</phase>
      <id>soapui-tests</id>
      <configuration>
        <projectFile>${basedir}/src/test/soapui/iso-soapui-project.xml</projectFile>
        <outputFolder>${basedir}/target/soapui</outputFolder>
        <junitReport>true</junitReport>
        <exportwAll>true</exportwAll>
        <printReport>false</printReport>
      </configuration>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
</plugin>



Convert log to a report

The log export of SoapUI can be interpreted like a normal Surefire unit report. By just adding this part to your maven reports section you can generate a nice overview of your test results.

 
<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-report-plugin</artifactId>
      <configuration>
         <outputDirectory>target/site/soapui</outputDirectory>
         <reportsDirectories>
           <reportsDirectories>target/soapui/</reportsDirectories>
         </reportsDirectories>
      </configuration>
    </plugin>
  </plugins>
</reporting>




Thanks to the AMIS blog for this information!!!

Oracle Code Compliance Inspector


The Code Compliance Inspector uses a pre-defined set of assertions that are based on SOA AIA Integration Developer guidelines and the Web Services Interoperability Organization Basic Profile (WS-I BP) to check SOA projects for design consistency and good coding and documentation practices. CCI qualifies code as Compliant, Conformant, or Fully Conformant to be in sync The Open Group Architecture Framework (TOGAF) standard guidelines based on the pass criteria of the highest priority assertions.


  • CCI is available as a JDeveloper extension
  • As a command-line utility
  • Oracle Enterprise Repository (OER) utility


Developers will typically use the JDeveloper extension and will continuously check compliance on JDeveloper projects as they develop.

The CCI command line utility can be used to incorporate CCI code check as part of our build/deployment/continuous integration process. So every time someone checks code into main branch, the Continuous Integration tool can automatically checkout the code, do a CCI code compliance test and then build and deploy. Of course if the code is not compliant it can send an error notification to a distribution list, without deploying.
Here are some examples for invoking the Code Compliance Inspector from a command line:

  • Windows: checkCompliance.bat -inputDir D:\AIA\demo -outputDir D:\ComplianceOut
  • Linux: sh checkCompliance.sh -inputDir /AIA/demo -outputDir /ComplianceOut


CCI provides optional integration to Oracle Enterprise Repository (OER). When OER is present, CCI can synchronize results to the repository, enabling users to access the report from the OER console. Integrating compliance data into OER provides repository users with information about whether composites are compliant into the repository reports and individual asset metadata.

To make it working in JDEV11 is quite easy, just download and install the extensions in JDeveloper




Then right-click the project and select Check Code Compliance.


Note: when the project is selected, the code compliance inspector can also be launched
from the toolbar.

A highlighted Compliance Results tab will appear in the log panel, go ahead and select it
to see the project status



In this environment, we are simply checking compliance against WS-I standards, but there are also other standards delivered with Oracle Application Integration Architecture Foundation Pack that can check much more as well as additional checks that can be added by your team

Wednesday 29 October 2014

Oracle SOA 12c Templates


SOA Composite Templates

One of the best new feature in this SOA 12.1.3 release is this about the Template.
The SOA template can really increase the productivity of the Developers team and Oracle is right saying this..
Here I just want to recap the different type of template and main features, across  SOA and OSB, hope this might help.

SOA ‘Starter’ Templates

  • ‘Starter’ Template is a re-usable part of a SOA project
  • Fully editable
  • Store in MDS
  • Three types:
    • SOA Project Template
    • Component Template
    • Custom Activity Template



  • Project template accessible at the time of new project creation
  • Automatically discover in the component palette
    • Component Template
    • Custom Activity Template
  • Share and re-use from MDS



BPEL Sub-processes: standalone and inline

Very useful for groups of activities that are reused within one (inline) BPEL process or the whole Composite (standalone).
  • Allows business logic to be modularized and reused
  • Permits access of data in parent process
  • Improves performance and manageability
  • Compensation and fault handling inherited from calling process
  • Faster rendering as only the entity in question is rendered
The main difference between Standalone and Inline sub processes is that the firsts are visible within the Composite the seconds only within the Bpel Process in which it's been generated.


Service Bus Templates


Pipeline ‘Inherited’ Templates
  • New artifact type.
  • Two ways to create a Template
    • Generate template from existing pipeline
    • Create template from scratch.
  • New pipelines are generated from the Template.
  • Derived pipelines are considered concrete
    • Concrete pipelines can be linked (default) or unlinked
    • If linked, all changes in Template are reflected in derived concretes
  • Templates actions can be ‘Locked’

  • Placeholders in Pipeline template to define where modifications may be placed

Share artifacts within and across applications

SOA Design-Time MDS Repository
  • Wizard to share design time artifacts such as WSDLs and Schemas
  • Moves the artifacts and its dependencies to Design-Time MDS (viz. schema with WSDL)
  • Updates all the references to the transferred artifacts with MDS URLs on transfer


Monday 16 June 2014

Mocking your services

Almost all the developers which are using developing WebServices are well aware about SOAP UI, however I've always used only to send manual messages to some WebServices for manual testing.

SOAP UI much more than that and not even a licensed version is needed for this. A free one is enough.

Mocking your services is very important if you want to test your own services but you want to do it in isolation, basically without any of the external services (used by your own service to test) to cause of a less determined behavior. Another reason might be because you might want to execute performance test on your services and none of the external has to slow down the test itself.

Step by Step process:

  • Let's suppose you've got a service already available, if you don't have it just create a new simple one and deploy it somewhere.

The service in the following example accepts a String parameter which will be used for the mocking response, in your service you can add a String parameters or later you an use a similar approach with a different parameter type.


  • Create in Soap UI a new project and add the WSDL of the service. Here is my service which I am going to mock.





  • Right click at the port type in SOA UI of the imported WSDL and "Generate MockService". Port and Path can be customized. Select at least the operation you are going to mock.
  • As I did, create as many response as you need to verify your business rules. For instance

Some variable might be used in the response as showed below. SOAP UI uses Groovy as a script language then you might take a look of it.


  • After defining your answers, you have to define how these will be served to the caller; SoapUI provides several strategies:
    • RANDOM – serve a random answer
    • SEQUENCE – iterate through the available answers
    • QUERY_MATCH/XPATH – set up a mapping for each answer based on some queried request value
    • SCRIPT – create a Groovy script to determine the answer The most interesting (and easiest to set up) is the Groovy Script. I have to admit that it took me some time to come up with the script in a programming language I did not know before, but Groovy has a steep learning curve.


Above is my example, as you can see I've created a mapping

def symbolMap = [
"S":"Success" ,
"F":"Invalid parameters Fault" ,
"L":"Invalid login"
]

And in the script I get the first letter of the "Password" field and I use it as a key for the MAP above.
The result , which is the name of the Response, is returned back and SoapUI returns the correct Response to the client.

 
def xmlHolder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent )

// extract the parameters from the request def

def string = xmlHolder["//*[local-name()='Password']"]

def reqSymbol = string.substring(0,1)



// request by symbol - lookup the appropriate response

log.info "The requested symbol (by symbol)=" + reqSymbol

// if mapping not found: null will be returned

def response = symbolMap[reqSymbol]

return response

  • Last step for you is to run and test your Mock Service. You've got two options:
    • Start the SOAP UI mock service. This can be started by right clicking at the mock port type and then Start mock service.
    • Deploy as a war from the Project context menu.


Monday 7 April 2014

Creates a BC4J client in JDeveloper


To create a test client program, create a new Java class using the Create Java Class wizard. This is available in the New Gallery under the General category. Enter a class name like TestClient, a package name like devguide.examples.client, and ensure the Extends field says java.lang.Object. In the Optional Attributes, deselect the Generate Default Constructor and select the Generate Main Method checkbox. Then click OK to create the TestClient.java file. The file opens in the source editor to show you the skeleton code:

Example 5-6 Skeleton Code for TestClient.java
package devguide.examples.client;
public class TestClient {
  public static void main(String[] args) {
       
  }
}

Place the cursor on a blank line inside the body of the main() method and use the bc4jclient code template to create the few lines of necessary code. To use this predefined code template, type the characters bc4jclient followed by a [Ctrl]+[Enter] to expands the code template so that the class now should look like this:

Example 5-7 Expanded Skeleton Code for TestClient.java
package devguide.examples.client;
import oracle.jbo.client.Configuration;
import oracle.jbo.*;
import oracle.jbo.domain.Number;
import oracle.jbo.domain.*;
public class TestClient {
  public static void main(String[] args) {
    String        amDef = "test.TestModule";
    String        config = "TestModuleLocal";
    ApplicationModule am =
      Configuration.createRootApplicationModule(amDef,config);
    ViewObject vo = am.findViewObject("TestView");
    // Work with your appmodule and view object here
    Configuration.releaseRootApplicationModule(am,true);
  }
}

Adjust the values of the amDef andconfig variables to reflect the names of the application module definition and the configuration that you want to use, respectively. For the Example 5-7, you would change these two lines to read:
String amDef = "devguide.examples.UserService";
String config = "UserServiceLocal";

Finally, change view object instance name in the call to findViewObject() to be the one you want to work with. Specify the name exactly as it appears in the Data Model tree on the Data Model panel of the Application Module editor. Here, the view object instance is named UserList, so you need to change the line to:
ViewObject vo = am.findViewObject("UserList");

At this point, you have a working skeleton test client for the UserService application module whose source code looks like what you see in Example 5-8.

Wednesday 2 April 2014

Read an HTTP streaming using only JavaScript


In one of the project where I've worked on, we had the requirement of  showing some live data graphs, where the input data were coming through a Streaming http.

The customer wanted to see the data real time with max 1 second delay, and doing some calculations we've came out that using a server process for this would  have not match the customer expectations, then we decided to go for a Client side approach using JavaScript.

This is why I discovered this easy and nice solution which worked very well and which met all the customer requirements. Here is the result:


The graphs were getting updated in real time thanks to:

  • On ready state change event, which was getting the streaming update and enqueue the values:

http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp

  • The Chart Library which has been used to show the Graph:

http://www.flotcharts.org/

Here is the snippet used to get the Streaming update:

<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==3 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }

xmlhttp.open("GET","http://<Some HOST and PORT>/<STREAMING URL>",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
</body>
</html>


Tuesday 18 March 2014

Mockito for Testing


A unit test should test a class in isolation. Side effects from other classes or the system should be eliminated if possible. The achievement of this desired goal is typical complicated by the fact that Java classes usually depend on other classes. To solve this, you can use stubs or mock objects.

Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with clean & simple API. Mockito doesn't give you hangover because the tests are very readable and they produce clean verification errors.

Mockito supports the creation of mock objects with the static mock() method call. It also supports the creation of mock objects based on the @Mock annotation. If you use annotations, you must initialize this mock objects with a MockitoAnnotations.initMocks(this) method call.

Limitations

Mockito has certain limitations. It can not test the following constructs:

  • final classes
  • anonymous classes
  • primitive types

Java Dependecies

Mockito-all is a single jar will all dependencies inlined inside (that is: hamcrest and objenesis libs as of june'11). Mockito-core is just the mockito jar.
Use mockito-core if you want to pull a specific version of hamcrest or objenesis. Mockito-core gives finer control on what jars end up on your classpath. Since maven deals with transitive dependencies well maven users can use mockito-core without any extra hassle

mockito-core

  <!-- needs extra dependencies: objenesis & hamcrest -->
  <groupId>org.mockito</groupId>
  <artifactId>mockito-core</artifactId>
  <version>1.9.5</version>
  <scope>test</scope>

mockito-all

  <groupId>org.mockito</groupId>
  <artifactId>mockito-all</artifactId>
  <version>1.9.5</version>
  <scope>test</scope>

How to Use Mockito

@Test
public void test1()  {
  MyClass test = Mockito.mock(MyClass.class);
  // define return value for method getUniqueId()
  test.when(test.getUniqueId()).thenReturn(43);
  
  // TODO use mock in test.... 
  
  // now check if method testing was called with the parameter 12 
  Mockito.verify(test).testing(Matchers.eq(12));
  
  // was the method called twice?
  Mockito.verify(test, Mockito.times(2));
  
};

Verify the calls on the mock objects

Mockito keeps track of all the method calls and their parameters to the mock object. You can use the verify() method on the mock object to verify that the specified conditions are met, i.e., that a method has been called with certain parameters.

Mockito Annotations

You also have the @InjectMocks annotation which tries to do constructor dependency injection based on the type. For instance look at the following code:

public class ArticleManagerTest  {

       @Mock private ArticleCalculator calculator;
       @Mock private ArticleDatabase database;
       @Spy private UserProvider userProvider = new ConsumerUserProvider();

       // creates instance of ArticleManager
       // and performs constructor injection on it
       @InjectMocks private ArticleManager manager = new ArticleManager();

       @Test public void shouldDoSomething() {
         MockitoAnnotations.initMocks(this);
           verify(database).addListener(any(ArticleListener.class));
       }
} 

Saturday 22 February 2014

Maven Jdeveloper plugin

If you work with Maven and Jdeveloper 11 this plugin is a MUST for you.
Just add to your POM the following:

      <plugin>
        <groupId>org.apache.myfaces.trinidadbuild</groupId>
        <artifactId>maven-jdev-plugin</artifactId>
        <version>1.2.6</version>
      </plugin>


Then run:

mvn jdev:jdev

and magically Maven it will create the Jdeveloper PRJ file with all the library needed!!!

Maven and Archiva setup

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central place.
I've found Maven very useful in many situation, for example for building up a project downloaded from internet and compile it straight away. With Maven it takes 2 minutes only!!!

Here a brief guide about how to setup Maven+Archiva


Maven Installation

1. Download Maven 2.2.1 Maven Download

2. Unpack the archive where you would like to store the binaries. A directory called "apache-maven-2.x.y" will be created.

3. Add the bin directory to your PATH, eg:

      set PATH="c:\apache-maven-2.x.y\bin";%PATH%

4. Make sure JAVA_HOME is set to the location of your JDK

5. Run "mvn --version" to verify that it is correctly installed.


Archiva Installation

1. The quickest way to install Archiva is to download archiva standalone and use this distribution. This includes a bundled Jetty server which can be easily started.

2. Unpack the archive where you would like to store the binaries. A directory called "apache-archiva-2.x.y" will be created.

3. Archiva can be run by executing, bin/archiva, or bin\archiva.bat for Windows (select the one for your environment). The argument can be console to run interactively, or start to run in the background (in this case, run the script with stop to later stop the server). The logs are available in the logs directory where Archiva is installed.

Maven Configuration

Maven configuration occurs at 3 levels:

-Project - most static configuration occurs in pom.xml
-Installation - this is configuration added once for a Maven installation
-User - this is configuration specific to a particular user (${user.home}/.m2/settings.xml)

The separation is quite clear - the project defines information that applies to the project, no matter who is building it, while the others both define settings for the current environment.

The localRepository is the path to the local repository maven will use to store artifacts. It has to be configured using a local folder like here:

<localRepository>C:\apache-maven\localRepo</localRepository>

Repositories are declared inside a project, which means that if you have your own custom repositories, those sharing your project easily get the right settings out of the box. However, you may want to use an alternative mirror for a particular repository without changing the project files.

If you would like Archiva to serve as the only repository used by your Maven installation, you can use the Maven mirror settings to force this behaviour.
First, you need to select the default repository to use when none is configured by adding the following to the settings.xml file:


  
  <mirrors>
    <mirror>
      <id>archiva.default</id>
      <url>http://repo.mycompany.com:8080/repository/internal/</url>
      <mirrorOf>external:*</mirrorOf>
    </mirror>
  </mirrors>

Archiva Configurations

You can now browse the web administration of Archiva. There will be a few basic setup tasks to get started.

The first step is to setup your administration user. The password requires a numerical character and must not be longer than 8 chars. You'll then need to log in. Use 'admin' as the username and the password you've entered.

At this point, Archiva is fully functional - you can use it with the default repositories and guest user. You might like to explore the user and administrator guides to find other functionality.

The default configuration for Archiva configures two repositories:

  • internal - a repository for containing released artifacts. This is connected by proxy to the central repository, so requests here will automatically retrieve the remote artifacts.
  • snapshots - a repository for storing deployed snapshots. This is not proxied to any remote repositories by default.
In addition, the guest user has read access to these repositories, so you can make anonymous requests to either. To try this out, point a web browser at the following URL: http://localhost:8080/repository/internal/junit/junit/3.8.1/junit-3.8.1.jar. Though the artifact is not present locally, you will see in the Archiva logs that it is downloaded from the central repository, and then handed back to the browser and downloaded from Archiva. Future requests for the artifact will be much faster as they need not be downloaded from the central repository

Wednesday 19 February 2014

JDEV Preferences: ADF object and package naming Best Practice

From the JDeveloper menu, select
Tools > Preferences > Business Components > Object Naming
In the dialog box, set suffixes as follows:

Entity EO
View Object VO
Application Module AM



Select Packages in the list at the left and set the following values:

Entityentity
View Objectview
Application Modulemodule




Thursday 13 February 2014

Configuring BPM for sending email notification with GMAIL

Step 1 : Import certificates from gmail and add it to your server trust store. Any email server uses two protocols to send/receive messages.

SMTP for sending mails
    You can download the certificates using an opensource software called openssl. First, you need to download and install it. Downloading SMTP certificate (needed to SEND email)
    Open command prompt and cd to openssl_install_folder/bin
    Give the below command to view the smtp certificate
    openssl s_client -connect smtp.gmail.com:465

    Import of the certificate into the JDK with:

    <JAVA_HOME>/bin/keytool -import -alias smtp.gmail.com -keystore <JAVA_HOME>/jre/lib/security/cacerts -file <JAVA_HOME>/jre/lib/security/gmail.cer
    
    

    Comment out the option in the field EXTRA_JAVA_PROPERTIES for the setDomainEnv script to avoid the certificate to be loaded from the DemoTrust


    -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks

    Then the following configurations has to be made through the EM




    Restart the Domain and after that send a test notification as below





    Configuring Oracle BPM and SOA Suite 11g with a SQL Authentication Provider

    Login to integrated weblogic server with admin user (weblogic) and password

    click on security realms and select my realm option

    click on new provider to create a new SQLAuthenticator

    provide the name of the SQLAuthenticator and set the control flag as sufficient.

    Provide the data source to the database.
    The table USERS, GROUPS and GROUPS_MEMBER have to be already created
    into the database. For instance this script uses the default table and column
    names.
    Using the attached script the query to access to the users and groups don't need to be
    modified. Otherwise, using a custom DB the query needs to be changed.


    Reorder the providers and keep the SQL one at the top
    Change the control flag of default authenticator from required to sufficient.

    Restart WLS and check that users and groups from the database have been
    imported into WLS.
    For the SOA/BPM environment there is a known issue (Logon To Oracle Workspace Failed With Users Of SQL Authenticator (Doc ID 1499679.1)). I followed this approach as a workaround as suggested by oracle to being able to see the accounts in BPM. Here are the steps to apply it

    • Download the DBProvider
    • Copy dbprovider.jar to MW_HOME/user_projects/domains/{soa_domain}/lib
    • Shutdown SOA and Admin Server
    • Navigate to MW_HOME/user_projects/domains/{domain_name}/config/fmwconfig
    • Take a backup of jps-config.xml
    • Edit jps-config.xml and make the following modifications
    In the section starting with <jpsContext name="default" 
    modify <serviceInstanceRef ref="idstore.ldap"/> to 
    <serviceInstanceRef ref="idstore.custom"/>

    Within the <serviceInstances>...</serviceInstances> section, 
    add the following (change the db_* parameters as per the environment): 
    <serviceInstance name="idstore.custom" provider="custom.provider" location="dumb"> 
    <description>Custom Identity Store Service Instance</description> 
    <property name="idstore.type" value="CUSTOM"/> 
    <property name="ADF_IM_FACTORY_CLASS" value="org.sample.providers.db.DBIdentityStoreFactory"/> 
    <property name="DB_SERVER_NAME" value="db_host_name"/> 
    <property name="DB_DATABASE_NAME" value="db_sid"/> 
    <property name="ST_SECURITY_PRINCIPAL" value="db_user"/> 
    <property name="ST_SECURITY_CREDENTIALS" value="db_passwd"/>
    </serviceInstance>
    

    Within the <serviceProviders>...</serviceProviders> section,
    add the following 
    <serviceProvider type="IDENTITY_STORE" name="custom.provider" 
    class="oracle.security.jps.internal.idstore.generic.GenericIdentityStoreProvider"> 
    <description>Custom IdStore Provider</description> </serviceProvider>
    

    • Start SOA/Admin server





    Oracle Case Management 11g EURENT Configuration


    Case Management is a new addition to Oracle BPM in release 11.1.1.1.7 (PS6). This new release contains the Case Management engine, see blog Léon for more details.
    However, currently this release does not contain a case portal.
    The case management API's, just like the already existing Oracle BPM API's, help in developing a portal page with relative ease.

    In this post I will show how to install, configure and fix common issues for the EURent case management application and portal application developed by Oracle.

    Downloads all the files:
    Case MGM UI
    EurRent
    Demo Community
    Patches for Case Mgm

    Then starts unzipping the EURENT dowloaded file Sample PDF and follow the steps indicated within.

    • Pre-requirements
      • Patch installation for WLS and Java if needed
    • Depoly EURENT
      • Make sure in the property the admin has to point to the ADMIN server and the SERVER has to point to the SOA_SERVER
      • If needed the workflow-001-DemoCommunitySeedApp can be found here
    • Running ANT to create and configure the users and groups, it may happen:
    BUILD FAILED
    C:\oracle\Middleware\11.1.1.7-JDEV\workspace\EURent\case-permission-grant-build.xml:28: The following error occurred while executing this line:
    C:\oracle\Middleware\11.1.1.7-JDEV\workspace\workflow-001-DemoCommunitySeedApp\build.xml:38: The following error occurred while executing this line:
    C:\oracle\Middleware\11.1.1.7-JDEV\workspace\workflow-001-DemoCommunitySeedApp\build.xml:42: Problem: failed to create task or type if
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any / declarations have taken place.
    

    This only happens because some Target used in this script are not part of the default ANT installation, which then needs to be imported using the following:
    <taskdef resource="net/sf/antcontrib/antlib.xml">
      <classpath>
        <pathelement location="your/path/to/ant-contrib-${version}.jar">
      </pathelement></classpath>
    </taskdef>
    


    Another issue which may happen is that the groups are not correctly associated to the users because the users are not already defined in the LDAP. At the end of the ANT script you may note the following:

    seedDemoCommunity:
         [echo] Invoking seeding servlet to start seeding demo community...
         [echo] seed.server.url : http://localhost:8001, seed.admin.url : t3://localhost:7001 seed.admin.name : weblogic 
         [java] URL : http://localhost:8001/integration/SOADemoCommunity/DemoCommunitySeedServlet
         [java] inputFile=C:\oracle\Middleware\11.1.1.7-JDEV\workspace\EURent\CasePermissionRoleGrants.xml&adminServer=localhost&adminPort=7001&adminUser=weblogic
         [java] <html>
         [java] <head>
         [java] <title>Demo User Community</title>
         [java] <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
         [java] </head>
         [java] <body>
         [java] <table border="1" style="background-color:#C8C8C8" align="center" width="70%">
         [java] <tr>
         [java] <td>
         [java] <H1 ALIGN="CENTER">Seed Demo Community</H1>
         [java] <BR><B>App-Role Grants : </B>
         [java] </td>
         [java] </tr>
         [java] </table>
         [java] </body>
         [java] </html>
    


    In "App-Role Grants :" we should see the list of Users-Roles granted. As you can see in the Server log:

    user:jcooper User (jcooper) specified as grantee for app role EURent.CONFIDENTIA
    L.READ.Role does not exist. Please modify the XML input file to create the user
    and rerunuser:jstein User (jstein) specified as grantee for app role EURent.CONF
    IDENTIAL.READ.Role does not exist. Please modify the XML input file to create th
    e user and rerunuser:sfitzger User (sfitzger) specified as grantee for app role
    EURent.CONFIDENTIAL.READ.Role does not exist. Please modify the XML input file t
    o create the user and rerunJMXAppRoleGranter.getMembersForApplicationRole() : IN
     : appStripe : OracleBPMProcessRolesApp, appRole : EURent.CONFIDENTIAL.UPDATE.Ro
    le
    


    Too fix it the users defined in the CasePermissionRoleGrants.xml have to be manually created in the WLS realm, then the script ANT can be re-run again

    the result has to be like this:


    seedDemoCommunity:
         [echo] Invoking seeding servlet to start seeding demo community...
         [echo] seed.server.url : http://localhost:8001, seed.admin.url : t3://localhost:7001 seed.admin.name : weblogic
         [java] URL : http://localhost:8001/integration/SOADemoCommunity/DemoCommunitySeedServlet
         [java] inputFile=C:\oracle\Middleware\11.1.1.7-JDEV\workspace\EURent\CasePermissionRoleGrants.xml&adminServer=localhost&adminPort=7001&adminUser=weblogic
         [java] <html>
         [java] <head>
         [java] <title>Demo User Community</title>
         [java] <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
         [java] </head>
         [java] <body>
         [java] <table border="1" style="background-color:#C8C8C8" align="center" width="70%">
         [java] <tr>
         [java] <td>
         [java] <H1 ALIGN="CENTER">Seed Demo Community</H1>
         [java] <BR><B>App-Role Grants : </B>
         [java] EURent.PUBLIC.READ.Role is granted to user mmitch.
         [java] EURent.PUBLIC.READ.Role is granted to user jausten.
         [java] EURent.PUBLIC.READ.Role is granted to user wfaulk.
         [java] EURent.PUBLIC.READ.Role is granted to user wshake.
         [java] EURent.PUBLIC.READ.Role is granted to user jcoope.
         [java] EURent.PUBLIC.READ.Role is granted to user jstein.
         [java] EURent.PUBLIC.READ.Role is granted to user sfitzger.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user mmitch.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user jausten.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user wfaulk.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user wshake.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user jcooper.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user jstein.
         [java] EURent.PUBLIC.UPDATE.Role is granted to user sfitzger.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user mmitch.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user jausten.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user wfaulk.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user wshake.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user jcooper.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user jstein.
         [java] EURent.PUBLIC.INVOKE.Role is granted to user sfitzger.
         [java] EURent.CONFIDENTIAL.READ.Role is granted to user jcooper.
         [java] EURent.CONFIDENTIAL.READ.Role is granted to user jstein.
         [java] EURent.CONFIDENTIAL.READ.Role is granted to user sfitzger.
         [java] EURent.CONFIDENTIAL.UPDATE.Role is granted to user jcooper.
         [java] EURent.CONFIDENTIAL.UPDATE.Role is granted to user jstein.
         [java] EURent.CONFIDENTIAL.UPDATE.Role is granted to user sfitzger.
         [java] EURent.CONFIDENTIAL.INVOKE.Role is granted to user jcooper.
         [java] EURent.CONFIDENTIAL.INVOKE.Role is granted to user jstein.
         [java] EURent.CONFIDENTIAL.INVOKE.Role is granted to user sfitzger.
         [java] </td>
         [java] </tr>
         [java] </table>
         [java] </body>
         [java] </html>
    
    

    • At this stage the UI has to be deployed. Just configure the deploy script with your environment variable and run it. It creates the EAR which can be manually deployed through the WLS console. Deploy it to the SOA_SERVER, if different than the ADMIN. The console can be tested at this point accessing as a granted user (mitch jstein, ...)
    • Now all has been deployed and configured, it is time to start a case! Open the SampleInput XML and call the EURENT.service (note that in some case it may be good to comment "<ns2:updatedDate></ns2:updatedDate>", I got some issue because of this field). The service can be called:
      • through the EM (accessing to the service in SOA-infra)
      • accessing to http://<host>:<port>/soa-infra selecting EURENT.service


    • Now connecting to the sample UI as a mitch, in case you don't see any record it maybe because the Groups in the BPM/workspace have not been configured correctly

    Access to the BPM Console and check if the highlighted groups have been granted to someone.
    In my case they weren't, then I granted all of them to weblogic.



    Then accessing to the CMSampleUI again as weblogic user I see the created records.


    • asas