Tuesday, December 10, 2013

Create a custom Case Activity in Oracle BPM Case Management

In one of my previous posts I highlighted the new case management functionalites in Oracle BPM Suite. Case management enables you to define the different activities - a user can perform to achieve a goal - without defining the workflow process. For more details about ACM I recommend to download our "Adaptive Case Management in Practice" poster and to read the following articles:


A case is always associated with activities which are performed as part of a particular case. Among milestones, data, events, stakeholders and documents the activities are a key element in Oracle BPM 11g Case Management. In the current release you can create case activities based on a BPM process, or a Human Task, or you can create a custom case activity based on a Java class. In this post I will explain the steps to create a custom case activity.

Create a Custom Case Activity


1. Create a new "BPM Application"
2. Create a new "BPM Project"
3. Create a "Composite with Case Management" component

The above steps will result in a composite with the case and its exposed service and case rules. Now you can open the case definition and define your milestones, stakeholders, permissions, data, user events and so on. See the step-by-step "Hello World" example for more details. The Custom Activity Java class must implement the oracle.bpm.casemgmt.caseactivity.ICaseActivityCallback interface. The callback class must be part of the composite (as explained below), or must add it to the workflow customization classpath.

4. Import the oracle.bpm.casemgmt.interface.jar from
<MW_HOME>/Oracle_SOA1/soa/modules/oracle.bpm.runtime_11.1.1/


5. Import the bpm-services.jar from
<MW_HOME>/Oracle_SOA1/soa/modules/oracle.soa.workflow_11.1.1/

6. Select File => New => Java Class and create the CustomCaseActivity Java class.


7. Organize imports and add your custom logic in the "initiate" operation.

package com.cattlecrew.acm.caseactivities;

import java.util.Map;

import oracle.bpm.casemgmt.CaseIdentifier;
import oracle.bpm.casemgmt.caseactivity.ICaseActivityCallback;
import oracle.bpel.services.bpm.common.IBPMContext;

public class CustomCaseActivity implements ICaseActivityCallback {
    public CustomCaseActivity() {
        super();
    }

    public String initiate(IBPMContext iBPMContext,
                           CaseIdentifier caseIdentifier, String string,
                           Map<String, Object> map) {
       
        // Add activity logic here
       
        return "Called class CustomCaseActivity for activity => " + string;
    }
}

8. Create the case activity based on the Java class. See chapter 31 of the Oracle Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management for more details about config options and guidelines.



9. Define your Business Rules.

10. Deploy and test the Case composite. 

Friday, November 15, 2013

New SOA material available on OTN

Listen to our 3-part podcast about "the state of SOA" and read our 13-part article series "Industrial SOA" on OTN


Today I'd like to highlight some SOA material that has recently been published.

1) Podcast Show Notes: Old Habits Die Hard in the New SOA World

During Oracle OpenWorld 2013 in San Francisco Bob Rhubart from the OTN Architect Community invited Lonneke Dikmans, Ronald van Luttikhuizen, Hajo Normann, Torsten Winterberg, Guido Schmutz and me to participate in an informal roundtable discussion of what's happening in Service Oriented Architecture today. I really enjoyed it! You can download the conversation directly from OTN ArchBeat.  

As you'll hear, the conversation ranged from the maturity of Service Oriented Architecture technology and tools, to the the lingering and typically self-imposed problems that can prevent organizations from realizing the full potential of SOA, to what SOA means in the era of *aaS, mobile computing, and big data.  

After the recording we discussed our ACM poster
[Hajo Normann, Torsten Winterberg, me and Lonneke Dikmans (L-R)]

2) Article Series "Industrial SOA" - 9 from 13 articles already published

In the last months already 9 from 13 "Industrial SOA" articles have been published on OTN and the Service Technology Magazine. The articles are covering topics like Service Categories, SOA Security, SOA and User Interfaces, Mobile Solutions and many more. The next upcoming article will be about SOA and Events. 

Download them and share your comments e.g. via twitter by using the hashtag #industrialsoa.

Tuesday, November 5, 2013

Configure Auto-Recovery in Oracle SOA Suite

