Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 5: Testing the application

Rohit Sardesai (rohitsardesai@in.ibm.com), Software Engineer, IBM
Rohit Sardesai photo
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.
Manojkumar Pal (palmanojkumar@in.ibm.com), Software Engineer, IBM
Manojkumar Pal photo
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 (chpankuj@in.ibm.com), Quality Assurance Architect, IBM
Pankuj Chachra photo
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 (dasuresh@in.ibm.com), Quality Assurance Lead, IBM
Suresh Das photo
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.

Summary:  Learn how you can leverage the features of WebSphere® Business Services Fabric to build composite business applications that support dynamic binding and orchestration. In the final article in this 5-part series you'll learn how to deploy and test the application that you've built in the previous parts of the series.

View more content in this series

Date:  10 Feb 2009
Level:  Intermediate

Activity:  2250 views
Comments:  

Introduction

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).

Prerequisites

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.

Import the FCA

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:

  1. Log in to the Fabric administrative console by opening a browser to http://localhost: 9081/ fabric, assuming UTE is running on port 9081.
  2. Select My Services => Governance Manager => Import/Export.
  3. Specify the AutoLoanAssertions.zip and click Import File.
  4. Select My Services => Governance Manager => Manage Projects, and select the Auto Loan Procurement project .
  5. On the Namespaces tab, click Import Namespaces.
  6. 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.

Add endpoints to assertions

You can add capabilities to the endpoints by adding the assertions to them. To do this:

  1. Open Composition Studio, and switch to the Business Service perspective.
  2. Right-click on the Auto Loan project you created in Part 4, and select Update Catalog, then click Finish.
  3. 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.
  4. On the Assertions tab, click Add.
  5. 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
    Add hours of operation

  6. 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
    Specify Hours                     of Operation details

  7. 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
  8. Double–click the License Check CA EP endpoint. This endpoint provides license verification for customers in California.
  9. On the Assertions tab.Click on Add.
  10. 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
    Add atate based assertion

  11. Check Required, select CA for the state, and click OK, as shown in Figure 4.

    Figure 4. Specify State Based Assertion details
    Specify State                     Based Assertion details

  12. Repeat these steps to add TX to the License Check NonCA EP.
  13. Double–click the Loan Provider Gold EP endpoint. This endpoint provides loan provisioning service for gold customers.
  14. 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.
    Add Customer Type assertion

  15. Check Required and select Gold as the customer type, then click OK, as shown in Figure 6.

    Figure 6. Specify Customer Type assertion details
    Specify Customer Type assertion details

  16. 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
    Add a Maximum Transaction Time Assertion

  17. Set the transaction time value to 15 milliseconds, and click OK, as shown in Figure 8.

    Figure 8. Specify Maximum Transaction Time Assertion details
    Adding a Maximum Transaction Time Assertion to the LoanProviderGold endpoint.

  18. Repeat the previous steps for Loan Provider Silver EP and specify Silver as the customer type and 30 milliseconds as the maximum transaction time.

Define a policy

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:

  1. Right click Policy and select New =>Policy.
  2. Specify Loan Provider Customer Policy as the name and click Browse.
  3. Select Interface and LoanProvider, as shown in Figure 9.

    Figure 9. Create policy
    Create policy

  4. Select Interface, then Loan Provider, then click OK, as shown in Figure 10.

    Figure 10. Select target
    Select target

  5. After you've created the policy, click the Contract tab,and click Add.
  6. Select Interopability Assertion => Content Based Assertion => Customer Type, and click OK.
  7. 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
    Add Customer Type assertion

  8. Next add a Maximum Transaction Time assertion by clicking Add and selecting Performance Assertion => Maximum Transaction Time, and clicking OK.
  9. 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 Maximum Transaction Time assertion

  10. 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
    State Based assertion in License Check

Build context specifications

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.

  1. 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
    Create a context spec for License Check

  2. Click the Dimensions tab click Add to add a content-based dimension.
  3. Select StateBasedAssertion, as shown in Figure 15, and click OK.

    Figure 15. Select StateBasedAssertion
    Select                     StateBasedAssertion

  4. 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
    Open editor                     for LicenseCheckDA

  5. In the Dynamic Assembly Component section, click Browse to add the context specification, as shown in Figure 17.

    Figure 17. Browse to context specification
    Browse to                     context specification

  6. Select License Check Context Spec and click OK, as shown in Figure 18.

    Figure 18. Select context specification
    Select                     context specification

  7. 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.

Simulate the business policy

