Tutorials > Management Center


Next >


Tutorial: Creating the Project BOD service module

In this tutorial, we will develop a new service module - Project. The services provided by the module will be Get, Change and Process. As part of creating the service module, we will design the logical model (noun) and physical model (database schema) based on the business requirement.

The Project service module stores and retrieves data, and performs business logic for our new Recipe tool in the Management Center. A recipe is an object that describes how to use several products that the retailer sells. It is made up of a set of ingredients, tools, and the instructions that show how to use the ingredients and tools to make the product.

Service modules provide the business logic to support operations on a business object, or noun. The noun that you are going to define in this tutorial is called the Project noun. Although the tool that is created in this scenario is called the Recipe tool, "Project" is more general, and can be applied to other retail segments. While a recipe is a food preparation Project, you could have projects that apply to home renovation, or a recreational hobby.

There are two sets of terminology that are used in this recipe project, one set is used in the user interface, while the other set is from the database schema. Refer to the following table to understand the relationship between the two sets of terms:

Term used in user interface Term used in logical schema Description
Recipe Project The primary object that represents the recipe. For example, making coffee.
Recipe description ProjectDescription The description for the recipe.
Ingredients ProjectMaterial The materials that are used to make the final product. For example, coffee beans, water, and sugar.
DescriptionOfIngredient ProjectMaterialDesc The description for the materials.
RecipeInstruction ProjInstr The steps to make the final product. For example, boil the water; grind the coffee bean.
RecipeInstructionDescription ProjInstrDesc The description for the steps.
RecipeCollection ProjectCollection The tags to categorize the recipes, for example, food and drink.
RecipeCollectionDescription ProjectCollectionDesc The description for the collection.
Usage association Usage association The tools to be used to make the final product. For example a pot, and a coffee muller.

The service module contains two nouns: Project and ProjectCollection. For this tutorial, the definition of the two nouns contains the information listed in the following table. The table lists the access profiles that includes the information. Data included in the Summary profile will be shown in the summary view, and data included in the Details profile will be shown in the details view.

For the Project noun:

Data Description Applicable access profiles
ProjectIdentifier Project identification information Summary, Details
Tool The tools that are used in the project. All tools must come from existing catalog entries. Details
TimeToComplete The time, specified in minutes, that is required to complete the Project Summary, Details
Difficulty The degree of difficulty of the project: easy, normal, or difficult Summary, Details
Material The materials for the project. Details
Instruction The instructions to complete the project. Details
Description The Project noun description. Summary, Details
Collection The relationship between the Project noun and the ProjectCollection noun. A ProjectCollection can have multiple Projects. Details

For the ProjectCollection noun:

Data Description Applicable Access Profiles
ProjectCollectionIdentifier The ProjectCollection identification information. Details
Description The ProjectCollection description. Details

You can use the Get service to retrieve Project and ProjectCollection noun information based on an XPath search expression. This tutorial demonstrates how to support the following XPath expressions:

Find Project by Project UniqueID:

/Project[ProjectIdentifier[(UniqueID='10001')]]

Find Projects by ProjectCollection UniqueID:

/Project[ProjectCollection[ProjectCollectionIdentifier[(UniqueID='10001')]]]

Find Projects by Materials related catentry UniqueID:

/Project[Material[CatalogEntry[CatalogEntryIdentifier[(UniqueID='10001')]]]]

Find Projects by Tools related catentry UniqueID:

/Project[Tool[CatalogEntry[CatalogEntryIdentifier[(UniqueID='10001')]]]]

Find Projects by search expression:

/Project[search(contains(ProjectIdentifier/ExternalIdentifier/Name,'MyProjectName'))]

Retrieve all ProjectCollections:

/ProjectCollection

The Change service updates project information for a Project noun. The Change service can add, update or delete information. The Project noun is divided into the following distinct noun parts:

In this tutorial, you also implement a change service for each noun part. A subset of the change services are shown in the following examples:

Update a Project's Description:

<oa:ActionExpression actionCode="Update" expressionLanguage="_wcf:XPath">/Project[1]/Description[1] </oa:ActionExpression>

Add a Project's Material:

<oa:ActionExpression actionCode="Add" expressionLanguage="_wcf:XPath">/Project[1]/Material[1] </oa:ActionExpression>

Update a Project's Material:

<oa:ActionExpression actionCode="Update" expressionLanguage="_wcf:XPath">/Project[1]/Material[1] </oa:ActionExpression>

Delete a Project's Material:

<oa:ActionExpression actionCode="Delete" expressionLanguage="_wcf:XPath">/Project[1]/Material[1] </oa:ActionExpression>

The Process service creates and deletes the Project noun and Project Collection noun. In this tutorial, the following process actions are implemented:

Create a project:

<oa:ActionExpression actionCode="Create" expressionLanguage="_wcf:XPath">/Project[1]</oa:ActionExpression>

Delete a project:

<oa:ActionExpression actionCode="Delete" expressionLanguage="_wcf:XPath">/Project[1]</oa:ActionExpression>

Create a project collection:

<oa:ActionExpression actionCode="Create" expressionLanguage="_wcf:XPath">/ProjectCollection[1] </oa:ActionExpression>

Delete a project collection:

<oa:ActionExpression actionCode="Delete" expressionLanguage="_wcf:XPath">/ProjectCollection[1] </oa:ActionExpression>


Learning objectives

The learning objectives for the tutorial are:


Time required

This tutorial takes approximately 4 hours to finish. If you explore other concepts related to this tutorial, it might take longer to complete.


Skill level

Advanced


Audience

This tutorial is intended for WebSphere Commerce developers who are responsible for creating and customizing WebSphere Commerce services.


System requirements

Before beginning this tutorial ensure that you have fulfilled the following prerequisites:


Prerequisites

To complete this tutorial, familiarize yourself with the following terms and concepts:


Lessons in this tutorial

Next >


+

Search Tips   |   Advanced Search