Oracle SOA Suite 11g has some great features to recover faulted instances automatically. When a BPEL process flow errors out, it is retried with all its invocations. This is undesirable in some cases. For example if re-calling a composite results in duplicated data, data have been changed before the recovery is planned to be executed or you do not want to create too many composite instances in order to save the space in your SOAINFRA-schema. See below the different places where automatic recoveries are configured / disabled.

1) Change RecurringScheduleConfig (see also the screenshot below) 
  • Right-click soa-infra (SOA_cluster_name) 
  • Choose SOA Administration > BPEL Properties 
  • Click "More BPEL Configuration Properties" 
  • Click "Recovery Config" 
  • Change values for RecurringScheduleConfig 
    • maxMessageRaiseSize = 0 
    • startWindowTime = 00:00 
    • stopWindowTime = 00:00 
  • Click Apply 

2) Change StartupScheduleConfig (see also the screenshot below)
  • Right-click soa-infra (SOA_cluster_name)
  • Choose SOA Administration > BPEL Properties
  • Click "More BPEL Configuration Properties"
  • Click "Recovery Config"
  • Change values forStartupScheduleConfig
    • maxMessageRaiseSize = 0
    • startupRecoveryDuration = 0
    • subsequentTriggerDelay = 0
  • Click Apply


3) Change GlobalTxMaxRetry
The property GlobalTxMaxRetry specifies how many retries are performed if an error is identified as a retriable one. For example, after several web service invocations, if dehydration fails due to a data source error, then this is identified as a retriable error and all activities from the prior dehydration state are retried. If the activities being retried are not idempotent (that is, their state can change with each retry and is not guaranteed to give the same behavior), then multiple retries can be problematic.

You can set GlobalTxMaxRetry to 0 in the Systems MBean Browser.
  • Right-click soa-infra (SOA_cluster_name)
  • Choose SOA Administration > Common Properties
  • Click "More SOA Infra Advanced Configuration Properties"
  • Click "GlobalTxMaxRetry"
  • In the Value field, enter an appropriate value
  • Click Apply

Additional Information

Wednesday, October 9, 2013

Poster: Adaptive Case Management (ACM) in Practice

Knowledge-driven processes are typically unpredictable in their execution. Experts working on them decide what’s the next best action to take. This is in contrast to traditional BPM, in which all possible paths of a process are predetermined and modeled into the process. Case management is a way to control and implement these unstructured processes. With the poster below we'd like to bring some of the key aspects of Adaptive Case Management (ACM) on one page.




Feel free to download the PDF-version if you are interested in (login required):
  • What is ACM?
  • Why should I use ACM?
  • How can ACM user interfaces look like?
  • What are the main building blocks of an ACM solution?
  • How to visualize ACM cases with CMMN 1.0? 


Send your feedback with #acmposter:

Jürgen Kress
Fusion Middleware Partner Adoption
Oracle EMEA
twitter.com/soacommunity
Berthold Maier
Enterprise Architect
T-Systems International GmbH
twitter.com/bmaier
Hajo Normann
SOA & BPM Lead ASG
Accenture
twitter.com/HajoNormann
Danilo Schmiedel
Solution Architect
OPITZ CONSULTING Deutschland GmbH
twitter.com/dschmied
Guido Schmutz
Technology Manager
Trivadis
twitter.com/gschmutz
Bernd Trops
Principal Solution Architect
Talend GmbH
twitter.com/berndtrops
Clemens Utschig-Utschig
Chief Architect Global Business Services
Boehringer Ingelheim Pharma GmbH & Co. KG
Torsten Winterberg
Business Development & Innovation
OPITZ CONSULTING Deutschland GmbH
twitter.com/t_winterberg

Wednesday, August 21, 2013

Remove data in Oracle MDS

The two main database schemas in the Oracle SOA Suite database repository are: <PREFIX>_SOAINFRA and <PREFIX>_MDS. Composite instance and runtime information are stored in the SOAINFRA schema. Commonly used metadata like WSDLs, XSDs, rules, fault policies, etc. as well as composite deployments are stored within the MDS schema. 