To simulate the policy for the Loan Provider service, do the following:

  1. Right-click the project and select New => Simulation.
  2. 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
    Select                     component to simulate

  3. In the Required Context section, click Edit to specify the customer type, as shown in Figure 20.

    Figure 20. Edit customer type
    Edit customer type

  4. Select Gold as the customer type and click OK, as shown in Figure 21.

    Figure 21. Select customer type
    Select                     customer type

  5. Click Run to run the simulation. The results of the simulation are displayed, as shown in Figure 22.

    Figure 22. Simulation results
    Simulation results

    The results include the following details:

  6. 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.

  1. Log in to the Fabric administrative console.
  2. Select My Services => Governance Manager => Configure Namespaces, then click Create a Namespace.
  3. 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.
  4. Select My Services => Subscriber Manager => Manage Enrollments.
  5. 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.
  6. Click Manage Subscriptions, then select Auto-org and click Select Organization.
  7. Select aut-admin and check Auto Loan App, then click Subscribe Users.
  8. Click Manage Subscribers and select Auto-org.
  9. Click the Users tab, then select aut-admin.
  10. Click the Subscriptions tab and select Auto-org from the Organization menu, then click View Subscriptions.
  11. Copy the subscription ID for later use.

Test the application

To test the application, complete the following steps:

  1. Switch to the Business Integration perspective, and open the assembly diagram for the Procure Loan module.
  2. Right-click the assembly diagram and select Test Module, as shown in Figure 26.

    Figure 26. Select Test Module
    Select test module

  3. 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
    Customer                     object parameters

  4. Right-click the context-identifier element and select Set To => Null, as shown in Figure 28.

    Figure 28. Set context identifier to null
    Set context                     identifier to null

  5. Right-click the context element of the parent-context and select Set to => Unset, as shown in Figure 29.

    Figure 29. Unset context element
    Unset context

  6. 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
    Set expiration                     date

  7. Right-click the property element and select Add Elements, as shown in Figure 31. Specify 1 as the value.

    Figure 31. Select Add Elements
    Select Add                     Elements

  8. Specify http://www.webifysolutions.com/context/subscription as the name.
  9. 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)
    Test Module

  10. Click the icon, as shown in Figure 33.

    Figure 33. Select Continue
    Continue

  11. 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
    Select                     deployment location

  12. In the login dialog, enter admin for both the username and password.
  13. Look at the responses, as shown in Figure 35.

    Figure 35. View the response
    View response

  14. Click a response for more information, as shown in Figure 36.

    Figure 36. Procure Loan results
    Procure Loan                     results

  15. Select My services => Performance Manager => Service Invocation Summary.
  16. Click Transaction ID, as shown in Figure 37.

    Figure 37. Select Transaction ID
    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
    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.

  1. Use Rational® Software Architect V7.0 to open the auto loan ontology model that you created in Part 2.
  2. Add a new Enumeration instance for the Customer Type Enumeration with a value of Platinum.
  3. Run the OWL transformation. This updates the assertions OWL file with the new enumeration value. Update the FCA with the modified OWL.
  4. Log on to the Fabric administrative console, and select My Services => Governance => My Services => Import/Export By Project, and import the updated FCA.
  5. 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.
  6. Add a new endpoint called Loan Provider Platinum EP, providing the URL where it is deployed.
  7. 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.
  8. 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.
  9. Set the priority to 1 for this policy, as shown in Figure 39.

    Figure 39. Set the priority
     Set the priority

  10. 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.
  11. 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
    Test for the Platinum customer

  12. 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
    Service Invocation summary for Platinum customer

You've now incorporated changes without redeploying the business process.

Summary

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.



Downloads

DescriptionNameSizeDownload method
Organizations, users and rolesOrganizationsUsersAndRoles.zip5KBHTTP
Auto loan instance metadataAutoLoanInstances.zip9KBHTTP
Auto loan assertions metadataAutoLoanAssertions.zip4KBHTTP

Information about download methods


Resources

About the authors

Rohit Sardesai photo

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.

Manojkumar Pal photo

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 photo

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 photo

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.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=368718
ArticleTitle=Creating flexible service-oriented business solutions with WebSphere Business Services Fabric, Part 5: Testing the application
publish-date=02102009
author1-email=rohitsardesai@in.ibm.com
author1-email-cc=crothemi@us.ibm.com
author2-email=palmanojkumar@in.ibm.com
author2-email-cc=crothemi@us.ibm.com
author3-email=chpankuj@in.ibm.com
author3-email-cc=crothemi@us.ibm.com
author4-email=dasuresh@in.ibm.com
author4-email-cc=crothemi@us.ibm.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers