Recommended JVM parameters for 11g products

I often get asked to recommend some JVM parameters for people running one (or more) of the Oracle Fusion Middleware 11g products – like BPM, SOA, UCM, WebCenter, etc. on top of WebLogic Server.

Here are my current list of recommended settings and why I like them.  I will update this post if I add more.

  • -XX:+PrintGCTimeStamps
  • -XX:+PrintGCDetails
  • -Xloggc:gc.log
    These three settings will cause the JVM to print out more detailed information about garbage collection and to produce a log (called gc.log in this example) that contains garbage collection statistics and information that is very useful when trying to do some JVM tuning.
  • -Xms2048m
  • -Xmx2048m
    These two settings control the size of the Heap.  I like to always make them the same value (2048m in this example – you need to put in the right value for your system, not just copy this one).  Making them the same size means the JVM will not spend time trying to work out if it needs to increase the size of the heap.  Changing the heap size is a very expensive operation, and if there were a large difference between these two settings, it could happen quite a few times before the heap reaches its maximum size.
  • -XX:+HeapDumpOnOutOfMemoryError
    This one will cause the JVM to take a heap dump if (in a development environment I might say “when”) you get an OutOfMemoryException.  This is really useful to work out what caused the problem.  If you don’t have this turned on when your JVM crashes, you will need to wait for it to happen again before you can capture some dumps.  Having in turned on just in case is a good idea.

For HotSpot only:

  • -XX:PermSize=512m
  • -XX:MaxPermSize=512m
    These two control the size of the Permanent Generation (one of the memory areas used by the HotSpot JVM).  Like the heap size, I like to make them the same, for the much the same reason.  If you get an OutOfMemory: PermGen error in your log, it is telling you you don’t have enough memory in this space.  Again, you need to put in the right value for your system, not just copy this one.
  • -XX:+UseCompressedOops
    Use this setting if you have a 64-bit JVM.  This will help to reduce the memory footprint of the JVM.
Posted in Uncategorized | Tagged , , , , , | 4 Comments

Memory problems with BPM or SOA 11g, especially after multiple composite deployments

Update: There is now a bundle patch available that contains all the recommended patches on top of BPM 11.1.1.3 – the patch number is 9958661 and this patch should be installed in preference to the individual patches listed below.

A number of customers have reported some issues with memory usage on SOA or BPM 11g (11.1.1.2 and 11.1.1.3) after a number of composite deployments or redeployments.  This tends to only occur in development environments where you are frequently deploying changed composites.

The observed symptom is that memory use grows after each deployment, until eventually you run out of memory and you will get an error on the managed server (OutOfMemoryException or a PermGen error) and the managed server will shutdown.  After restarting the managed server, the memory usage returns to a lower level.

The workaround for this (of course) is to restart the managed server more frequently to free up the used memory.  But this can be a bit inconvenient!

Three patches have been released that address these issues.  These can be applied on top of 11.1.1.3 (on any platform, 32-bit or 64-bit).  If you want a specific platform version or a patch for 11.1.1.2, you can search for these patches on Oracle Support and follow the links to other versions.

The patch numbers are as follows:

  • 9822892
  • 9811515
  • 10065890

You can find all of these on Oracle Support, by searching by number on the Patches tab.

Posted in Uncategorized | Tagged , , , , , | 2 Comments

Opening a BPMN process from Oracle BPA Suite

Some organisations use Oracle BPA Suite (which is based on ARIS) to model their organisation’s business processes from the highest level (strategy) down to the operational process level.  Such organisations will often follow the ARIS methodology, or some customised version of it, and typically have 4-6 levels of process models, starting with a structuring model at the top (Level 0), moving through a number of layers of Value Added Chain Diagrams, to Event Process Chains, and then sometimes to BPMN for the lowest layer – which is the operational process layer.

There are a lot of benefits to organisations in using this structured modeling approach in terms of visibility into their processes, optimisation/improvement of processes, especially through approaches like LEAN or Six Sigma, and documentation and compliance, just to name a few.

Organisations who adopt this approach may wish to take their operational processes and make them available to their integration developers so that they can be automated and have their execution managed by Oracle BPM Suite.  This is the focus on this post.

JDeveloper can open a process from BPA so that it can have the ‘implementation’ tasks completed and can be deployed into an execution environment.  This capability is enabled by installing an add-on from the BPA installation media.

In JDeveloper, you need to select Check for Updates from the Help menu, then select the option to Install from a Local File.

image

Click on the Browse button and navigate to the pcbpel directory inside the addons directory in the root of the BPA 11.1.1.3 install media.  Select the pcbpel_bundle.zip file and click on Open.

image

Then click on Next, Finish to install the add-on.  JDeveloper will then prompt you to restart itself.  After it restarts, repeat this same process and choose the bpm_bundle.zip and install it.  After the second restart, JDeveloper is properly configured to be able to read BPMN models from BPA.

Here is an example of a simple BPMN process in BPA:

image

This process is part of a bid preparation process.  It has four roles: Bid Manager, Architect, Writer and Reviewer.  And it has some decisions points and looping.

Once a process model in BPA is in a state where we are ready to implement it, i.e. after we have done all of the necessary analysis, used the simulation capability to optimise the performance of the process, got the necessary approvals, etc., we share it by right clicking on the process background to open the popup context menu, and then selecting Share Blueprint from the SOA sub-menu.

image

After a few moments, BPA will ask if you want to validate the model.  You must validate the model before you share it, click on Yes to continue.

image

The validation will run, and a report will be displayed (like the one below) to tell you if there are any issues.  If your BPMN model was not correct, for example, if you had a decision point with no out paths, you would get an error here and would not be able to proceed until you fixed that error.

image

After you have reviewed the validation report, you can close it.  A message will be displayed to let you know the process is ready to access from JDeveloper:

image

In JDeveloper, create a new Application to hold our process by selecting New from the Application menu.  In the wizard, give your application a name, I called mine RedStackBPAExample, and choose BPM Application as the application template.  Then click on Finish.

image

This will create a new application, containing an empty project.  Now we want to open the process from BPA.  To do this, we select New from the File menu.  The New Gallery will be displayed, as shown below.  Select BPM Tier in the Categories on the left hand side, and then select BPM Project from BPA on the right hand side.  Then click on OK.

image

 

 

 

 

The Create BPM Project from a BPA project wizard will open.  Give your project a a name.  I called mine PrepareBid.  Then click on the Browse button next to the BPA Server field to browse the BPA database and find a process.

image

Since this is a new BPA database that we have not used before, we will need to tell JDeveloper how to connect to it.  Click on the green plus icon to add a new connection.

image

 

In the BPA Server Connection dialog, you will need to provide the connection details for the BPA server and database you are using.  In my case, I have BPA installed on the same machine, so I can choose the Local Server option.  If you have a central BPA server, you would need to choose Remote Server and provide the connection details.

You will also need to give your connect a name, I called mine RedStack, and choose the correct database from the dropdown list called Database.  You will also need to provide the Username and Password to connect to BPA.  If you have not set these up specifically, the defaults are system and manager respectively.

image

When you have completed the necessary details, press OK to continue.  If you wish, you can use the Test tab to make sure you have everything correct.  To do this, switch to the Test tab and press the Test Connection button.  If you have set the parameters correctly you will see a message like the one below.

image

Now you can navigate through your database to find the process model you just shared a few moments ago.  Select the model you want (as shown below) and press OK and then Finish to open it.

image

After a few moments, JDeveloper will open and display the process as shown below.

image

Now the integration developer can carry out any necessary tasks needed and deploy the process to an execution environment.  In this example, he/she would just need to create the human task definition and user interfaces, update the conditions to use the outcomes of the tasks and then deploy the process.  It would also be necessary to assign the roles (Bid Manager, Architect, Writer, Reviewer) to some actual users so that they could run the process.

Posted in Uncategorized | Tagged , , , | Leave a comment

Installing BPM for Developers

If you are going to be doing development for Oracle BPM Suite 11g, you may want to install a copy of BPM on your own machine so that you can do some unit testing as you build components and composites.

The full installation of BPM may be a bit too heavy for a lot of developer’s machines, but there is an easy option to install a lightweight developers version of BPM.

You will need to have a database, and run the Repository Creation Utility to create the schemas for BPM.  You can use the Oracle Express Edition (XE) database to minimise the footprint.  You will find details about how to run RCU in this post.

Then you will need to install a Java Development Kit, WebLogic Server, and the SOA Suite (BPM Suite) 11.1.1.3 as detailed in that post.  Note that you will not need to install the Web Tier, WebCenter, UCM or any of the other components listed in that post.

You should take a look at the Oracle JRockit JVM for your development server.  In my testing, I found that it improved the performance of my server about 30% during deployments and at runtime.  It does however take longer to start than the Oracle HotSpot JVM (i.e. the normal ‘Sun’ JVM).  Of course this is not a big deal if you leave it running.  There is also some pretty decent tooling available to help you with performance tuning, profiling and analysis (JRockit Mission Control) – more about that in later posts.

In my main development environment I use Oracle JRockit 4.1.0-1.6.0 to run WebLogic 10.3.3 and BPM 11.1.1.3 (all 64-bit).  I run JDeveloper 11.1.1.3 on the HotSpot JVM (1.6.0_20, 21 or 22, nothing earlier).  This is all on Windows Server 2008 (64-bit).  I find that the configuration described in this post is significantly faster and more productive for me, than the standard (default) installation.

After you have installed the binaries, you will need to create your domain.  This is where the setup process starts to differ.

There are two developer domain templates provided in the product, under the Oracle Middleware home directory, in:

Oracle_SOA1\common\templates\applications

In this directory, you will see two files called:

oracle.soa_template_developer_11.1.1.zip
oracle.bpm_template_developer_11.1.1.zip

You need to rename (or copy) these two files, so that they have the extension .jar instead of .zip.  This will make them appear in the list of options when you create a new domain.

To create a domain, start up the config script in the SOA home:

c:\Oracle\Middleware\Oracle_SOA1\common\bin>  config

The Fusion Middleware Configuration Wizard will appear.  Select the Create a new WebLogic domain option and click on Next to continue.

image

From the list of options, first select Oracle Enterprise Manager – 11.1.1.0 [oracle_common], this will also select a couple of other options.  Then select Oracle SOA Suite for developers – 11.1.1.0 [Oracle_SOA1] and then finally Oracle BPM Suite for developers – 11.1.1.0 [Oracle_SOA1]. Then click on Next to continue.

image

Enter a name for your domain, I called mine sml_domain, then click on Next.

image

Enter a password for your administration user and click on Next.

image

On the next screen, make sure you choose Development Mode and then pick your JDK.  If you are going to use JRockit, like me, you will need to select Other JDK and then click on the Browse button to point to the location where you installed it.  Then click on Next.

image

On the next screen, you will need to configure the database connections.  Select all of the components in the bottom part of the screen, as shown below, and then enter your database details in the top half as shown.  If you changed the default prefix from DEV when you ran the Repository Creation Utility, then you will need to select each component one by one and update the Schema Owner field.  When you are done, click on Next.

image

The next page will confirm that the database connections are all right.  If you get any errors, go back and correct them on the previous page then retry the tests.  When you are ready to proceed, click on Next.

image

We don’t need to do anything on this next page, just click on Next to continue.

image

Take a look at the configuration summary if you want to, then click on Next to continue.

image

You can watch the progress as the domain is created.

image

After a short time, the wizard will have completed the creation of the domain.  Make sure that Start Admin Server is not checked and click on Done to exit the wizard.

image

The more fervent readers of documentation among you may have come across the following, which tells us we need to run an ant script called ant-soa-util.xml in order to properly configure a single server domain, however this is no longer necessary with 11.1.1.3, so we do not need to do anything.

http://download.oracle.com/docs/cd/E14571_01/doc.1111/e13925/configure.htm#sthref106

Now we are ready to start up our server, using the following command, in the domain directory we just created:

c:\oracle\Middleware\user_projects\domains\sml_domain\bin> startWebLogic.cmd

The server will start up and the console (server output) will be available in your console/terminal.  The first time you start the server, it will take a bit longer than usual, as it has a bit of extra work to do unpacking a few files and so on.

After a few minutes, you will get a message letting you know the server is RUNNING.

image

Now you can log on to the server using the following URLs:

http://yourserver:7001/console        WebLogic console
http://yourserver:7001/em             Enterprise Manager
http://yourserver:7001/bpm/workspace  BPM Work Space
http://yourserver:7001/bpm/composer   BPM Process Composer

You can also create a connection in your JDeveloper and start developing!  Enjoy!

Note: JVM Memory Tuning

If you have enough memory on your development machine, you may want to tune the JVM memory arguments.  More detail on this topic later on, but for now, you might want to just try increasing the heap size and the permanent generation size.  This is done by editing the setDomainEnv.cmd file in the domain directory for example:

user_projects\domains\sml_domain\bin\setDomainEnv.cmd

You will need to add a line like this:

set USER_MEM_ARGS=-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m

This example will make the heap 2GB and the permanent generation 512MB.  Of course, JVM memory tuning is quite a big topic in and of itself and simply throwing these settings in may not make things better on your particular machine, and if you don’t have enough memory, they may even prevent your server from starting!

Posted in Uncategorized | Tagged , , , , , | 2 Comments

Using the Organisation Chart component

In a previous post, we built a component that displays an organisation chart using the ADF Hierarachy Viewer.  In this post, we look at how to use that component.

The organization chart provides a hierarchy view for members in an organization or company. It retrieves user’s information from WebLogic identity store such as LDAP server.

The component provides two approaches for integration with your customized WebCenter application or Webcenter space:

– Separated ADF Application

Deployed it to your Webcenter server as standalone ADF application and integrate with your customize application or Webcenter space using iframe, hyperlink etc.

– Taskflow