With every deployment / import of the metadata artifacts a new document version will be created in the MDS. This means that re-importing an updated WSDL-file into the MDS does not delete the previous version of the document. Furthermore we sometimes need to remove unnecessary and unwanted files from the repository. If this is not considered you might end in problems like below:



ORA-01654: unable to extend index DEV_MDS.MDS_PATHS_U2 by 128 in tablespace DEV_MDS
ORA-06512: at "DEV_MDS.MDS_INTERNAL_COMMON", line 865
ORA-06512: at "DEV_MDS.MDS_INTERNAL_COMMON", line 1021
ORA-06512: at "DEV_MDS.MDS_INTERNAL_COMMON", line 1121
ORA-06512: at "DEV_MDS.MDS_INTERNAL_COMMON", line 1216
ORA-06512: at "DEV_MDS.MDS_INTERNAL_COMMON", line 1872
ORA-06512: at line 1

 

In order to avoid production problems because of a full MDS tablespace you should clean up the schema from time to time. This post explains the options that Oracle SOA Suite provides to remove contents from MDS.

OPTION 1: Remove directories and files from MDS using WLST

1) Start WLST from SOA_HOME/common/bin/wlst.sh.

Example:
 
[oracle@soabpm-vm ~]$ cd /oracle/fmwhome/Oracle_SOA1/common/bin 
[oracle@soabpm-vm bin]$ ./wlst.sh 
wls:/offline>
 

2) Execute the following command: sca_removeSharedData('http://<soahost>:<soaport>', 'directory', 'user', 'password')

Example (delete folder 'interfaces' and all its subdirectories and files):

wls:/offline> sca_removeSharedData(‘http://localhost:8001’, ‘interfaces’, ‘weblogic’, ‘welcome1’)

 

Note: With the command above you can just remove directories and files which are stored under "apps".

OPTION 2: Remove directories and files from MDS using ANT

Oracle provides some ANT scripts which can be used to integrate the "remove" command into your central build & deploy proccess. Just search for the "removeSharedData" command in ant-sca-deploy.xml. On the server this file is located under SOA_HOME/bin. You can also find the file in your JDeveloper install folder under MIDDLEWARE_HOME/jdeveloper/bin.

1) Execute the command: ant -f ant-sca-deploy.xml removeSharedData -DserverURL=server.url -DfolderName=folder.name -Drealm=realm -Duser=user -Dpassword=password -DfailOnError=true/false

Example (delete folder 'interfaces' and all its subdirectories and files):
 
ant -f ant-sca-deploy.xml removeSharedData -DserverURL=http://localhost:8001 -DfolderName=interfaces"
 

Note: With the command above you can just remove directories and files which are stored under "apps". See the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite for a detailed description of the parameters.

OPTION 3: Remove files from MDS using WLST

1) Start WLST from SOA_HOME/common/bin/wlst.sh

Example:

[oracle@soabpm-vm ~]$ cd /oracle/fmwhome/Oracle_SOA1/common/bin
[oracle@soabpm-vm bin]$ ./wlst.sh
wls:/offline>

 

2) Connect to the SOA server: connect('user', 'password', 't3://<soahost>:<soaport>')

Example: 

wls:/offline> connect('weblogic', 'welcome1', 't3://localhost:8001') 
 

3) Execute the command: deleteMetadata(application=’application-name', server=’soaserver-name’, docs=’absolutePath’)

Example (delete all files in '/apps/interfaces' as well as the files in its subdirectories): 
 
wls:/...> deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/interfaces/**') 
 

Note: With the command above all files in directory 'apps/interfaces' will be deleted. Please note the double asterisk (**) at the end of the this parameter. The asterisk (*) represents all documents under the current directory. The double asterisk (**) represents all documents under the current directory and also recursively includes all documents in subdirectories. Furthermore see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference for a detailed description of the valid arguments.

OPTION 4: Remove files from MDS using MBean Browser

You can call the command "deleteMetadata" also from the Enterprise Manager / MBean Browser.

1) Login to EM (http://host:port/em)
2) Expand SOA
3) Right-click on soa-infra
4) Select Administration -> MDS Configuration
5) Click Runtime MBean Browser
6) Click Operations tab
7) Click deleteMetadata operation
8) Provide parameters:
      docs - list of entries to remove (fully qualified path, eg: /apps/interfaces/**)
      restrictCustTo - default
      excludeAllCust - false
      excludeBaseDocs - false
      excludeExtendedMetadata - false
      cancelOnException - true
9) Click Invoke

Note: See the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference for a detailed description of the parameters.

OPTION 5: Purge Metadata Version History using Fusion Middleware Control

For database-based MDS, you can purge the metadata version history using the Fusion Middleware Control (Enterprise Manager). This operation purges the version history of unlabeled documents from the application's repository partition. The tip version (the latest version) is not purged, even if it is unlabeled.

1) Login to EM (http://host:port/em)
2) Expand SOA
3) Right-click on soa-infra
4) Select Administration -> MDS Configuration
5) Scroll to the “Purge” section: enter a value in the Purge all unlabeled past versions older than field and click on the Purge button
6) In the Confirmation dialog box, click Close

Note: For more details see the Oracle Fusion Middleware Administrators Guide. Section 14.3.11.2 also explains how to purge metadata version history using WLST.

How to view the MDS content

After you removed files and/or directories from the MDS you might want to have a look at the actual content. The easiest way to do this is to create a MDS connection in JDeveloper. For more details see the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite section "43.4.2.1 Create a SOA-MDS Connection".

Some additional information about the MDS


Monday, April 22, 2013

Industrial SOA

Today I’d like to point you to a new article series termed as "Industrial SOA" authored by the "Masons of SOA". The series is dedicated to the exploration of contemporary SOA topics and issues and highlights some of the more recent innovations in practice that will especially be of interest to those who want to learn some techniques that go beyond the academic essentials.
Abstract: “SOA and service-orientation have laid the foundation for a variety of emergent service technology innovations, while the original building blocks of SOA and service-orientation continue to evolve by embracing fundamental service technologies, concepts and practices. These new technology innovations do not replace service-orientation; they use it as their basis. Service-orientation continues to evolve towards a factory approach, towards industrializing integrated platforms, such as BI, master data management (MDM), mobile front-ends, BPM, adaptive processes, Big Data and Cloud Computing – all of which add architectural layers upon SOA-based infrastructure. All of these technologies can interface via standardized data and functions, published as service contracts, in order to avoid redundancy – that's service-orientation.”



The 14 part series begins with a preface by Oracle veteran Juergen Kress, and then moves on to the first of thirteen articles. The articles are & will be published on OTN and the Service Technology Magazine.

Send your feedback to @twitter/dschmied #industrialSOA.

Monday, April 1, 2013

New case management functionalities in Oracle BPM Suite 11.1.1.7

Today I’d like to highlight a nice feature of the newest Oracle BPM Suite Release. I am very happy that Oracle enriched the Suite with certain Case Management functionalities that fit into the existing Service Component Architecture (SCA). In the past month I already had the chance to play a bit with the beta software. With this post I’d like to share some of my experiences. 

Why Case Management?
Business Process Management becomes more and more important. With BPM Suite processes can be modeled, implemented, simulated and executed in a multi-user environment. There are also a lot of different reports available to monitor processes during runtime. We see in our projects, that this kind of automation is especially valuable for processes which are based on routine work. Some examples are “Hiring”, “Order-to-Cash”, “Order Management”, “Travel Request Management” and so on.

However - we also notice quite a high amount of processes, which are too complex and too flexible to model them in BPMN. We call it knowledge-intensive work. Of course if you have a lot of time you might be able to model almost everything but is it a benefit to have processes which are not readable anymore? How fast is your time-to-market? How easy is it to implement process changes? How can you support the job of the knowledge worker? Some typical domains with a high amount of knowledge-intensive work are Insurances, Banks, Healthcare, Civil Services and Government Agencies.

Let me try to explain the need of case management with our RYLC example. RYLC stands for “Rent your legacy car” and it was introduced in a series of articles as an overall solution example. The main target of RYLC was to explain concepts like service categories, loose coupling, canonical data model, service security and much more (see SOA Spezial magazine for details). The graphic below shows the complete End-to-End RYLC process in BPMN notation from receiving the request, selection of the car, checkout of the vehicle, returning it, creation of the invoice and cash clearance. I highlighted the checkin-part of the process, which covers the return of the car. It is based on an asynchronous message exchange pattern - the process execution stops until the checkin is completed or canceled. In this stage several things can happen.

BPMN Example - Rent your legacy car (RYLC)
The happy path of the process would be that everything goes well and the customer returns the car at the date that has been agreed during the reservation. The extension of the rental period can trigger other actions which are necessary to satisfy the customer. In worst-case the customer might have an accident or somebody steals the car.   

A lot of effort and time is necessary to bring all the mentioned varieties into the process. Examples like an accident will result in claim notifications and extended communication with the appropriate insurances. It is difficult to model each potential option. This is where Case Management comes into the game. It helps us to combine different milestones with the appropriate task actions, business rules, stakeholders, resulting events as well as data and documents (see the image below). During the car-checkin different milestones like “In Rental”, “Accident” (optional), “Stolen” (optional), “Returned” and “Approved” might occur. Each milestone consists of mandatory and optional task actions. Their execution order is defined by business rules. The task actions can be system driven (implemented as services) or user driven. Of course similar to BPMN some data and documents are exchanged in each step. Case Management is mainly controlled by the knowledge worker, which means that they affect the “flow” of the case. Therefore the definition of stakeholders and their permissions is another important aspect. Some example stakeholders in RYLC are the insurance holder, driver, car park assistant, front desk clerk and the rental manager. Based on the milestones and the task actions different events can occur that trigger new situations. Case management can support the knowledge worker with the right information (but the knowledge worker keeps the decision & process authority). Better and faster process decisions are the benefits of it.

Key aspects in Case Management
To conclude: Case Management covers complex and unstructured knowledge-intensive scenarios where modeling is too expensive and time consuming. It is non-deterministic, which means that the case flow is dynamically determined at run-time. The case participants choose actions to meet goals. It can be used to enrich existing processes (like in the RYLC example above) or as separate and independent solutions. 

How-to define a Case in Oracle BPM Suite?
In Oracle BPM Suite 11.1.1.7 the Case component is introduced as a first class artifact with support for milestones, events, adhoc activities stakeholders and so on. Like BPMN, BPEL, Human Task, Rules, etc. a Case can be created by just dropping it on the composite level. After completing the wizard a case component, a business rule component and an interface (exposed service) is visible (as illustrated in the image below).

Composite.xml with Case component
For now a composite can have only one Case component. Double-clicking on the case directs you to the definition of the component. Here you can define the milestones, case outcomes, data & documents, stakeholders & permissions, user events and translations. The image below shows how milestones and case outcomes can be defined.

Definition of a Case
Furthermore it is necessary to define and implement the case activities. I noticed two ways of creating them. Option 1 is to open the wizard under “New > BPM Tier” and select “Custom Case Activity”. Option 2 is to promote an existing component as a case activity. For the article I decided to go for option 2 – so I promoted the Human Task “Evaluate Claim Notification”. A case activity does have its own definition – a file with a *.caseactivity extension. You can find an example with some of the parameters available for customization on the bottom of the next screenshot.

Definition of a Case Activity
Additionally the business rule created along with the case component needs to be configured. It comes with a set of predefined functions (e.g. activateActivity, withdrawActivity, reachMilestone and revokeMilestone), Facts and Bucketsets (e.g. TEventType, TMilestoneEvent, etc.). The definition of rules is necessary to handle all the different situations of the case. Typical examples are ACTIVITY_EVENTS which trigger new activities or milestones, USER_DEFINED_EVENTS which have been specified in the case definition file or MILESTONE_EVENTS which trigger the appropriate case activities (see the screenshot below). There are many different options and I hope that some documentation material is going to be published soon.

Definition of a Case Rule
During runtime you can take advantage of the monitoring capabilities from the Enterprise Manager – as you might already know from BPMN or BPEL processes. How many case-instances have been started in which time frame?  Which milestones have been reached? Did there a fault occur? Which rules and which activities have been activated? The screenshot below shows the instance information of Oracle’s "EURent" Case Management example.

Monitoring of Case instances in EM
With the new Case Management functionalities BPM Suite confirms its outstanding position. I couldn’t wait to play with the software and I am really happy to demonstrate the new product capabilities to our customers. What I didn’t mention so far is the importance of user interfaces and tight integration with content management systems like WebCenter. So there is more to come :-)

Thursday, January 10, 2013

BPM Integration Days 2013 - das große Trainingsevent für BPM und Integration

Auch in diesem Jahr bieten die BPM Integration Days vom 28.02.2013 - 01.03.2013 wieder ein spannendes Programm für alle Teilnehmer, intensive Power Workshops / Sessions mit klarem Praxisbezug und Materialien in elektronischer Form zum bequemen Download. Natürlich ist auch für das leibliche Wohl gesorgt. In einer besonderen Wohlfühlatmosphäre wartet eine All-inclusive-Verpflegung mit Erfrischungen und Snacks in den Pausen, ein leckeres Mittagsbuffet sowie ein Come Together am Donnerstagabend mit Snacks und Freibier auf Sie - eine ideale Plattform für Erfahrungsaustausch und Networking mit Praktikern und erfahrenen Experten.


OPITZ CONSULTING ist auch wieder mit einigen Vorträgen vertreten. Besonders freue ich mich darauf, Ihnen - gemeinsam mit meinen Kollegen Sven Bernhardt und Benjamin Huskic - von den maritimen BPM-Abenteuern unserer Firmenkuh Robina Ruadh zu erzählen.


Misten Sie gemeinsam mit uns in "BPM abgegrast - eine Kuh geht auf Reisen" den Stall aus. Was ist bereits ausgeschlachtet? Was käuen wir gerne wieder? BPM, BI, Mobile, Cloud und ACM gehören ins Gepäck und machen die Reise zu einem unvergesslichen Erlebnis (inkl. Livedemo).      
   

Sunday, January 6, 2013

Connect to multiple SOA / BPM Virtual Machines from different computers in your network

Today I’d like to explain how to share instances of Oracle's Pre-built Virtual Machine for SOA Suite and BPM Suite across different computers in your network. Three requirements I had to address:
  1. Call of external services like GeoNames (http://www.geonames.org/postal-codes/) from within the BPM Suite VM
  2. Connection to multiple BPM Suite VMs from Host (e.g. JDeveloper and Browser)
  3. Connection to multiple BPM Suite VMs from different developer computers in the network 
  4. Share data between VMs and developer computers via FTP
The default options already support connections between host and client. However the target here was to address multiple independent VMs from different computers in the same network. The following settings worked in my environment:
 
1) Start the Oracle VM VirtualBox Manager and open network settings of the VM.
 
2) Select Bridged Adapter in “Attached to”. Bridged Networking is used when you want your vm to be a full network citizen, i.e. to be an equal to your host machine on the network (see Networking in VirtualBox for more details).
 
3) Select the name of your network adapter. Take into account that when you change your connection method (WIFI / Cable) a different network adapter is required. Get the appropriate name from the network settings of the host.
 
4) Specify the Adapter Type.
 
5) Start the VM.
 

6) Per default the VM receives the IP via DHCP method. Open a terminal window in the client and send the following command as root user to get the current IP address information of your VM. Instead of DHCP you could also change the connection method of your VM to a static address.

ifconfig <CONNECTION-NAME>  (e.g. ifconfig eth1) 


7) Another way to get the IP information is the network icon at the bottom of the Oracle VM VirtualBox window.

 
8) Connect or ping this IP address (here: 192.168.2.131) from the host or from a different computer in your network. I suggest adding the IP address to your etc/hosts-file in order to address the VM via names instead of a static IP addresses. If successful start the SOA / BPM Server and enjoy the remote development. If not please check your firewall and router settings. Good luck!