Using a customer relationship management (CRM) example, this article series shows you how to create a composite business application (CBA) in Business Space powered by WebSphere, enhance it in Business Modeler, and finally implement it in Integration Developer and WebSphere Business Services Fabric Composition Studio. In Part 1, you learned how a business user creates vocabulary, business concepts and other artifacts in Business Space. In Part 2, we'll cover modeling, which is typically performed by a business user who defines the content of the business variations, and the implementation aspect of CBA development, which is usually performed by an IT person.
To build and run the scenario in this article, you must have the following products installed:
- WebSphere Business Modeler V6.2 (hereafter called Modeler)
- WebSphere Integration Developer V6.2 (hereafter called Integration Developer)
- WebSphere Business Services Fabric Tool Pack V6.2
- WebSphere Business Services Fabric V6.2 (hereafter called Fabric)
- Lotus Forms Viewer 3.5.1
In this section, we'll set up the environment so you can use the artifacts created in Part 1 to continue the CBA development lifecycle.
If you have completed Part 1, follow these steps to import the vocabulary namespace into the CreateProfileApplication project.
- Open the Fabric administrative console (for example,
http://myserver:9080/fabric). - Select Governance Manager => Configure Projects.
- Switch to the Namespace tab.
- In the Imported Namespaces section, click Import Namespaces.
- Select Fabric Business Glossary as the project, and check CRMVocab.
- Click Import namespaces. The Imported Namespaces
section should now have the five namespaces shown in Figure 1.
Figure 1. Imported namespaces
If Part 2 is your starting point, follow these steps to import the artifact to the Fabric server, or refer to Part 1 to create the artifacts from scratch.
- Open the Fabric administrative console (for example,
http://myserver:9080/fabric). - Select Governance Manager => Import / Export.
- Switch to the Import tab.
- Import the following 4 zip files (included in the
Download section, in sequence:
- FabricBusinessGlossary-owl.zip
- CreateCustomerProfile-owl.zip
- InformCustomer-owl.zip
- CreateProfileApplication-owl.zip
- To verify that the import was successful, from the Fabric administrative console, select Governance Manager => Configure Projects. You should see the three added projects and additional items in the Fabric Business Glossary project.
In Part 1, we created a business space for the artifacts; however, you don't need to create this space for this part.
As described in Part 1, we created and governed the CBA example using Business Space. As a result, all artifacts we've created are stored in the Fabric repository. In order to refine the CBA at the business level, you'll need to import the artifacts into Modeler and add business level details for the service variations. Once the service variations have been defined, you can export the refined CBA model to Integration Developer and the Fabric Composition Studio for implementation at the technical level.
To import the artifacts into Modeler, do the following:
- Select File => Import => WebSphere Business Modeler => WebSphere Business Modeler Import, and click Next.
- Select WebSphere Business Services Fabric Repository elements.
- Click Add Repository, as shown in Figure 2.
Figure 2. Select repository elements to import
- Enter the URL of the repository in the form of
http://<server name>:<port number>, as shown in Figure 3. For example, http://myserver:9080. Use the same URL as the Fabric administrative console URL. Then click Finish.
Figure 3. Specify repository location
- Under Repository content, check CRMAuthorSpace, as
shown in Figure 4.
Figure 4. Check CRMAuthorSpace
- Click Finish.
You've now created four projects in Modeler. You can see these in the Project Tree view, shown in Figure 5. The project structure is determined by the tool; it's considered a good practice to separate business objects from the business processes that use them.
Figure 5. New projects in the project tree
Let’s examine the new projects. The CRMVocab project contains the business items, which correspond to the business concepts created in Business Space in Part 1.
The Create Customer Profile and Inform Customer projects correspond to the two business services created.
The Create Customer Profile project contains the business service Create Customer Profile, and two variations as empty processes, as shown in Figure 6. The Inform Customer project is similar.
Figure 6. Create Customer Profile project
The CreateProfileApplication project contains the main business process, shown in Figure 7.
Figure 7. CreateProfileApplication project
As mentioned earlier, the business variations (dealing with regular and preferred customers) are represented by processes in Modeler.
We're going to model the process for creating customer profiles for both
regular and preferred customers. Modeler provides a comprehensive set of
elements, such as human tasks and business rule tasks, that business users
can use to construct a process. For simplicity, in this example we'll add
human tasks to the business processes. In the Create Customer Profile
project, the RegularCustomer_forCreate business
process looks like Figure 8.
Figure 8. RegularCustomer_forCreate process
Figure 9 shows the PreferredCustomer_forCreate
process.
Figure 9. PreferredCustomer_forCreate
Similarly, in the Inform Customer project, we'll add a human task to the
InformRegularCustomerHT,
InformPreferredCustomerHT for
RegularCustomer_forInform, and
PreferredCustomer_forInform processes,
respectively, as shown in Figures 10 and 11.
Figure 10. RegularCustomer_forInform
Figure 11. PreferredCustomer_forInform
Import the artifacts into Integration Developer
Next you need to export the artifacts from Modeler and import them into Integration Developer.
- Right-click CreateProfileApplication, then select WebSphere
Integration Developer, as shown in Figure 12, and click
Next.
Figure 12. Export to Integration Developer
- In the export details page, select Module + Library as the
export option, as shown in Figure 13. The processes in the Modeler
projects have only human tasks, therefore, you don't need to separate
business logic from implementation details. However, it's always a
good practice to separate the commonly used objects, such as business
items and interfaces, from artifacts. This is why we're using this
export option.
Figure 13. Specify export details
- You'll see the following warnings, which you can ignore. These
warnings indicate that those processes contain Fabric artifacts that
must be further implemented using the Fabric Toolpack.
TEN20010W: The element "Inform Customer" uses the Dynamic Assembler implementation type, which is supported only in WebSphere Business Services Fabric. TEN20010W: The element "Create Customer Profile" uses the Dynamic Assembler implementation type, which is supported only in WebSphere Business Services Fabric.
- To import the files into Integration Developer, from Integration
Developer and select File => Import => Other
=> Project Interchange, and click Next. You
should see the projects in the project interchange file, as shown in
Figure 14.
Figure 14. Import project interchange into Integration Developer
In this section, you'll learn how to map the higher level business services, which were created in Business Space in Part 1, to the actual services that are implemented in Integration Developer. The tasks include configuring the endpoints for different variations and creating context specifications, which specify the context necessary to make a dynamic assembly decision at runtime.
First, create a Fabric project to pull in the vocabulary, business service, and other information from the Fabric repository. To do this, complete the following steps:
- Switch to the Business Service perspective
- Select Preferences => Business Service Fabric => Repository Configuration.
- Specify configuration details as shown in Figure 15, and click
>Test Connection to make sure the repository
connection is configured properly.
Figure 15. Configure business services repository
- Create a new Fabric project by selecting File => New => Project => Business Service Fabric => Fabric Project.
- Specify
CreateCustomerProfileProjectas the name of the project, and click Next. - Select CreateProfileApplication as the Fabric project, as
shown in Figure 16. This is the project created in
Part
1.
Then click Finish
Figure 16. Create new Fabric project
You should see the following in the Business Service Explorer:
Figure 17. Business Service Explorer
Create two composite services: Create Customer Profile and Inform Customer. A composite service is a unit of work accomplished by an interaction between components. Upon creation of the service, the interface and endpoints for calling this composite service are created.
In the Business Application explorer view, right-click Composite Service and select New => Composite Service. Specify the following information for both services:
| Project | Namespace | SCA Project |
| CreateCustomerProfileProject | CreateProfileApplication (Technical) | CreateCustomerProfile |
| CreateCustomerProfileProject | CreateProfileApplication (Technical) | InformCustomer |
You should see the following in the Business Service Explorer:
Figure 18. New composite services
When creating the composite service, the Fabric Toolpack considers all
exports of an SCA module as potential endpoints. However, only a subset of
those exports are the true endpoints that you need. Therefore, you can
safely delete both
processes/createcustomerprofile/CreateCustomerProfile
and processes/informcustomer/InformCustomer, as
they're not required in this scenario
Next, you need to configure the endpoints for the corresponding business
variations. To configure the endpoint for
processes/preferredcustomer_forcreate/PreferredCustomer_forCreate,
do the following:
- In the Business Application Explorer, expand the Endpoint category and double-click processes/preferredcustomer_forcreate/PreferredCustomer_forCreate.
- In the endpoint editor, switch to the Assertion tab.
- Click Add and select Process Variation Assertion.
- Specify the values shown in Figure 19.
Figure 19. Specify properties for process variation assertion
- Repeat these steps for each of the other endpoints.
Map composite services to the business services
Map the composite services (CreateCustomerProfile and InformCustomer) to the business services by completing the following steps:
- In the Business Application Explorer, double-click
CreateCustomerProfile, as shown in Figure 20.
Figure 20. Select CreateCustomerProfile
- Check Maps to a Business Application Module, as shown in Figure 21.
- For Business Application, select CreateProfileApplication.
- In the Business Service Mapping section, select Create
Customer Profile for Business Service.
Figure 21. Specify composite service details
- In the Channel mapping section, selectEmail for
PreferredCustomer_forCreate Export and
RegularCustomer_forCreate Export, as shown in Figure 22.
We're using email as the channel in this example.
Figure 22. Select email as channel
- Repeat these steps for the InformCustomer composite service.
Create the context specification
Create two context specifications by doing the following:
- In the Business Application Explorer, right-click Context
Specification and select New => Context
Specification to create two context specifications with the
properties shown in the following table.
Project Name Namespace CreateCustomerProfileProject Create Customer Profile Context CreateProfileApplication (Technical) CreateCustomerProfileProject Inform Customer Context CreateProfileApplication (Technical)
- Since we'll determine whether a customer is preferred or regular based on the annual fee, you need to add a vocabulary dimension of Annual Fee for both context specifications. To do this, expand Context Specification in the project tree and double-click Create Customer Profile Context to open the context specification editor.
- Click Add and select Annual Fee, as shown in Figure 23.
Figure 23. Requires a heading
- Repeat steps 2 and 3 for the Inform Customer Context context specification.
Publish the changes to the server
The final step in Composition Studio is to publish the changes to the server.
- Switch to the Repository Changes view, as shown in Figure 24.
Figure 24. Switch to Repository Changes view
- Right-click CreateCustomerProfileProject, and select Submit Change Set.
- Select Add All to submit all the changes, then click Finish.
Create context extractor in Integration Developer
Next you need to create a context extractor. A context is an object created for a service request in the business service model. The object contains information such as business process, organization, role and channel. The context extractor is needed so that the dynamic assembler component knows which context to look at when the service call arrives. Make sure the Business Integration perspective is open.
To create the context extractor, complete the following steps In the CreateCustomerProfile module:
- Right-click on WBSF server runtime library, and select Properties => Java Build Path.
- Select Server Runtime, as shown in Figure 25.
Figure 25. Select library to add
- Select WebSphere Business Services Fabric 6.2.
- Double-click CreateCustomerProfile to open the assembly editor.
- Right-click CreateCustomerProfile, then select Add => Reference.
- In the Add Reference dialog, select Show Java, then select the ContextExtractor interface from the com.ibm.websphere.fabric.da.plugin package.
- Create a Java™ component called
CreateCustomerProfileContextExtractor and connect it with
the CreateCustomerProfile component, as shown in Figure 26.
Figure 26. Connect components
- Right-click CreateCustomerProfileContextExtractor to generate the implementation.
- In the Java editor, go to the
extractContext(PendingRequest)method. - Copy and paste the following code snippet into the method:
// extract annual fee from the request and put it into the context final String ANNUAL_FEE = "fc://business/floatconcept#ue22c2689-6b47-40fb-bd22-c05eeb7d3ca5"; Context context = arg0.getContext(); DataObject body = arg0.getFirstBodyElement(); System.out.println(body); String annualFeePath = "//annualfee"; XPathSearchResult<String> annualFee = SdoXPathUtil.getViaXpath(body, annualFeePath); if(annualFee != null){ context.setSelectionProperty(ANNUAL_FEE, new TypedValue(annualFee.getValue())); } return context;
- The value of
annualFeeis the URI of the AnnualFee concept. To look up this value, go to the Assertion Explorer expand the Business Vocabulary folder, and double-click AnnualFee, as shown in Figure 27.
Figure 27. Open AnnualFee
- Click the copy URI icon next to the ID field, as shown in
Figure 28, then paste the URI it to the Java editor. The URL should
look something like this:
fc://business/floatconcept#ue22c2689-6b47-40fb-bd22-c05eeb7d3ca5
Figure 28. Copy URI
- Repeat these steps to implement the context extractor for
InformCustomer, subsituting the following code snippet for the Java
implementation:
final String IS_PREFERRED_CUSTOMER = "fc://business/booleanconcept#u94690d6a-36c4-44a8-81ae-4b375e32dce1"; Context context = arg0.getContext(); DataObject body = arg0.getFirstBodyElement(); System.out.println(body); String isPreferredCustomerPath = "//isPreferredCustomer"; XPathSearchResult<String> isPreferredCustomer = SdoXPathUtil.getViaXpath(body, isPreferredCustomerPath); if(isPreferredCustomer != null){ context.setSelectionProperty(IS_PREFERRED_CUSTOMER, new TypedValue(isPreferredCustomer.getValue())); } return context;
Finally you need to test the service:
- Start the Fabric server and deploy all the modules to the server.
- Go to Business Space, and perform the following steps to invoke the
CreateProfileApplication:
- Create a space called CreateProfileTestSpace with the template Managing Tasks and Workflow.
- Switch to the Create Tasks tab.
- In the Create Task widget, check
CreateProfileApplication, then click Create,
as shown in Figure 29.
Figure 29. Create CreateProfileApplication task
- In the Task Information dialog, fill in the customer
information, then click Submit, as shown in Figure 30.
Figure 30. Specify customer information
- After the application is called, the human task for either the regular or preferred customer profile is created.
- Switch to the My Work tab and go to the Available Tasks dialog, as shown in Figure 31. Select CreateRegularCustomerProfileHT task.
- Since the annual fee is less than 100. it is going through the
regular customer profile creation path; therefore,
isPreferredCustomer is not checked.
Figure 31. Accept the task
Figure 32. Output of the CreateRegularCustomerProfileHT
- After the create profile task is completed, the inform customer task
is called, as shown in Figure 33. Complete this task, and try another
test with the annual fee greater than 100. This task should go through
the preferred customer profile creation path.
Figure 33. InformRegularCustomerHT is invoked
You've seen that when the annual fee is less than 100, the CreateRegularCustomerProfileHT and InformRegularCustomerHT tasks are being invoked, and eventually the customer is not a preferred customer. You can repeat the test in this session with the annual fee greater than 100, and the preferred customer path will be executed.
The authors would like to thank Jose De Freitas and Tom Al-Hamwy for their technical review of this article.
In this two-part series, we've walked through an end-to-end lifecycle of a composite business application using WebSphere business process management products. Using a simplified "create customer profile" scenario as an example, Part 2 showed you how to use WebSphere Business Modeler to enhance the business model, WebSphere Integration Developer to implement it, and WebSphere Business Services Fabric to configure a set of endpoints, each of which is invoked based on different context information carried by the current process instance.
| Description | Name | Size | Download method |
|---|---|---|---|
| Project files | CreateCustomerProfile-owl.zip | 7KB | HTTP |
| Project files | CreateProfileApplication-owl.zip | 7KB | HTTP |
| Project files | FabricBusinessGlossary-owl.zip | 4KB | HTTP |
| Project files | InformCustomer-owl.zip | 24KB | HTTP |
Information about download methods
-
developerWorks BPM zone:
Get the latest technical resources on IBM BPM solutions, including
downloads, demos, articles, tutorials, events, webcasts, and more.
-
Building
the business case for dynamic BPM with business value
assessment :
Dynamic BPM powered by Smart SOA provided by WebSphere Dynamic Process
Edition can simplify end-to-end processes, accelerate process change by
70-80% and lower IT costs by 20-50% when compared to traditional BPM. This
paper shows how these benefits are achieved and how IBM can work with you
in a Business Value Assessment (BVA) to quantify the benefits for your
projects.
-
Tutorial and
Samples for WebSphere Business Modeler:
Sample pre-built modeling projects and a tutorial to introduce you to many
of the program's functions and tools.
-
WebSphere
Business Services Fabric V6.2 information center:
Get complete product documentation.
-
Creating flexible service-oriented business solutions with WebSphere
Business Services Fabric, Part 1: Overview
(developerWorks 2008): WebSphere Business Services Fabric provides an SOA
platform to enable a new class of service-oriented business solutions.
Business Services Fabric provides an integrated environment to model,
assemble, deploy, manage and govern composite business services. This
series of articles introduces you to WebSphere Business Services Fabric
and shows you how to use it to build composite business services.

Diana Lau is a software engineer for the WebSphere Business Process Management SWAT team based in the IBM Toronto Software Lab. She works closely with customers resolving technical issues and providing best practices for implementing BPM solutions. You can reach Diana at dhmlau@ca.ibm.com.
Ying Sun is a software developer with the WebSphere Business Process Management SWAT team. He has over 10 years of experience working with a variety of products in the IBM software portfolio. He works closely with customers, helping them resolve technical issues and provide support for implementing BPM solutions. He can be reached at ysun@ca.ibm.com.




