In Part 4, you learned about the WebSphere Business Services Fabric (hereafter called Fabric) assembly process and completed some of the steps to create metadata for the composite business process. In this article, you'll complete the next steps in the process. Also, in Part 2 of this series, you learned about the various points of variability in the business process, created assertions and exported them as a Fabric Content Archive (FCA). We'll use that FCA in this article. For your convenience, the FCA, AutoLoanAssertions.zip, is provided for download with this article. You'll learn how to assign capabilities to endpoints by adding the imported assertions, and build policies that will be used by the IBM Business Service Dynamic Assembler(hereafter called Dynamic Assembler) to dynamically select endpoints. Finally, you'll test the application using the Fabric Unit Test Environment (UTE).
If you haven't already done so, you must install the following software in order to complete the steps in this article:
- Websphere Integration Developer V6.1
- IBM Websphere Business Service ToolPack 6.1. The Business Services ToolPack provides a complete development environment for building and testing business services. It includes all the tools necessary to build business services and the runtime environment (the UTE) for deploying and testing your business services.
Complex business processes require a lot of decision-making at various stages, and modeling such processes leads to complex if-else code logic, which makes the business process rigid and difficult to change. Fabric simplifies the business process by handling all such complex decision-making, thus making the business process flexible and dynamic. Fabric uses metadata that is stored in the IBM Business Services Repository for dynamic decision-making. The points of variability in the business process are modeled as assertions and assigned as capabilities to the service provider implementations. The Dynamic Assembler, which is the decision-making engine of Fabric, looks at a request, evaluates policies, and routes the request to the endpoints which are capable of serving the request. In the following sections, you'll learn how to add assertions to the service endpoints and create policies.
To import the FCA and create the assertions, do the following:
- Log in to the Fabric administrative console by opening a browser to http://localhost: 9081/ fabric, assuming UTE is running on port 9081.
- Select My Services => Governance Manager => Import/Export.
- Specify the AutoLoanAssertions.zip and click Import File.
- Select My Services => Governance Manager => Manage Projects, and select the Auto Loan Procurement project .
- On the Namespaces tab, click Import Namespaces.
- Select the Auto Loan assertions model that you imported using the FCA you just imported, then click Import Namespaces. This creates two assertions: the State Based assertion and the Customer Type assertion, and makes them available to the Auto Loan Procurement Business service project.
You can add capabilities to the endpoints by adding the assertions to them. To do this:
- Open Composition Studio, and switch to the Business Service perspective.
- Right-click on the Auto Loan project you created in Part 4, and select Update Catalog, then click Finish.
- Double-click the Credit Check Day EP endpoint. This endpoint will be used for credit verification from 7 am to 8 pm everyday. To enable this capability for the endpoint, you need to add an Hours Of Operation assertion in the core ontology.
- On the Assertions tab, click Add.
- Select Manageability Assertion => Hours Of Operation,
and click OK, as shown in Figure 1.
Figure 1. Add hours of operation to the Credit Check Day endpoint
- Specify the following values in the Hours of Operation dialog, as
shown in Figure 2:
- Start Time: 7:00 A.M
- Duration: 13 Hours
- Timezone: India
Figure 2. Specify Hours of Operation details
- Repeat the previous steps for the Credit Check Night EP endpointt,
which provides the credit verification service from 8 PM to 7 AM.
Specify the following values:
- Start Time : 8:00 P.M
- Duration : 11 Hours
- Timezone : India
- Doubleâclick the License Check CA EP endpoint. This endpoint provides license verification for customers in California.
- On the Assertions tab.Click on Add.
- Select Interoperability Assertion => Content Based Assertion
=> StateBasedAssertion, and click OK, as shown
in Figure 3.
Figure 3. Add a state based assertion to License Check CA
- Check Required, select CA for the state, and click
OK, as shown in Figure 4.
Figure 4. Specify State Based Assertion details
- Repeat these steps to add TX to the License Check NonCA EP.
- Doubleâclick the Loan Provider Gold EP endpoint. This endpoint provides loan provisioning service for gold customers.
- On the Assertions tab, select Interoperability Assertion
=> Content Based Assertion =>Customer Type, as
shown in Figure 5, then click OK.
Figure 5. Add a Customer Type assertion to the LoanProviderGold endpoint.
- Check Required and select Gold as the customer type,
then click OK, as shown in Figure 6.
Figure 6. Specify Customer Type assertion details
- There are two different loan provider service implementations
depending upon the type of customer. A gold customer will be served
faster, while a silver customer will be served a little slower. To add
these capabilities to the endpoints, you need to add a
MaximumTransactionTime assertion, which is a type of Performance
Assertion. To do this, select Performance Assertion =>
Maximum Transaction Time, and click OK.
Figure 7. Add a Maximum Transaction Time assertion to the LoanProviderGold endpoint
- Set the transaction time value to 15 milliseconds, and click
OK, as shown in Figure 8.
Figure 8. Specify Maximum Transaction Time Assertion details
- Repeat the previous steps for Loan Provider Silver EP and specify Silver as the customer type and 30 milliseconds as the maximum transaction time.
So far, you've assigned some capabilities to service endpoints . Now you need to model the if-then blocks in your business process. To model these points of variability , you need to define policies. A policy is nothing but a rule of the form if{condition} then {expression}. You want to define a policy such that, depending upon the customer type , the appropriate loan provisioning service endpoint is invoked. If the customer type is Gold, you want to select an endpoint that can service the request in less than 20 milliseconds. To define a policy to accomplish this, do the following:
- Right click Policy and select New =>Policy.
- Specify
Loan Provider Customer Policyas the name and click Browse. - Select Interface and LoanProvider, as shown in Figure 9.
Figure 9. Create policy
- Select Interface, then Loan Provider, then click
OK, as shown in Figure 10.
Figure 10. Select target
- After you've created the policy, click the Contract tab,and click Add.
- Select Interopability Assertion => Content Based Assertion => Customer Type, and click OK.
- Check Required and Fill from Context, then click
OK, as shown in Figure 11. If Fill from Context is
checked and a value is supplied for an assertion property, that value
is used as as the default if the property does not appear in the
context.
Figure 11. Add a Customer Type assertion
- Next add a Maximum Transaction Time assertion by clicking Add and selecting Performance Assertion => Maximum Transaction Time, and clicking OK.
- Uncheck Required and set the transaction time to
20 milliseconds, then click OK, as shown in Figure
12.
Figure 12. Add a Maximum Transaction Time assertion
- Add a policy for License Check service, which has the License Check
interface as the target, and a State Based assertion in the contract
with Fill From Context checked, as shown in Figure 13. This
policy selects a Loan Provider endpoint depending upon the state
passed in the request.
Figure 13. State Based assertion added to License Check policy
A context specification is a declaration of context dimensions that are relevant for a dynamic assembly decision. A context specification can be used to ensure that an assertion to be filled from context has its value supplied in the context at runtime. At runtime, a policy is enforced if the invocation context contains the necessary inputs to satisfy the policy conditions. If a dimension is marked as required, the system will fail at dynamic assembly time if a value for this dimension is not satisfied in the context. A context specification thus serves as a contract between:
- The policy-based dynamic assembly scenarios configured and tested and
- The context injection logic that must be set up by a developer configuring the Dynamic Assembly components.
You need to create context specifications for both the Loan Provider and the License Check policies.
- Right-click the project and select New => Context
Specification. Specify a name and click Finish, as
shown in Figure 14.
Figure 14. Create a context specification for the License Check policy
- Click the Dimensions tab click Add to add a content-based dimension.
- Select StateBasedAssertion, as shown in Figure 15, and click
OK.
Figure 15. Select StateBasedAssertion
- Associate this context specification with the License Check DA
component. Right-click LicenseCheckDA and open the editor, as
shown in Figure 16.
Figure 16. Open editor for LicenseCheckDA
- In the Dynamic Assembly Component section, click Browse
to add the context specification, as shown in Figure 17.
Figure 17. Browse to context specification
- Select License Check Context Spec and click OK, as shown
in Figure 18.
Figure 18. Select context specification
- Repeat the steps above to create a context specification called LoanProvider ContextSpec for the Loan Provider interface, with the Customer Type assertion as a required content-based dimension. Associate the specification with the LoanProviderDA component.
To simulate the policy for the Loan Provider service, do the following:
- Right-click the project and select New => Simulation.
- Specify a name for the simulation and select the LoanProviderDA
from the list of Dynamic Assembly components, then click
Finish, as shown in Figure 19.
Figure 19. Select component to simulate
- In the Required Context section, click Edit to specify
the customer type, as shown in Figure 20.
Figure 20. Edit customer type
- Select Gold as the customer type and click OK, as shown
in Figure 21.
Figure 21. Select customer type
- Click Run to run the simulation. The results of the simulation
are displayed, as shown in Figure 22.
Figure 22. Simulation results
The results include the following details:
- Build selection policy : Click Details for
information about how the composite policy was built and which
policies were used to build this composite policy, as shown in
Figure 23.
Figure 23. Composite policy simulation details
- Find candidates: Click Details for information
about which endpoints were chosen as candidates for selection,
as shown in Figure 24.
Figure 24. Candidate endpoints details
- Select the endpoint and click Details to see the
endpoint that was selected by the composite policy, as shown
in Figure 25.
Figure 25. Selected endpoint
- Build selection policy : Click Details for
information about how the composite policy was built and which
policies were used to build this composite policy, as shown in
Figure 23.
- Submit the change list, if desired. Since you're using the UTE environment , these changes are automaticlly approved and published to the repository.
Subscribe to the business service
Next you need to enroll the Auto Loan Process Service in the Auto-org organization and subscribe it to the aut-admin user. First you need to create an enrollment namespace and associate it with the project.
- Log in to the Fabric administrative console.
- Select My Services => Governance Manager => Configure Namespaces, then click Create a Namespace.
- Select Enrollment for the Namespace Type, then enter a display name and URI and select the Auto Loan Procurement project from the owner project menu.
- Select My Services => Subscriber Manager => Manage Enrollments.
- Select Auto-org from the Available Organizations section, and then select Auto Loan App, which contains the Auto Loan Process Service from the Select services to enroll/disenroll section, and click Enroll Organizations.
- Click Manage Subscriptions, then select Auto-org and click Select Organization.
- Select aut-admin and check Auto Loan App, then click Subscribe Users.
- Click Manage Subscribers and select Auto-org.
- Click the Users tab, then select aut-admin.
- Click the Subscriptions tab and select Auto-org from the Organization menu, then click View Subscriptions.
- Copy the subscription ID for later use.
To test the application, complete the following steps:
- Switch to the Business Integration perspective, and open the assembly diagram for the Procure Loan module.
- Right-click the assembly diagram and select Test Module, as
shown in Figure 26.
Figure 26. Select Test Module
- Provide the following data for the Customer object, as shown in Figure
27:
- ssnNo: 1234
- licenseNo: 1234
- localtion: CA
- customerType: Gold
Figure 27. Customer object parameters
- Right-click the context-identifier element and select Set To
=> Null, as shown in Figure 28.
Figure 28. Set context identifier to null
- Right-click the context element of the parent-context
and select Set to => Unset, as shown in Figure 29.
Figure 29. Unset context element
- Double-click the expiresAt element and set the expiration date
to some future date, as shown in Figure 30, on which the context ID
that you generated expires.
Figure 30. Set expiration date
- Right-click the property element and select Add
Elements, as shown in Figure 31. Specify 1 as the value.
Figure 31. Select Add Elements
- Specify
http://www.webifysolutions.com/context/subscriptionas the name. - Specify the subscription ID you obtained in
Subscribe to the susiness service as the
value, as shown in Figure 32.
Figure 32. Test Module(Contd)
- Click the icon, as shown in Figure 33.
Figure 33. Select Continue
- Select IBM Websphere Business Service Fabric Server v6.1 as the
deployment location and click Finish, as shown in Figure 34.
Figure 34. Select deployment location
- In the login dialog, enter
adminfor both the username and password. - Look at the responses, as shown in Figure 35.
Figure 35. View the response
- Click a response for more information, as shown in Figure 36.
Figure 36. Procure Loan results
- Select My services => Performance Manager => Service Invocation Summary.
- Click Transaction ID, as shown in Figure 37.
Figure 37. Select Transaction ID
You'll see that three Web services were invoked by the Dynamic Assembler, as shown in Figure 38.
Figure 38. Service invocation summary
Manage business process changes
Letâs assume that a business process needs to change to integrate with a new loan provider. The business identifies a need to add a new type of customer, Platinum, which will be served by the new loan provider. Because the customer type is Platinum, the expected response time is fast, and therefore, the maximum transaction time is the lowest of the customer types. Letâs look at how you can make these changes without having to make any changes to the business processes.
First you'll need to modify the assertions FCA that you created in Part 3.
- Use Rational® Software Architect V7.0 to open the auto loan ontology model that you created in Part 2.
- Add a new Enumeration instance for the Customer Type Enumeration with a value of Platinum.
- Run the OWL transformation. This updates the assertions OWL file with the new enumeration value. Update the FCA with the modified OWL.
- Log on to the Fabric administrative console, and select My Services => Governance => My Services => Import/Export By Project, and import the updated FCA.
- Switch to the Business Service perspective in Composition Studio and right-click the Auto Loan project that you created in Part 4, then select Update Project and click on Finish. This replicate and synchronizes the local repository with the changes in the repository. The Customer Type assertion is now updated with the enumerated value of Platinum for the new category of customer.
- Add a new endpoint called Loan Provider Platinum EP, providing the URL where it is deployed.
- This endpoint needs to have a minimum transaction time so that the response is faster. Add a Maximum Transaction Time assertion with a value of 8 milliseconds.
- Add a new policy with the following assertions in the contract:
- CustomerType assertion with Required and Fill from Context checked.
- Maximum Transaction Time assertion with Required unchecked and the transaction time set to 10 milliseconds.
- Set the priority to 1 for this policy, as shown in Figure 39.
Figure 39. Set the priority
- Run the simulation for the Loan Provider service by passing the Customer Type as Platinum and verify that the Platinum service provider endpoint is selected. Submit the changes to the catalog. Because you're using the UTE environment, these changes are automatically published.
- Repeat the steps you used before to test the application using the
Test Module function. Pass the customer type as
Platinum, as shown in FIgure 40.
Figure 40. Test for the Platinum customer
- Verify that the correct endpoint was invoked by checking the service
invocation summary, as shown in Figure 41.
Figure 41. Service Invocation summary for Platinum customer
You've now incorporated changes without redeploying the business process.
In this article series, you learned how you can leverage WebSphere Business Services Fabric to build complex business applications. The series walked you through each of the stages of the SOA lifecycle -- model, assemble, deploy, and manage. You saw how Fabric can help manage business process changes without requiring you to make actual changes to the applications themselves. Using what you learned in this series, you can rethink the way you currently build your business applications and analyze the benefits you could realize by eliminating rigid business processes and leveraging the dynamic orchestration power provided by Fabric to build loosely coupled, flexible business processes.
| Description | Name | Size | Download method |
|---|---|---|---|
| Organizations, users and roles | OrganizationsUsersAndRoles.zip | 5KB | HTTP |
| Auto loan instance metadata | AutoLoanInstances.zip | 9KB | HTTP |
| Auto loan assertions metadata | AutoLoanAssertions.zip | 4KB | HTTP |
Information about download methods
-
Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 1: Overview:Part
1 describes the concepts of business services and composite business
services and how Business Services Fabric provides an SOA platform to
model, assemble, deploy, manage and govern composite business
services.
-
Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 2: Extending the ontology models:Part
2 describes a sample application and how to extend the ontology models for
capturing the points of variability in the business process.
-
Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 3: Designing and implementing the business service:Part
3 walks you through the steps to implement a composite business process
and enable it with dynamic binding and orchestration
capabilities.
-
Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 4: Creating metadata for the business process:Part
4 describes how to create the metadata for the business process
.
-
WebSphere business
process management zone:
Get the latest technical resources for WebSphere BPM solutions, including
articles, tutorials, events, downloads, and more.
-
Business Process Management
enabled by SOA:
Get complete product information on IBM BPM software, including features
and benefits, downloads, and more.
-
WebSphere
Business Services Fabric product information:
Get product information, including features and prerequisites.
-
Service
Component Architecture (SCA):
Get information and the specification for SCA, a technology that
simplifies application development and implementation in an
SOA.
-
WebSphere
Business Process Management Version 6.1 information center:
Get complete product documentation for WebSphere BPM products.
-
Getting Started with
IBM WebSphere Business Services Fabric V6.1:
This IBM Redbook provides a complete overview of Fabric, from an
architectural introduction, to an installation guide, and a step-by-step
scenario that describes how to model, assemble, deploy, and manage
composite business applications.

Rohit Sardesai works as a software engineer in the IBM India Software Lab, in Mumbai. He is part of the IBM WebSphere Business Services Fabric team. You can reach Rohit at rohitsardesai@in.ibm.com.

Manoj Pal is a software engineer in the IBM India Software Lab, in Mumbai. He is part of the IBM Websphere Business Services Fabric. You can reach Manoj at palmanojkumar@in.ibm.com.

Pankuj Chachra is a IBM Quality Assurance Architect and Technical Lead working on WebSphere Business Services Fabric. You can reach Pankuj at chpankuj@in.ibm.com.

Suresh Das is a Quality Assurance Test Lead working on Websphere Business Services Fabric Composition Studio. He is responsible for test planning, execution and automation for Composition Studio. He is also responsible for Global Verification Test and Translation Verification Test coordination. You can reach Suresh at dasuresh@in.ibm.com.