Add it to your page by Composer.

Installation

1. Separated ADF Application

– Open organization application by JDeveloper.

– Open web.xml under ViewController/Web Content/WEB-INF

– Change the value of context-param ‘ldap.org.topUserID’ to the topuser in your organization. Default value is ‘weblogic’

<context-param>

<param-name>ldap.org.topUserID</param-name>

<param-value>weblogic</param-value>

</context-param>

– Deploy the application to your webcenter server. The organization chart can be accessed by following url:

http://%your_server_name:your_server_port% /organization/faces/ organization.jspx

2. ADF Taskflow

a) In customized Webcenter application

– Add following parameter to web.xml of your application

<context-param>

<param-name>ldap.org.topUserID</param-name>

<param-value>weblogic</param-value>

</context-param>

Change the value of context-param ‘ldap.org.topUserID’ to the topuser in your organization. Default value is ‘weblogic’

– Create a new File System Connection to the folder where adflibOrganization.jar is placed.

clip_image002

– Add this jar to your project.

clip_image004

– Add the taskflow catalog reference to default-catalog.xml

You can get Taskflow catalog reference by following way:

clip_image006

clip_image008

Add the resource declaration to default-catalog.xml. It is under %your_app_root_folder%/ mds/oracle/adf/rc/metadata.

<resource id=”organization-task-flow-definition”

repository=”application.classpath”

name=”organization chart”

description=”organization chart”

path=”adflibOrganization.jar/ADF_TaskFlow/WEB-INF+organization-task-flow-definition.xml#organization-task-flow-definition”/>

</contents>

– Redeploy your application, you can see the organization chart from resource catalog.

clip_image010

– Switch your page to edit mode; edit organization Taskflow; change the parameter ‘Top User ID’ to top user ID in your organization.

clip_image012

b) In WebCenter Spaces

Refer the Webcenter space extension guide to add organization chart taskflow to Webcenter space catalog.

Update user attributes shown in the chart

Create users from Weblogic admin console and change attributes value from ldap browser. The related ldap attributes shown in the chart include:
givenName
sn:  surname
title
homePhone
mail
postalAddress
st:  state
c:  country
jpegphoto: photo
manager

The “manager ”  attribute is the association field of organization

Posted in Uncategorized | Tagged , , | Leave a comment

Building an interactive Organisation Chart using the ADF Hierarchy Viewer component

Introduction

The ADF Hierarchy Viewer component provides a highly interactive way to visualise and interact with a set of data which contains relationships.  In this post, we will use it to build an organisation chart which allows users to navigate around the structure, expand and close nodes, zoom, get more information.  The component also provide several different layouts, like the basic hierarchy shown below, as well as various other hierarchical layouts, and star charts.

The organization chart (see image below) provides a hierarchy view for members in an organization or company.   It retrieves user’s information from WebLogic identity store such as LDAP server.

image

The component provides two approaches for integration with your customized WebCenter application or WebCenter Spaces:

– Separated ADF Application

Deployed it to your WebCenter server as standalone ADF application and integrate with your customize application or WebCenter Spaces using iframe, hyperlink etc.

– Taskflow

Add it to your page by Composer.

Architecture

clip_image002

ADF Hierarchy Viewer: The ADF hierarchy viewer component displays hierarchical data as a set of linked nodes in a diagram. The nodes and links correspond to the elements and relationships to the data. The component supports pan and zoom operations, expanding and collapsing of the nodes, and rendering of simple ADF components within the nodes. A common use of the hierarchy viewer is to display an organization chart.

Java Bean: The property and behavior of the ADF Hierarchy view component or containing components can be bound to java bean property or method.

User and Role API for OPSS (Oracle Platform Security Service): User and role API provide access to a user’s attribute stored in an identity store (LDAP, RDBMS, custom). This API frees application developer from knowing the details of the identity store.

OPSS: OPSS provide a abstract layer in the form of standard based API that insulate developer from security and identity management implementation details.

Identity Store: it can be ldap directory, database or custom identity repository. Using OPSS, developer no need know the background identity store.

Implementation Detail

1. Create ADF Taskflow

Create a new Taskflow

clip_image004

clip_image006

Drag and drop a view from component palette, name it. Double click it, system will generate a jsf page fragment

clip_image008

clip_image010

Define managed bean and input parameter as following picture shown

clip_image012

The Taskflow input parameter can be set in runtime on page edit mode. So user can dynamically change the top user of the whole organization.

2. Page Design

Page layout

Open the organization.jsff page and view the structure window as following picture shown

clip_image014

Dvt:hierarchyViewer

The ADF hierarchy viewer component displays hierarchical data as a set of linked nodes in a diagram. Detail information can be checked from following link:

http://download.oracle.com/docs/cd/E16764_01/apirefs.1111/e12418/tagdoc/dvt_hierarchyViewer.html

Dvt:node

The node component is used to stamp out nodes in the hierarchy.

The “zoom100”, “zoom75”, “zoom50”, and “zoom25” facets are used to specify the stamps for different zoom levels of the hierarchy. The “zoom100” facet is typically the most detailed, showing the most information, because the nodes are larger at 100% size. The “zoom25” facet is typically the least detailed, showing the least information, because the nodes are smaller at 25% size. Detail information can be checked from following link:

http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12418/tagdoc/dvt_node.html

Node detail

Expand the zoom100 node facet

clip_image016

The panel card component is a container that shows one of multiple showDetailItems at a time, and provides navigation between its showDetailItems with an optional transition effect. Detail information can be referred from following link:

http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e12418/tagdoc/dvt_panelCard.html

Data binding

Hierarchy View binding

value’ property is bound with ‘employees’ property of organization bean. It is a TreeModel which contains employees list getting from background identity store. Each hierarchy node is bound to employee instance in this list.

Navigation up’ listener is bound to ‘doNavigateUp’ method of organization bean. This listener is triggered when navigating the tree.

clip_image018

Node binding

Each hierarchy node is bound to employee instance in the employee list which is bound to hierarchy view component.

clip_image020

‘SetAnchorListener’ is bound to ‘doSetAnchor’ method of organization bean. This method make the selected node as the new anchor.

3. Java Bean implementation introduction

– Organization.java: ADF Managed bean class

It contains following accessor method ‘getEmployees()’ which returns a TreeModel instance which is bound with ADF Hierarchy view component’ ‘value’ property.

– Employee.java: Employee wrapper class to fetch the employee information getting from identity store.

This class contains an accessor method ‘getChildEmployees()’ which return child employees list of current employee based on ‘manager’ property of the user entry in background identity store such as LDAP directory.

Inside this method, user and role API for OPSS is used to retrieve the employee list of current manager. The benefit of using this API is free developer knowing the detail background identity store and increasing the portability of the application. See following code as following:

clip_image021

The next post provides details about how to use the component.

Posted in Uncategorized | Tagged , , | 2 Comments

Consuming E-Business Suite web services using Oracle Service Bus, or Using Oracle Service Bus with OWSM Policies to call WS-Security protected services

