Develop > Controller layer > Management Center Web application > Map between the Management Center client and WebSphere Commerce nouns > Process Management Center services
Transforming URL requests into Process BODs
When you create, remove, or change the state of a Management Center object, you use a Process service.
Purpose
When transforming the URL request into a Process service request, the Management Center Web application creates the BOD by populating both the Noun and the Process verb.
To comply with the best practices for building the Process service request message, the action expression in a Process verb must apply to the entire Noun. If the process needs to act upon specific parts of the Noun, the Noun must be populated based on the information that controls the process operation. Based on this guideline, every action code that is specified must apply to a particular Noun that is constructed based on the URL request parameters.
The URL requests are represented by Struts actions that map the URL to Noun and Verb combinations to transform an URL into a BOD Process message. Upon completion of the Process service, the Struts action forwards to a JSP file to build the XML-formatted data for the Management Center.
Step 1: Creating the Noun
When the Management Center performs an action, the properties of the Management Center object are passed as URL parameters that represent a Noun element. The name of each URL parameter corresponds to the name and value of the associated Management Center object. Using Management Center object definition files, the Management Center Web application populates the Noun portion of the BOD based on the specified URL to BOD definition name. The Management Center Web application then iterates through request parameters and for each parameter determines if there is an element in the Noun that is defined in the configuration file. For every parameter that has the corresponding definition or association, the Noun element is populated with the URL parameter value. For example, if the configuration has defined catalogEntryId to /CatalogEntry/CatalogEntryIdentifier/UniqueID and the URL request has catentryId=1234, then the Noun produced will have UniqueID populated with the value 1234.
You can include additional data using user data. The UserData association configuration specifies the element in which the derived name and the URL parameter value should be set within the declared Noun element. Specify this when the default Noun element does not have a name attribute and the value cannot be explicitly set, but is part of an element that is a child of the declared Noun element. User data must use parameters using the format xattr_name, where name is the name of the user data field. For example, in the following URL, the parameter xattr_catentry_parameterName has a value of Parameter Value.
https://localhost/webapp/wcs/cmc/servlet/ChangeCatalogEntry.do?catentryId=10259&partNumber=FUOF-01 &ownerId=70000000000000000101&language=-1&name=Desk+Chair&Desc=Desk+chair.&xattr_parameterName=Parameter+Value&...The preceding xattr_parameterName=Parameter+Value section of the URL is transformed into the following:
<_wcf:UserDataField name="parameterName"> Parameter Value </wcf:UserDataField>
Step 2: Creating the Process verb
To create the Process verb, a special URL parameter called actionCode is used to define the action code that is part of the action expression. The actionCode URL parameter represents the value of the action code for each action expression built in the Process verb. Since URL parameters can have multiple values for the same parameter, each value represents a separate action expression for the same Noun. For example, if the value of actionCode is Add and Delete, then the Process verb will have two action expressions: one with action code for Add and another with action code for Delete, each pointing to the same Noun.
Example
The following URL:
https://localhost/webapp/wcs/cmc/servlet/ProcessCatalogEntry.do?catentryId=10259&actionCode=Delete&...corresponds to the following part of a BOD:
[...] <_cat: DataArea> <oa:Process> <oa:ActionCriteria> <oa:ActionExpression actionCode="Delete">/CatalogEntry[1]</oa:ActionExpression> </oa:ActionCriteria> </oa:Process> <_cat:CatalogEntry> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10259</_wcf:UniqueID> [...]
Related concepts
Map between Management Center objects and nouns
Related tasks
Define process services for a custom Management Center object