Wednesday May 28, 2014

Adding attachments to HumanTasks *beforehand*

For an demo I'm preparing along with a partner, we need to add some attachments to a HumanTask beforehand, that is, the attachment must be associated already to the Task by the time the user opens its Form. How to achieve this?, indeed it's quite simple and just a matter of some mappings to the Task's input execData structure.

Oracle BPM supports "default" attachments (which use BPM tables) or UCM-based ones. The way to insert attachments for both methods is pretty similar.

With default attachments

When using default attachments, first we need to have the attachment payload as part of the BPM process, that is, must be contained in a variable. Normally the attachment content is binary, so we'll need first to convert it to a base64-string (not covered on this blog entry).

What we need to do is just to map the following execData parameters as part of the input of the HumanTask:

execData.attachment[n].content            <-- the base64 payload data
execData.attachment[n].mimeType           <-- depends on your attachment
                                              (e.g.: "application/pdf")
execData.attachment[n].name               <-- attachment name (just the name you want to
                                              use. No need to be the original filename)
execData.attachment[n].attachmentScope    <-- BPM or TASK (depending on your needs)
execData.attachment[n].storageType        <-- TASK
execData.attachment[n].doesBelongToParent <-- false (not sure if this one is really
                                              needed, but it definitely doesn't hurt)
execData.attachment[n].updatedBy          <-- username who is attaching it
execData.attachment[n].updatedDate        <-- dateTime of when this attachment is

Bear in mind that the attachment structure is a repetitive one. So if you need to add more than one attachment, you'll need to use XSLT mapping. If not, the Assign mapper automatically adds [1] for the iteration. 

With UCM-based attachments

With UCM-based attachments, the procedure is basically the same. We'll need to map some extra fields and not to map others. The tricky part with UCM-based attachments is what we need to know beforehand about the attachment itself.

Of course, we don't need to have the payload, but a couple of information from the attachment that must be checked in already in UCM. First, let's see the mappings:

execData.attachment[n].mimeType           <-- Document's dFormat attribute (1)
execData.attachment[n].name               <-- attachment name (just the name you want to
                                              use. No need to be the original filename)
execData.attachment[n].attachmentScope    <-- BPM or TASK (depending on your needs)
execData.attachment[n].storageType        <-- UCM
execData.attachment[n].doesBelongToParent <-- false (not sure if this one is really
                                              needed, but it definitely doesn't hurt)
execData.attachment[n].updatedBy          <-- username who is attaching it
execData.attachment[n].updatedDate        <-- dateTime of when this attachment is
execData.attachment[n].uri                <-- "ecm://<dID>" where dID is document's dID
	                                      attribute (2)
execData.attachment[n].ucmDocType         <-- Document's dDocType attribute (3)
execData.attachment[n].securityGroup      <-- Document's dSecurityGroup attribute (4)
execData.attachment[n].revision           <-- Document's dRevisionID attribute (5)
execData.attachment[n].ucmMetadataItem[1].name  <-- "DocUrl"
execData.attachment[n].ucmMetadataItem[1].type  <-- STRING
execData.attachment[n].ucmMetadataItem[1].value <-- Document's url attribute (6) 

Where to get those (n) fields? In my case I get those from a Search call to UCM (not covered on this blog entry)

As I mentioned above, we must know which UCM document we're going to attach. We may know its ID, its name... whatever we need to uniquely identify it calling the IDC Search method. This method returns ALL the info we need to attach the different fields labeled with a number above. 

The only tricky one is (6). UCM Search service returns the url attribute as a context-root without hostname:port. E.g.:


However we do need to include the full qualified URL when mapping (6). Where to get the http://<hostname>:<port> value? Honestly, I have no clue. What I use to do is to use a BPM property that can always be modified at runtime if needed.

There are some other fields that might be needed in the execData.attachment structure, like account (if UCM's is using Accounts). But for demos I've never needed to use them, so I'm not sure whether it's necessary or not. Feel free to add some comments to this entry if you know it ;-) 

That's all folks. Should you need help with the UCM Search service, let me know and I can write a quick entry on that topic.

Wednesday Apr 23, 2014

Oracle BPM Goes Mobile!

Announcing Oracle BPM Workspace iPad Application

The Oracle Business Process Management (BPM) Workspace mobile application is now available for download on iTunes.

This application enables you to access and act on BPM tasks on your mobile device. You can approve, reject, assign and delegate tasks, perform bulk operations, view and edit task details, and add comments and attachments. You can add attachments from your device or use its built in camera to take a photo and attach it to a task.

The ability to continue to work offline is supported for when your device is disconnected. Task updates are automatically synchronized with the server as soon as it becomes available.

This application is available for BPM Customers/Partners who are on release onwards.

A demonstration video for this application is available on youtube.

Sunday Mar 09, 2014

Building custom audit trails for human workflow monitoring

Business Process Management applications usually have a lot of human interaction steps. Whenever somebody does something most probably ou there is another person who will need to be informed about this. As a result, the need of delivering customized and comprehensive control tools would always be an important requirement for somebody using BPM.

This article will explain in a few simple steps how you can create you own audit trail which delivers data about all the human interactions inside your BPM process. The main mechanism used is the business events callbacks made available by the human workflow component inside the SOA infrastructure.

[Read More]

Friday Feb 14, 2014

Managing BPM Roles through API

Oracle BPM 11g works with Application Roles as part of the possible assignees that can be used for the Human Tasks. The Application stripe used is OracleBPMProcessRolesApp, deployed by default along with the product.

There are at least two ways to manage those Application Roles (from now on, "BPM Roles") and the membership of each one. The most common one is through Oracle BPM Workspace application. An administrator user (e.g. weblogic) can click on the "Administration" task and then go to the "Roles" Administration Area.

You can also use the Fusion Middleware Control for managing the BPM Roles and membership. Again, as an admin user, open the "Applications Deployments" folder, search for the OracleBPMProcessRolesApp application, right click on it and go to "Security/Application Roles" menu. From there, click the "run" icon to perform the search. You can now create or edit an existing role.

These two methods are OK when you want a UI and need to perform just a few changes on the roles. However it's not very friendly when you need to do some bulk operations. Also, if you need to backup the existing BPM Roles setup or to restore it, or do a "test-2-production" operation, these consoles are useless.

There is a "test-2-production" ant script provided by Oracle SOA/BPM Suites named ant-t2p-worklist.xml and can be located under the $SOA_HOME/bin folder. Such script is well documented here. However I don't see that such script manages the "BPM Roles". 

Of course, Oracle BPM provides a full Java API to manage all these artifacts. The main interface to use is IBPMOrganizationService that is fully documented here.

Recently I had the need to replicate an environment and I didn't want to lose all the BPM Roles and membership. So after double checking my alternatives, I decided to go with the API alternative.

I then found a very interesting sample posted by David Read from Oracle Product Management organization, one of the best gurus you can find for Oracle BPM :-)

Based on that code I wrote a simple Java class to perform the following operations with the BPM Roles:

  • Export and Import the current BPM Roles organization to/from a single XML file
  • Delete one or multiple BPM Roles at once
  • Delete ALL existing BPM Roles (but the readonly one BPMProcessAdmin)

I have uploaded the complete source code and compiled JAR file to site. You can download it from here.

The ZIP file contains also a sample .sh file to execute the class, including the CLASSPATH needed to run it.

It's been developed and tested with Oracle BPM (PS6 release), although it should work with previous and future 11g releases.

From an API point of view, these are the key methods to use:

- Get connected to the server and obtain the context (connection details and credentials are previously set in a separate method):

BPMServiceClientFactory factory = getBpmServiceClientFactory();
IBPMServiceClient bpmSvcClient = factory.getBPMServiceClient();
IBPMOrganizationService bpmOrgSvc = bpmSvcClient.getBPMOrganizationService();
IBPMContext bpmCtx = (IBPMContext)factory.getWorkflowServiceClient().getTaskQueryService().authenticate(null, null, null);

- Export or Import the whole BPM organization (which includes Calendars, Roles, Organizational Units, etc):

Organization o = bpmOrgSvc.exportOrganization(bpmCtx); 

- I'm just interested in the Application Roles and their members:

ApplicationRoles ar = o.getApplicationRoles();
List<ApplicationRoleType> roleList = ar.getApplicationRole();
for (ApplicationRoleType role : roleList) {
    List<PrincipleRefType> memberList = role.getMember();
    for ( PrincipleRefType member : memberList) {

- The main operations: Create, Remove and Add or Remove members to them:

ApplicationContext appContext = new ApplicationContext();
bpmOrgSvc.createAppRole(bpmCtx, appContext, "MyRole", null, null);
AppRoleRefType r = new AppRoleRefType(); 
r.setType(ParticipantTypeEnum.USER); // For example, a participant of type USER
r.setName("jcooper"); // Our beloved James Cooper ;-) (warning, user/group/role must exist. If not you'll get an exception)
bpmOrgSvc.grantAppRoleToPrincipal(bpmCtx, appContext, "MyRole", new Participant(r));
bpmOrgSvc.removeAppRole(bpmCtx, appContext, "MyRole", true); // "true" to force the deletion

The export/import XML file used is based on an XSD contained in the JAR file. Feel free to unzip it and have a look. The JAR file also contains a sample XML file for import testing.

BTW, do not expect a good Java code. But it seems to work at least! :-)

Tuesday Jul 02, 2013

Navigational Flows in Web Forms

Navigation flows in the Web UI is a common requirement. In we do not have out of the box support for navigational flows but this is surely on our road-map.Until then this simple approach might meet some of the requirements. In this sample we use a trigger control and Web Form rules show navigation flow for Customer, Orders and Line Items.

Start by creating  a new Web Form and adding 3 tabs as Customer,Order,Line Items.Add the elements to each tab.

Change the visibility for Order and Line Items to false

Tab1 : Customer

Tab 2 : Order

Tab 3 : Line Item

N    Notice we have added trigger controls for Next & Back Buttons.

       Now write form rules to change the visibility and selection of tabs based on the clicks of trigger

You can now navigate through the forms using the trigger control.


So Solution to this sample can be downloaded from here.

Reusing Web Forms across BPM Roles

Recently Varsha(another BPM Product Manager) approached me with a requirement where she wanted to reuse same Web Form for different task activity.We both knew this is easily achievable.The human task outcomes can differ to distinguish the submission based on roles.Her requirement was slightly more than this, she wanted to hide some data based on the logged in user. If you have worked on Web Form rules, dynamically showing and hiding data is common requirement and easily achievable using Form Rules. In this case the challenge was accessing BPM role inside the Web Form. Although, will be addressing this requirement in future release she wanted a immediate solution(Aha, after all customers are not the only one's who can not wait). Thankfully we managed to come-up with a solution and I hope this will be helpful to larger audience.

Solution has 3 steps :

Step 1: We added a hidden attribute in our form (Role). The purpose of this attribute is just to store the current logged in user's role and we pass the value during data association.

Step 2 : In your data association step, pass the role value based on the Swimlane

Step 3 : Now use this hidden attribute value in your Web Form rule for dynamic behavior

Detailed steps and sample can be downloaded from

Friday May 17, 2013

Customizing the look and feel of BPM Applications

One of the very common requirement for BPM customers is to have their corporate look and feel for BPM workspace. This requirement would usually extend to Human Task UI's too.

In PS4FP release we had added a lot of enhancement to the Workspace Customization at run-time. BPM user can not only change the branding logo , tittle etc but also the overall look of the workspace and task UI using ADF skin.

You can either select any one of the OOTB skins or create a custom skin.

If  you have custom CSS requirements you can create your own custom skin and apply it to Workspace. In either case the workspace skin gets automatically inherited by your ADF application.

In we have introduced an alternate UI technology, Web Forms. Adding a Skin(theme) or Custom CSS to Web Forms is slightly different. Your custom ADF  skin will not be automatically inherited by Web Forms. However you can follow this Sample to add custom CSS for Web Form.

In general Web Form allow CSS are different levels,

You can add them for a specific control(inline) using the properties->style tab. The top commonly used styles are exposed by the tool for an easy intuitive style change. Any change here is applicable only to that form control.

You can specify a theme(skin) for entire page. Click on the Form,select Properties->Style->Theme. The theme selected will be applied to entire form unless overridden at control level

Example : Professional Blue Theme

You can apply Theme at applications level, this is the theme you select in your BPM workspace (preferences) and will be applied to all forms unless overridden using above 2 options.

Please refer our  BPM Customization sample for details on creating and applying custom theme for Web Forms.

Note :  The sample project zip  has the .css files that can be updated(SampleSkin\SharedLib\custom.client.applib.jar\themes\\)

Wednesday May 15, 2013

Enabling logging for Web Forms

If you want to enable the logging for Web Forms you will have to change the logger level using the server configuration. In PS6 this property is not exposed through EM but can be manually updated using logging.xml.


Open your servers logging.xml

Location :  DOMAIN_HOME/config/fmwconfig/servers/server_name/

Update the logger level  for the following:

<logger name='com.frevvo' useParentHandlers='true'/>
<logger name='com.gauss' useParentHandlers='true'/>
<logger name='com.frevvo.forms' useParentHandlers='true'/>
<logger name='com.frevvo.forms.rule' useParentHandlers='true'/>

Please refer the Fusion Middleware Administrator's Guide for more details on logging in general.

Monday May 13, 2013

Introduction to Web Forms -Basic Tutorial

If you are new to Oracle Web Forms and would like a quick overview and hand-on then please try out this Sample.

These step-by-step instructions guide you through common tasks for Form creation and provide background concepts and information to help you understand what you are accomplishing in the steps.

By the end of this exercise you will be able to
  1. Create new Web Form   
  2. Design the Web Form (Add elements, set properties and style)  
  3. Change the Web Form Layout(Add panels and repeat)  
  4. Adding Dynamic Behavior to the Web form using form rules(validations, show/hide and invoke REST service

Sample(Steps and Solution) :

Monday Apr 22, 2013

Debugging: Oracle Web Form does not render(Desigtime/Runtime)

Debugging tips on Creating Web Forms not rendering

  • Use a fully qualified URL to access composer, example : over adc2100931:7001/bpm/composer

There is a known bug due to which you will get a error, when creating web forms.

  • If you are already doing that, ensure that your host file entry points to fully qualified url

    File : /etc/hosts

    Example :

  • Ensure that your WLS configured with correct(reachable)  listener address and frontend host.

    Frontend Host Setting

Listener Address Setting

Thursday Apr 04, 2013

Oracle BPM Web Forms

Yesterday Oracle announced public availability of  the highly anticipated BPM release. It's clearly a very exciting release for the entire BPM team.

I joined this team over a year ago to manage the BPM UI technologies (Browser application, Web 2.0, Mobile etc). A PM with specific goal of User Experience(UE) was in itself a clear indicator of our focus on end user experience and BPM UI development tooling.

Designing human task user interface is critical piece of BPM process definition more so since end users are now getting more and more UI aware enforcing Business involvement in UI definition.One of our primary goal on this front was to enable Business User to not only get involved in Process and UI modeling but its implementation as well.  BPM announced a huge step towards this goal through its Web Forms feature.

Oracle Form Designer is a browser based simple drag-and-drop tool for business users to quickly model and implement rich interactive forms for their end users. This tool is a part of BPM composer.

Some of the highlights of Oracle Web Forms 

Developmental Approach

Web Forms Support two developmental approaches

Form First , where Business user wants to start with Form designing. In this case the Schema definition will get automatically created and associated with the Human Task.

Data First, Where the Data Structure of your Task is predefined and elements can now be dragged and dropped into the Form Canvas.

Designing Web Forms

You can start designing your forms by dragging and dropping standard HTML components like text, drop-down, radio etc or pre-formatted controls like money, phone email etc.  from the controls palette.Data can also be grouped using table component for displaying data in grid format or repeat control for sub form style of presentation. Once elements are dropped Layout control can be used for arranging these controls and optimizing the browser real-estate.

 Control can be individually styled using the style properties for that control. The top commonly used css are exposed using the designer. The overall theme/skin for Web Form will be inherited from the workspace.

Form Rules

One of the important feature of  this tool is to design interactive forms. Oracle Web Forms supports this via Java Script. Web Forms have an inbuilt JS editor that allows form designer to write rules that get triggered on form events. These rules can be effectively used to show/hide or enable/disable sections, controls or data. Other examples of Form rules are calculation and manipulation.

Web Forms can be integrated with external system using  REST Service.Once a  form is designed it can be tested , deployed and internationalized within the BPM composer.Lifecycle of Web Form is tied to that of a Composite and it will get bundled and deployed as a part of composite.

Support for Human Task metadata and UCM integration in Web Forms

The key architectural concept is that  at run time Web Forms are embedded inside an outer ADF UI. This ADF UI gets dynamically generated for the human task based on the task definition. So support for UCM attachment, task outcomes and task metadata will be honored as before. These forms can also be rendered inside Webcenter Process Spaces.

In summary Oracle Web Forms will now enable BPM modeller to not only model processes but implement them including its user interfaces.

Thursday Jan 03, 2013

Oracle BPM 11g Exception Handling

This post describes the Exception Handling mechanism provided by BPMN and the main scenarios that can be modeled with each of the corresponding BPMN components: 

  1. Event Subprocess
  2. Boundary Events attached to a Subprocess
  3. Boundary Events attached to an Activity

It is not in the scope to describe the Fault Management Framework provided by the underlying SOA Suite, but only the BPMN components.

[Read More]

Searching BPM tasks by payload content: Flex Fields (Mapped Attributes)

Currently in Oracle BPM version 11gR1, the Workflow Services Java API does not allow to perform searches of BPM tasks by its payload content. This post describes the procesdure to enable this by using Flex Fields.

[Read More]

Thursday Apr 12, 2012

List all BPM Processes for a user


Happy to start contributing to this blog.. 

The title of the blog is probably deceptively simple and warrants an elaboration.

Customized BPM workspaces/user interfaces are a fairly common requirement. One of our marquee customers in the online stock trading business, envisioned this user interaction for their BPM application:

  1. User logs in to the internal portal
  2. Use will have list of roles which he is granted as a drop down list
  3. Once user selects the role, a list of processes which user is part of appear. Logged in user can be part of any swimlane role of the process
This can be a fairly common/reasonable user-UI interaction pattern. 1. and 2. are easily achievable and hence the subject matter of this blog is the requirement in 3.
Objective: Given a username and a role, list all the BPM processes that the user is part of, in any swimlane of any process.
Here is quick overview of the major steps/logic in the code:

  1. Intialize workflow/BPM  context as usual
  2. Get a handle on InstanceQueryService(getInstanceQueryService), InstanceManagementService,        ProcessMetadataService and ProcessModelService
  3. List all Processes for that bpmcontext (listProcessMetadataSumary) and get Granted roles to that user
  4. For each of the processes [method  getAccessibleProcesss(ProcessMetadataSummary, Set)]for each of the lanes in the process, check if the role granted to the user, matches the roleName for that swimlane. If so, add to output.


  • The usual caveats apply including BPM APIs are subject to change.
  •  JDeveloper method introspection is your better friend than API documentation :-)...

(I am going to try upload the source code  and if it doesnt work, will follow this blog up with the corresponding source code.)

Hope this helps. 

Ack: Yogesh K, BPM Dev team.

Editing the blog to include source code from

Monday Apr 02, 2012

Handling HumanTask attachments in Oracle BPM 11g PS4FP+ (II)

Retrieving uploaded attachments -UCM-

As stated in my previous blog entry, Oracle BPM 11g (aka PS4FP) introduced a new cool feature whereby you can use Oracle WebCenter Content (previously known as Oracle UCM) as the repository for the human task attached documents. For more information about how to use or enable this feature, have a look here.

The attachment scope (either TASK or PROCESS) also applies to UCM-attachments. But even with this other feature, one question might arise when using UCM attachments. How can I get them from within the process?

The first answer would be to use the same getTaskAttachmentContents() XPath function already explained in my previous blog entry. In fact, that's the way it should be. But in Oracle BPM 11g (PS4FP) and (PS5) there's a bug that prevents you to do that. If you invoke such function against a UCM-attachment, you'll get a null content response (bug#13907552). Even if the attachment was correctly uploaded.

While this bug gets fixed, next I will show a workaround that lets me to retrieve the UCM-attached documents from within a BPM process. Besides, the sample will show how to interact with WCC API from within a BPM process.

Aside note: I suggest you to read my previous blog entry about Human Task attachments where I briefly describe some concepts that are used next, such as the execData/attachment[] structure.

Sample Process

I will be using the following sample process:

A dummy UserTask using "HumanTask2" Human Task, followed by an Embedded Subprocess that will retrieve the attachments payload. In this case, and here's the key point of the sample, we will retrieve such payload using WebCenter Content WebService API (IDC):

and once retrieved, we will write each of them back to a file in the server using a File Adapter service:

In detail:

  •  We will use the same attachmentCollection XSD structure and same BusinessObject definition as in the previous blog entry. However we create a separate variable, named attachmentUCM, based on such BusinessObject.
  • We will still need to keep a copy of the HumanTask output's execData structure. Therefore we need to create a new variable of type TaskExecutionData (different one than the other used for non-UCM attachments):

  • As in the non-UCM attachments flow, in the output tab of the UserTask mapping, we'll keep a copy of the execData structure:

  • Now we get into the embedded subprocess that will retrieve the attachments' payload. First, and using an XSLT transformation, we feed the attachmentUCM variable with the following information:
    • The name of each attachment (from execData/attachment/name element)
    • The WebCenter Content ID of the uploaded attachment. This info is stored in execData/attachment/URI element with the format ecm://<id>. As we just want the numeric <id>, we need to get rid of the protocol prefix ("ecm://"). We do so with some XPath functions as detailed below:

with these two functions being invoked, respectively:

    • We, again, set the target payload element with an empty string, to get the <payload></payload> tag created.
The complete XSLT transformation is shown below. Remember that we're using the XSLT for-each node to create as many target structures as necessary. 

  • Once we have fed the attachmentsUCM structure and so it now contains the name of each of the attachments along with each WCC unique id (dID), it is time to iterate through it and get the payload. Therefore we will use a new embedded subprocess of type MultiInstance, that will iterate over the attachmentsUCM/attachment[] element:

  • In each iteration we will use a Service activity that invokes WCC API through a WebService. Follow these steps to create and configure the Partner Link needed:
    • Login to WCC console with an administrator user (i.e. weblogic). Go to Administration menu and click on "Soap Wsdls" link. We will use the GetFile service to retrieve a file based on its dID. Thus we'll need such service WSDL definition that can be downloaded by clicking the GetFile link. Save the WSDL file in your JDev project folder.

    • In the BPM project's composite view, drag & drop a WebService adapter to create a new External Reference, based on the just added GetFile.wsdl. Name it UCM_GetFile.
    • WCC services are secured through basic HTTP authentication. Therefore we need to enable the just created reference for that:
      • Right-click the reference and click on Configure WS Policies.
      • Under the Security section, click "+" to add the "oracle/wss_username_token_client_policy" policy

    • The last step is to set the credentials for the security policy. For the sample we will use the admin user for WCC (weblogic/welcome1). Open the composite.xml file and select the Source view.
    • Search for the UCM_GetFile entry and add the following highlighted elements into it:
  <reference name="UCM_GetFile" ui:wsdlLocation="GetFile.wsdl">
    <interface.wsdl interface=""/>
    < port=""
                location="GetFile.wsdl" soapVersion="1.1">
      <wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
                           orawsp:category="security" orawsp:status="enabled"/>
      <property name="weblogic.wsee.wsat.transaction.flowOption"
                type="xs:string" many="false">WSDLDriven</property>
      <property name="oracle.webservices.auth.username"
      <property name="oracle.webservices.auth.password"
    • Now the new external reference is ready:

  • Once the reference has just been created, we should be able now to use it from our BPM process. However we find here a problem. The WCC GetFile service operation that we will use, GetFileByID, accepts as input a structure similar to this one, where all element tags are optional:
<get:GetFileByID xmlns:get="">

and we need to fill up just the <get:dID> tag element. Due to some kind of restriction or bug on WCC, the rest of the tag elements must NOT be sent, not even empty (i.e.: <get:rendition></get:rendition> or <get:rendition/>). A sample request that performs the query just by the dID, must be in the following format:

<get:GetFileByID xmlns:get="">

The issue here is that the simple mapping in BPM does create empty tags being a sample result as follows:

<get:GetFileByID xmlns:get="">

Although the above structure is perfectly valid, it is not accepted by WCC. Therefore, we need to bypass the problem. The workaround we use (many others are available) is to add a Mediator component between the BPM process and the Service that simply copies the input structure from BPM but getting rid of the empty tags. Follow these steps to configure the Mediator:

    • Drag & drop a new Mediator component into the composite.
    • Uncheck the creation of the SOAP bindings and use the Interface Definition from WSDL template and select the existing GetFile.wsdl

    • Double click in the mediator to edit it. Add a static routing rule to the GetFileByID operation, of type Service and select References/UCM_GetFile/GetFileByID target service:

    • Create the request and reply XSLT mappers:

Make sure you map only the dID element in the request:

And do an Auto-mapper for the whole response:

  • Finally, we can now add and configure the Service activity in the BPM process. Drag & drop it to the embedded subprocess and select the NormalizedGetFile service and getFileByID operation:

  • Map both the input:

  • ...and the output:

  • Once this embedded subprocess ends, we will have all attachments (name + payload) in the attachmentsUCM variable, which is the main goal of this sample. But in order to test everything runs fine, we finish the sample writing each attachment to a file. To that end we include a final embedded subprocess to concurrently iterate through each attachmentsUCM/attachment[] element:

  • On each iteration we will use a Service activity that invokes a File Adapter write service. In here we have two important parameters to set. First, the payload itself. The file adapter awaits binary data in base64 format (string). We have to map it using XPath (Simple mapping doesn't recognize a String as a base64-binary valid target):

Second, we must set the target filename using the Service Properties dialog box:

Again, note how we're making use of the loopCounter index variable to get the right element within the embedded subprocess iteration.

Final blog entry about attachments will handle how to inject documents to Human Tasks from the BPM process and how to share attachments between different User Tasks. Will come soon.

Again, once I finish will all posts on this matter, I will upload the whole sample project to


Technical and in-depth articles and samples on BPM 11g.


« July 2016