This post demonstrates how to expose an E-Business Suite interface as a web service, in this case the PL/SQL API for getting a price for a product.

Once you have exposed a service, you are probably going to want to consume it!  An excellent way to do that is to use the Oracle Service Bus, providing service virtualisation and loose coupling, as well as the ability to cache service results and provide a simpler interface to downstream service consumers, like user interfaces for example.

In this post, we will explore consuming the E-Business Suite pricing service using Oracle Service Bus.  In a subsequent post, we will look at using Oracle Service Bus to provide a simpler interface and service result caching.

Thanks to Dave Reid and Devon Winkworth for helpful ideas and suggestions.

To complete the steps in this post, you will need to have exposed your service from E-Business Suite and granted access to a user, as described here, and you will need an installation of Oracle Service Bus 11.1.1.3 with the Oracle Web Services Manager Extension installed.  I used a WebLogic domain which contained both Oracle Service Bus 11.1.1.3 and Oracle SOA Suite 11.1.1.3.

To begin, we log on the the Oracle Service Bus console at http://yourserver:7001/sbconsole using an administrative user, like weblogic.

If you have just installed Oracle Service Bus, your console should look like the image below.  If you have been using your installation for a while, there will probably be some more data in there.  Let’s click on the Project Explorer view in the main navigation down the left hand side of the console window, to move from the dashboard to the project view.

In order to make some changes, we need to start a Session in the Change Center by clicking on the Create button in the top left of the console.

When you click on it, you will notice the Change Center window changes to look like the image below.  Now, we will create a new project to hold our work.  Enter a name in the Enter New Project Name field and then click on the Add Project button.  I called mine RedStack.

Now, click on your newly created project in the tree under Project Explorer on the left hand side navigation to open the project.  We will create a folder to hold our WSDL and related resources.  Enter a name for the folder in the Enter New Folder Name field and click on the Add Folder button.  I called mine Resources.

Click on the new folder in the Project Explorer to open it.  Now we will add the details of our service.  In the Create Resource pull down menu, select Resources from URL.  This option allows us to point to a running service and automatically import the necessary information into the service bus.

Enter the URL for the WSDL (which we got at the end of the previous post) into the URL/Path field, choose a name, I called mine EBSGetPrice, and make sure the Resource Type is WSDL.  Then click on the Next button to continue.

Your WSDL address should be something like this:

http://yourEBSserver:8000/webservices/SOAProvider/plsql/qp_preq_pub/?wsdl

Oracle Service Bus will connect to E-Business Suite and read the WSDL and associated XSD, you will see these displayed, as in the image below.  Click on Import to add them into the service bus.

You will now see the WSDL and XSD listed under the Resources folder in your project, as shown below.

Navigate back to the root of your project, and add another folder called BusinessServices to hold our business service definitions.  Simply speaking, a “business service” in the Oracle Service Bus is a a service that is invoked by the service bus.  The opposite is a “proxy service” which is a service that is exposed by the service bus.

Navigate into your new BusinessServices folder, and select Business Service from the Create Resource menu, as shown.

Enter a name for your business service, I called mine EBSGetPriceBS, and make sure the Service Type is WSDL Web Service.  This tells the service bus that we are defining this new service based on a WSDL that already exists in the service bus.  Click on the Browse button to locate the WSDL we just imported from E-Business Suite.

A list of WSDL resources will be displayed.  Click on your EBSGetPrice WSDL.

Then highligt the port you want to use (in this case there is only one, but more complex services may provide multiple ports) and click on Sumbit.

You will return to the Create a Business Service wizard.  Click on Next until you arrive at the HTTP Transport Configuration page.  Open up the Advanced Settings and ensure the the checkbox next to Use Chunked Streaming Mode is not selected.

Click on Next until you arrive at the final (summary) page, as shown below.  You can accept all the defaults for this simple example.  Then click on Sumbit to save your new business service definition.

Ok, so now we have defined a business service that will call the pricing web service that we exposed in E-Business Suite.  Let’s save all our changes by activating the session – when you work in the Oracle Service Bus console, the changes you make are not “deployed” into the running service bus until you “activate” them.

Click on the Activate button in the Change Center.  Enter a description if you want to (it makes it easier to find where you made changes later on) and click on Sumbit.

Now, since the E-Business Suite service uses WS-Security for authentication, we are going to need to set up a policy to add WS-Security credentials to our business service.  There are several ways to acheive this, but the “best” way – well the way that is most in line with how Oracle recommends you do this, and how it is done in Oracle products – is to use the Oracle Web Services Manager.   This approach also provides very neat separation of concerns, keeping the security as declarative and policy based, and applying it to the service defintions at runtime.

If you have not used Oracle Web Services Manager before in this domain, you will need to set up a keystore to hold the credentials.  If you already have a keystore, you can skip the next few steps.

Create a directory to hold our keystore:

mkdir /u02/keystores

In this directory, create a new keystore and a RSA key pair.  Note that this whole command is entered on one line.  It is shown here on multiple lines for ease of reading only.  You may need to put the path to your JDK’s bin directory before the keytool command if that directory is not in your PATH.  You need to add in the appropriate Common Name (CN) as shown in bold.  Here we have used the fully qualified hostname of the WebCenter server, with the hostname as a cn and each domain name component as a dc.  You also need to provide a password for the key (keypass) and for the keystore (storepass), as shown.

keytool
-genkeypair
-keyalg RSA
-dname "cn=yourserver,dc=au,dc=oracle,dc=com"
-alias orakey
-keypass welcome1
-keystore default.jks
-storepass welcome1
-validity 1064

Copy your keystore into your domain configuration directory, using a command like this: (again, this command should be entered on one line)

cp default.jks
/u02/user_projects/domains/boot_domain/config/fmwconfig/

Next, we will configure our domain to use this keystore.  In Enterprise Manager, navigate to “Farm_boot_domain” -> “Weblogic Domain” -> “boot_domain”

From the context menu, select “Security” -> “Security Provider Configuration”

Scroll down to Keystore, expand it, and click Configure.  Deselect (uncheck) the box Configure Keystore Management and click Ok.  This will make sure that we reset the configuration and remove any old values.  It is a good practice to follow this two step process of unconfiguring and then configuring.

Now go back to Keystore, and click Configure again, this time check the box Configure Keystore Management and enter the following information:

Keystore Path = ./default.jks
Password = welcome1 
Confirm Pwd = welcome1
Signature Key Alias = orakey
Signature Password = welcome1 
Confirm Pwd = welcome1
Encryption Key Crypt Alias = orakey
Crypt Password = welcome1
Confirm Pwd = welcome1

Save your changes and then stop all managed servers, and then the admin server, then restart the admin server and then the managed servers.

That completes the steps needed to setup the keystore.

Now, we will create some credentials for E-Business Suite.  In the Enterprise Manager, navigate to your WebLogic domain and then open the domain menu and select Security and then Credentials as shown below.

You should already have a map called oracle.wsm.security.  If not, click on Create Map and add it.  Note that is must have this exact name.  Then highlight this map and click on Create Key.  Name the key ebs-key and enter ASADMIN as the User Name (assuming this is the E-Business Suite user you selected in the previous post) and enter the password for this user.  Then click on OK to save these credentials.

Now we will create a policy which uses these credentials.  E-Business Suite requires us to use WS-Security Username Token policy.  In Enterprise Manager, open the domain menu and select Web Services and then Policies as shown.

Change the Applies To filter to All and then click on the little green arrow in a blue circle icon next to the Name field to search for policies.

Scroll down to find the policy called oracle/wss_username_token_client_policy.  Make sure you get the right one, there are a number of them with fairly similar names.  This policy is almost exactly what we need, so we will just make a copy of it and add in our changes.

With this policy highlighted, click on the Create Like button.

Enter a name for your new policy.  I just added EBS- to the beginning of the existing name, to get EBS-oracle/wss_username_token_client_policy.

Scroll down to the Assertions section, and highligh the WSSecurity UserName Token entry.  Then click on the Configuration tab just below that.  Your screen should look like the image below:

Highlight the csf-key entry in the Configurations table and click on the Edit button.  Enter ebs-key in the Value field.  This is the name of the credentials that we just created in the previous step.  Again, notice the nice clean separation, with the actual credentials being stored separately to the policy, so that they are reusable.  Click on the OK button and then the Save button to save this new policy.

Now that we have defined our policy, let’s apply it to our service and test it.

Back in the Oracle Service Bus console, create a new change session, and navigate to your EBSGetPriceBS service and open it.  Use the project tree in the laft hand side navigation to get to the folder and then click on the service name to open it.  Open the Policies tab as shown below.  From the list of Service Policy Configuration options, select OWSM Policy Bindings.  The screen will refresh, then click on the Add button in the Service Level Policies table.

Select your newly defined policy from the list and click on Submit.

Now save and activate your changes (as we did before).

Now we are ready to test our service.  Click on the little green ladybug icon next to your service to open the test console.

Enter the test data into the SOAP Header and Payload fields as shown below.  My test data is included just below the image.  Then click on Execute to run the test.

Here is the test data that I used.  This should work for you, but you may need to adjust some values to suit your E-Business Suite installation.

Header

<soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <qp:SOAHeader>
      <qp:Responsibility>FND_REP_APP</qp:Responsibility>
      <qp:RespApplication>FND</qp:RespApplication>
      <qp:SecurityGroup>STANDARD</qp:SecurityGroup>
      <qp:NLSLanguage>AMERICAN</qp:NLSLanguage>
      <qp:Org_Id>204</qp:Org_Id>
    </qp:SOAHeader>
</soap:Header>

Body

<pric:InputParameters xmlns:pric="http://xmlns.oracle.com/apps/qp/soaprovider/plsql/qp_preq_pub/price_request/">
      <pric:P_LINE_TBL>
        <pric:P_LINE_TBL_ITEM>
          <pric:REQUEST_TYPE_CODE>ONT</pric:REQUEST_TYPE_CODE>
          <pric:PRICING_EVENT>LINE</pric:PRICING_EVENT>
          <pric:LINE_INDEX>1</pric:LINE_INDEX>
          <pric:LINE_ID>190339</pric:LINE_ID>
          <pric:LINE_TYPE_CODE>LINE</pric:LINE_TYPE_CODE>
          <pric:PRICING_EFFECTIVE_DATE>2010-05-30</pric:PRICING_EFFECTIVE_DATE>
          <pric:ACTIVE_DATE_FIRST>2010-05-30</pric:ACTIVE_DATE_FIRST>
          <pric:ACTIVE_DATE_FIRST_TYPE>NO TYPE</pric:ACTIVE_DATE_FIRST_TYPE>
          <pric:ACTIVE_DATE_SECOND>2010-05-30</pric:ACTIVE_DATE_SECOND>
          <pric:ACTIVE_DATE_SECOND_TYPE>NO TYPE</pric:ACTIVE_DATE_SECOND_TYPE>
          <!--pric:USAGE_PRICING_TYPE>L</pric:USAGE_PRICING_TYPE-->
          <pric:LINE_UOM_CODE>Ea</pric:LINE_UOM_CODE>
          <pric:CURRENCY_CODE>USD</pric:CURRENCY_CODE>
          <pric:PRICE_FLAG>Y</pric:PRICE_FLAG>
        </pric:P_LINE_TBL_ITEM>
      </pric:P_LINE_TBL>
      <pric:P_QUAL_TBL>
        <pric:P_QUAL_TBL_ITEM>
          <pric:LINE_INDEX>1</pric:LINE_INDEX>
          <pric:QUALIFIER_CONTEXT>MODLIST</pric:QUALIFIER_CONTEXT>
          <pric:QUALIFIER_ATTRIBUTE>QUALIFIER_ATTRIBUTE4</pric:QUALIFIER_ATTRIBUTE>
          <pric:QUALIFIER_ATTR_VALUE_FROM>1000</pric:QUALIFIER_ATTR_VALUE_FROM>
          <pric:COMPARISON_OPERATOR_CODE>=</pric:COMPARISON_OPERATOR_CODE>
          <pric:VALIDATED_FLAG>Y</pric:VALIDATED_FLAG>
        </pric:P_QUAL_TBL_ITEM>
        <pric:P_QUAL_TBL_ITEM>
          <pric:LINE_INDEX>2</pric:LINE_INDEX>
          <pric:QUALIFIER_CONTEXT>CUSTOMER</pric:QUALIFIER_CONTEXT>
          <pric:QUALIFIER_ATTRIBUTE>QUALIFIER_ATTRIBUTE2</pric:QUALIFIER_ATTRIBUTE>
          <pric:QUALIFIER_ATTR_VALUE_FROM>1290</pric:QUALIFIER_ATTR_VALUE_FROM>
          <pric:COMPARISON_OPERATOR_CODE>=</pric:COMPARISON_OPERATOR_CODE>
          <pric:VALIDATED_FLAG>Y</pric:VALIDATED_FLAG>
        </pric:P_QUAL_TBL_ITEM>
      </pric:P_QUAL_TBL>
      <pric:P_LINE_ATTR_TBL>
        <pric:P_LINE_ATTR_TBL_ITEM>
          <pric:LINE_INDEX>1</pric:LINE_INDEX>
          <pric:PRICING_CONTEXT>ITEM</pric:PRICING_CONTEXT>
          <pric:PRICING_ATTRIBUTE>PRICING_ATTRIBUTE1</pric:PRICING_ATTRIBUTE>
          <pric:PRICING_ATTR_VALUE_FROM>208964</pric:PRICING_ATTR_VALUE_FROM>
          <pric:VALIDATED_FLAG>N</pric:VALIDATED_FLAG>
        </pric:P_LINE_ATTR_TBL_ITEM>
      </pric:P_LINE_ATTR_TBL>
      <pric:P_LINE_DETAIL_TBL/>
      <pric:P_LINE_DETAIL_QUAL_TBL/>
      <pric:P_LINE_DETAIL_ATTR_TBL/>
      <pric:P_RELATED_LINES_TBL/>
      <pric:P_CONTROL_REC>
        <pric:PRICING_EVENT>LINE</pric:PRICING_EVENT>
        <pric:CALCULATE_FLAG>Y</pric:CALCULATE_FLAG>
        <pric:SIMULATION_FLAG>N</pric:SIMULATION_FLAG>
        <pric:ROUNDING_FLAG>Q</pric:ROUNDING_FLAG>
        <pric:DEBUG_FLAG>Y</pric:DEBUG_FLAG>
        <pric:TEMP_TABLE_INSERT_FLAG>Y</pric:TEMP_TABLE_INSERT_FLAG>
        <pric:MANUAL_DISCOUNT_FLAG>Y</pric:MANUAL_DISCOUNT_FLAG>
        <pric:REQUEST_TYPE_CODE>ONT</pric:REQUEST_TYPE_CODE>
        <pric:ORG_ID>1642</pric:ORG_ID>
      </pric:P_CONTROL_REC>
    </pric:InputParameters>

When the test completes (should be less than a second) you will see the results window.  Scroll down past the request message to find the response.  In the response you will find the UNIT_PRICE has been populated by E-Business Suite, as shown in the image below:

You will see that there are also many other peices of data in the response – this is a fairly complex interface.  In our next post in this series, we will look at how we can hide this complexity from clients and how we can cache the data from E-Business Suite to improve performance.

That completes this post, which shows us how to consume a WS-Security protected web service provided by E-Business Suite using the Oracle Service Bus and policy based security.  Of course, this approach will work for any WS-Security Username Token based web service, not just thos provided by E-Business Suite.  For example, JD Edwards Enterprise One uses this same style of security, so this approach will also work against JD Edwards.

Posted in Uncategorized | Tagged , , , , | 1 Comment

Deploying to WebLogic Server on Amazon EC2 from JDeveloper

Sometimes, when running WebLogic Server on the Amazon Elastic Compute Cloud, you may find that you are unable to deploy from your local JDeveloper to your WebLogic Server instance.

Andrew Rosson has written a helpful post (here) that provides a simple solution.

Posted in Uncategorized | Tagged , , , | Leave a comment

Purging old instance data from SOA/BPM 11g

When you are running a lot of instances of your composites through SOA/BPM 11g in your testing/development environment, you will start to fill up the available space in your database with the logging and auditing information for these instances.  From time to time, you will want to clean up your database by purging the old instance data.

Starting from version 11.1.1.2, we provide a set of SQL scripts in the following location that can be used for just this purpose.

<MIDDLEWARE_HOME>\Oracle_SOA1\rcu\integration\soainfra\sql\purge

If you want to get a feeling for how much free space you have, you might like to use the query in this post, which will produce results like those shown below.

If you are running an earlier version, you can download the scripts as a patch by looking up Oracle Support document number 815896.1.  This document also provides details about how to define a filter so that the scripts will only remove certain instance data, and leave other data untouched.

To remove all old instance data, you can just invoke the scripts like this:

sqlplus dev_soainfra/welcome1 @purge_soainfra_oracle.sql
Posted in Uncategorized | Tagged , , , , | Leave a comment

Iterating/traversing arrays in BPM

Update: See this post for an updated example.

Recently, I was working with a customer who has a requirement to create an arbitrary number of human tasks, based on the cardinality of an input data structure (array).  A bit of hunt around did not turn up any good examples or documentation on this use case, so I did a bit of research and experimentation and have come up with the following approach.

Thanks to Ali Mukadam, Sushil Shukla and Meera Srinivasan for ideas and suggestions.

The scenario we will use here is ordering a number of pathology tests.  For simplicity, we will just display each request as a human task, and pass the input data into the process using the testing framework.

To complete this example, you will need JDeveloper 11.1.1.3 with the SOA Composite Editor and BPM extensions installed (you can install them from Help – Check for Updates) and a BPM 11.1.1.3 server to deploy to.  Details of how to install BPM are in this post, note though that you will not need all the WebCenter components for this example.

To start, in JDeveloper, from the File menu we select New and then Application.  In the Create BPM Application wizard that appears, enter a name for your application, I called mine OrderTests, select the BPM Application template, and then click on Next.

image

On the next page, provide a name for your project, I used the same name, and click on Next.

image

On the last page of the wizard, take the default option to create a Composite with BPMN Process and click on Finish.

image

Your new application will be created, with a BPMN project in it, and the Create BPMN Process wizard will appear.  For this example, we will accept the default process template, just click on Next.

image

On the next page, give your actual BPMN process a name, I called mine OrderTests.  It is important that you give each process a different and meaningful name.  Then click on Finish.

image

Your new process will open in JDeveloper.  Switch the BPM Application view, if it is not already visible, as shown below on the left hand side.  Open up the Business Catalog node as shown.  We are going to create some data definitions to hold information about our tests, and to hold a group of tests.

image

Right click on the Business Catalog folder and select New and then Module from the popup context menu.

image

Enter a name for your new module, I called mine Data.  The module is really just a folder or container to hold the artefacts we are going to create.

image

Now right click on your new container and select New and then Business Object from the popup context menu.  A business object is a data type in BPM.

image

Enter a name for your new business object, I called mine Test.  Note that it will be placed into the module we created.  We could create it using an existing XML Schema, but in this case we will define it manually.  Click on OK to continue.

image

Click on the green plus icon at the right hand side of the Attributes section to add a new attribute to out business object.

In the dialog box, enter a name for the attribute, I called mine testNumber.  Then select a type for the attribute.  I used Int for an integer.  Then click on OK.

image

Create two more attributes in the same way, testDescription as a String, and …

image

testResults as a String.

image

Your business object should now look like this:

image

Now we will create a second business object which will hold a collection of tests.  Right click on your Data module and select New and then Business Object from the popup context menu, as we did earlier.

image

Enter a name for this business object, I called mine SetOfTests, and click on OK.

image

Click on the green plus icon to add a new attribute, as we did before.  Enter a name for this attribute.  I called mine tests.  For this attribute, we want to use our other business object as the type.  To do this we click on the button with the elipsis (…) next to the Type field to open up the type browser.

image

From the pulldown Type select the <Array> option.

image

The display changes to present a new Element Type field that was not previously displayed.  This allows us to select what type the elements of the array will be.

image

Click on the elipses (…) next to Element Type and select <Component> from the list of options.  We are going to use the component we defined earlier as the type of the elements in our array.

image

From the list of components, choose Test and click on OK.

image

Your screen should now look like this:

image

Click on OK to continue.  Your screen should now look like the image below, indicating that the new attribute tests will be an array of the Test component/business object in the Data module/folder.  Click on OK.

image

Your new business object should now look like this:

image

Now that we have defined our types, it is time to create a variable in our process, using these types, to actually hold the data we want to work on in the process.  Return to the process using the tabs at the top of the main pane, or by double clicking on it in the navigator (top left).  When the process is open, you should see the structure view (bottom left) as shown in the image below. If you do not see it, you can open it from the View menu.  Right click on the Process Data Objects folder and select New from the popup context menu.

image

In the dialog box that appears, give your variable (process data object) a name, I called mine testData, and then click on the elipsis (…) next to the Type field to select the type for the variable.

image

In the type browser, select <Component> from the drop down list.

image

Then select Test from the list of components, and click on OK.

image

You should be returned to the dialog box, which should now look like the image below.  Click on OK to continue.

image

Now we will create a second variable for the set of tests, right click on the Process Data Objects folder again, and select New from the popup context menu.

image

I named this second variable setOfTestRequested.  Click on the elipsis (…) to choose the type, select <Component> and then choose the SetOfTests component, then click on OK.

image

Click on OK in the dialog box.  This second variable will hold the array of test data objects.

image

If you open up the Process Data Objects folder, you will see your two variables, as shown below.

image

Ok, now we have all our data and variables sorted out, let’s work on the process itself.  First, let’s define a role so we know what type of user will carry out the tasks in this process.  You can of course have multiple roles, but for our simple example we will only need one.  Double click on the swim lane header at the left hand side of the process, it is shown in a darker gray colour at the left hand side of the image below.  This will open the Role Properties dialog box.  Click on New to create a new role and enter a name for it.  I called mine Requestor.  Click on OK and then OK again.

image

You will notice now the the swim lane header shows the name of our new role.  Next, we will set up the inputs for our process.  Note that you do not have to have inputs for a process.  It is fine to have a human task at the beginning of the process where a user can enter the inputs directly.  By setting up inputs on the Start node, as we are here, we allow this process to be started (‘invoked’) as a service, or by sending it a message.  This will make it slightly easier for us to test.  Right click on the Start node and select Properties from the popup context menu (or double click on the Start node).

image

In the Properties – Start dialog box, select the Implementation tab, as shown in the image below.  The click on the green plus icon at the top right of the Arguments Definition section.

image

In the Create Argument dialog box, enter a name for your argument, I called mine input1 and then click on the elipsis (…) to choose the type.  Select <Component> and then SetOfTests from the component browser.  Then click on OK.

image

Tick the checkbox next to Use Associations and then click on the little pencil icon to the right, next to the Type: Simple drop down.  Drag the setOfTestsRequested variable from the right hand side into the Outputs box in the middle, as shown below.  This means that the inputs sent to the process (input1) will be stored in the variable setOfTestsRequested.  Click on OK to continue.

image

Your screen should now look like this.  Click on OK to continue.

image

Now repeat this process on the End node.  Add an argument called output1 of type SetOfTests, similarly to what you just did for the Start node.

image

In its associations, drag the setOfTestsRequested into the Inputs area as shown below.  This means the data in that variable will be sent out of the process as its output.

image

Now let’s implement the body of our process.  We will use the Subprocess object to handle the traversal of the array of tests.  Drag a Subprocess from the component palette on the right into the process and drop it on the line between the Start and End nodes.  You may want to move the End node across to the right first to give yourself some more room.  Notice that the line changes colour to blue when you hold a component over it.  If you cannot see the component palette, you can open it from the View menu.  Your process should now look like the image below.  You may need to click on the little plus icon to open the subprocess like this.

image

Now let’s set the properties of our subprocess.  We want one instance of the subprocess for each element in the input array.  Right click on the subprocess and select Properties from the popup context menu (or just double click on the subprocess).  Enter a name for the subprocess.  I called mine RequestIndividualTestSubprocess.  Then move to the Loop Characteristics tab.

image

In the Loop Characteristics field at the top, select the MultiInstance option, as shown below.  For the Loop Cardinality select XPath, and for the Is Sequential option (down the bottom), deselect (uncheck) the checkbox.

The MultiInstance option tells the system to create a separate instance of the subprocess for each item.  Because we unchecked Is Sequential, they will all be created at once, and execute in parallel.

Your screen should now look like the image below.  Click on the little calculator icon to the right of the the Loop Cardinality field.

image

The Expression Builder will open, and we can enter an XPath expression to tell the system how many instances of the subprocess we want to run, i.e. the ‘cardinality’ of the loop.

Type in count() in the expression field.  Then place your cursor between the parentheses, i.e. count(here).  In the Variables box at the bottom left, navigate to the tests part of the setOfTestsRequested variable, and highlight it, as shown below.  Then click on the Insert into Expression button to add it in between the parentheses.  Your screen should now look like this:

image

Note that you can just type in the whole expression if you want to.  Click on OK to return to the previous dialog box, which should now look like the image below.  This expression that we have entered tells the system to count how many tests nodes/elements there are inside the setOfTestsRequired variable, so if we pass in an array of two tests, the system will start two instances of the subprocess.

image

Now we move to the Arguments Definition tab.  On the Inputs tab inside this tab, click on the green plus icon to add a new argument.  Call it input1 and set the type to the component Test as we have done previously.

image

On the Outputs sub-tab, create an argument called output1 of type Test also.

image

Check/select the checkbox next to Use Associations and then click on the pencil icon to edit the data associations.  Click on the little calculator icon next to Inputs as shown below.

image

In the Expression Builder, enter the expression: setOfTestsRequested.tests[loopCounter] and press OK.  This expression selects just one of the tests in our variable.  The loopCounter is a special variable that the system will set to a different value for each instance of the subprocess, so in our example where we have two inputs, one instance of the subprocess will have loopCounter set to 1, and the other to 2.

image

Copy and paste this expression (or retype it) in the Outputs are too.  Your screen should now look like this:

image

Click on OK and then OK again.

Now let’s define what we want to do inside our subprocess.  We will send the each test to the user, to have them complete it an update the test with the results.  To do this, we will use a human task.  Drag a User task from the component palette and drop it on the line between the Start and End nodes inside the subprocess.  Then right click on this new task and select Properties from the popup context menu.  Enter a name for this task, as shown below.  I called mine PerformTheTest.

image

Now move to the Implementation tab.  Click on the green plus icon next to the Human Task field to define a new human task.

image

In the Create Human Task dialog box that appears, enter a name and title for the new human task.  I named mine PerformTestTask and set the title to Perform Test.  The title will be displayed to the users.  You need to make sure that the name of your task is different to the name of your process, or other components.  It is a good idea to put “Task” on the end of the names of your tasks so that they will be easily identifiable.

Next, click on the green plus icon next to Parameters to add a new data object for this task.  The Data Object browser will appear to the right, as shown below.  Drag the testData variable into the Parameters area and drop it.  Check/select the checkbox under the Editable column, so that users will be able to update this data object when they complete the task.  Your screen should now look like the image below.

image

Click on OK to return the the previous dialog box.  Check/select the checkbox for Use Associations and then click on the pencil icon.

image

In the Data Associations dialog box, set the inputs and outputs for the test variable to setOfTestsRequested.tests[loopCounter] as we did earlier.  Make sure you put it in the right input/output box.  Your screen should look like the image below.

image

Click on OK and then OK again to return the process.  That completes our definition of our process.  It is a simple process to illustrate our example, in real life, you would obviously have a more complicated process.

Now we need to create a user interface for our human task.  To do this we want to go to the “Composite” view.  This should have been opened automatically when we created our application.  You can open it by selecting its tab in the main pane.  If it is not there, go the the Application Navigator, by opening it from the View menu or selecting its tab in the top left pane, then navigate to the composite.xml under SOA Content in your project.  When you open it, the composite will display in the main pane, and should look like this:

image

This shows us that we have a business process (the blue box) that uses (indicated by the connecting line) a human task (the green box).  We can also see that our process is exposed as a service (the white box in the left hand column).  Double click on the green human task component to open it.  It will display in the main pane, and should look like this:

image

Click on the Create Form button at the top left of the main pane and select Auto-Generate Task Form… from the drop down menu.

image

A dialog box will appear, asking you to name a new project (in your same application) to store the user interface components.  Give it a name, I usually just add “UI” to the end of the task name, so I called mine PerformTestTaskUI.  Then press OK and wait.

image

After some time (10-60 seconds depending on your machine) you will see a few new tabs open in the main pane, and finally a “task flow” page like the one shown below will appear.  When this happens, press the Save All button (or select it from the File menu) to ensure everything is saved.

image

Now we have everything we need to deploy and test our process.  From the Application Navigator, right click on our original project (not the human task one we just created) and select Deploy and then OrderTests… from the popup context menu, as shown below.

image

The deployment wizard will appear.  On the first page, select Deploy to Application Server and then press Next.

image

On the Deploy Configuration page, we can accept the defaults.  If anything goes wrong and you need to deploy again, you will need to either increase the revision ID, or check/select the Overwrite any existing composite with the same revision ID option.  Click on Next.

image

On the Task flow deployment page, we need to include our human task user interface by selecting it from the list, as shown below.  Note that you only need to do this once.  If you do redeploy your process later on, you don’t need to redeploy the task user interface (unless you also change the task user interface of course).  Click on Next.

image

On the next page, select the server connection that you want to deploy to, and click on Next.

image

JDeveloper will connect to your server (there may be a small delay at this point) and retrieve a list of managed servers to which it can deploy.  In a typical development/test environment there will only be one, as shown below.  Make sure the correct one is selected, if you have more than one, and click on Next.

image

Check the details on the Summary page, then click on Finish to start the deployment.

image

In the Log pane, at the bottom of the screen, you can watch progress of the deployment in the Deployment tab.  Your deployment should progress as shown below.  Note that you will get error messages if you have done something wrong, and you will need to go and fix those mistakes before you can deploy your process and task user interface.

image

When you see Deployment finished as shown above, we are ready to test our process.

First, we need to go and map the role we created to an actual user, so that we will be able to see the tasks.  We do this in the BPM Workspace, which we can access at http://yourserver:8001/bpm/workspace.  Log on as an administrator, like weblogic.

image

You will probably see some other processes and tasks sitting in your queue, as shown below (unless this is your first process on the server).  Click on the Administration link at the top right.

image

Scroll down to find the role we defined in the list of roles.  It will be called OrderTests.Requestor, as shown – this is the name of our process and then the name of the role.  Click on it to select it.  The Details view will appear in the bottom half of the screen, as shown below.

image

Click on the little paper and star icon at the top of the Members box to add a new member.  In the popup box, enter a search term, like web*, and click on the Search button.  Then click on the weblogic user in the Available box and click on the little blue right arrow to move it across to the Selected box.  Your screen should now look like this:

image

Click on the OK button, and then click on the Apply button at the top right of the Details view (bottom half of screen).  Make sure you click on Apply or your changes will be lost.  You should now see that your role displays the user weblogic in the list at the top of the screen, as shown below.

image

At this point, you may want to log out and log in again, just to make sure your session will receive new tasks.

Now, we will use the Enterprise Manager to start an instance of our process and see what happens.  You can access the Enterprise Manager at http://yourserver:7001/em and log on as an administrative user, like weblogic.

image

Navigate to the soa-infra node in the SOA folder, as shown.  You will see the SOA dashboard, as shown below.  You may see some existing instances of other composites if this is not a new server.  In the Deployed Composites area, on the right, click on our newly deployed OrderTests composite.

image

This will open up the dashboard for the OrderTests composite, as shown below.  Click on the Test button to start a test instance.

image

Scroll down past the various security, addressing, etc. options to the payload data at the bottom.  In the Size box, next to the tests node, enter 2 and then click on the little refresh icon immediately to the right of the Size box.  This will add two tests elements to our input message.

image

Your screen should now appear like the one below.  Enter the test data as shown, or your own test data as you wish.  Then click on the Test Web Service button to start our composite.

image

The screen will move to the Response tab, as shown below.  Click on the Launch Message Flow Trace link to open up our new instance of our composite.

image

The Flow Trace window will open, as shown below.  Here we can see in the Trace section, that the OrderTests web service was called, which in turn started our OrderTests process, and that two PerformTestTask human tasks were started by our process.  Note that the status shows these are still Running.  Keep this window open, we will return to it shortly.

image

Return to your BPM Workspace window and click on the little blue circular arrows refresh icon above the task list.  You should see two new Perform Task tasks appear in the list, as shown below.  Click on the first one of these to highlight it.  After a moment, the user interface (which we generated earlier) for this taks will open in the bottom half of the screen, as shown below.  You will see the data that we entered for the first of our two tests elements displayed here.  Update the Test Results as shown below, and then click on the Approve button to complete the task.

Note that we are using the auto-generated user interface here.  You have complete control over the user interface, so you can make it look however you like, and can use all sorts of components like tables, buttons, maps, popup boxes, images, tabs, trains, etc.  We are just using the auto-generated one for simplicity.

image

Your screen will refresh and you will see that the first task has disappeared from your list of tasks.  Now process the second task as well, updating the status as shown below, and then completing it by pressing the Approve button.

image

Your screen will refresh and both tasks have now disappeared.  (They are still there, they have just moved to the “completed” view).

Now return to your Flow Trace window that we left a few moments ago.  Hit the little circular arrows refresh icon (top right) to update this page.  You will notice that the status of the process and the human tasks is now shown as Completed.  Click on the OrderTests link to drill down in to the process itself.

image

The Audit Trail view will open.  You can click on the little plus icons to open up the tree.  You can read from the audit trail that our process started, and created two instances of the subprocess, and that each of those created a human task.  Click on the instance left the activity link for one of the human tasks and note that you can see the updated data in the popup windows.  Click on each one and notice the differences.

image

This test confirms that our process worked as expected.  Feel free to go back and run a few more tests, with varying numbers of input tests.

So there you go, a simple method to iterate over (traverse) and update arrays of data in BPM.

Posted in Uncategorized | Tagged , , , | 6 Comments