Transforming URL requests into process BODs
When you create, remove, or change the state of a Management Center object, you use a process service. When a URL request is generated, the URL parameters are compared with the object definitions to get the instructions for mapping the parameters to the associated noun elements. If the URL request requires an updated Management Center object to be returned, the noun is then transformed into the object model XML that is required by Management Center.
When you are transforming a URL request into a process service request, the Management Center web application creates the BOD by populating both the noun and the process verb. The action expression in a process verb must apply to the entire noun. If the process needs to act on specific parts of the noun, the noun must be populated by using the information that controls the process operation. 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 defined within Spring framework controller configurations that map the URL to noun and verb combinations to transform a URL into a BOD process message. Upon completion of the process service, the Spring controller and view resolver builds a JSP file that includes the XML-formatted data for Management Center.
Process noun creation
When an action is performed in Management Center, the properties of the Management Center object that are acted upon are passed to the web application as URL parameters. These parameters represent a noun element. The name of each URL parameter corresponds to the name and value of the Management Center object. The web application then populates the noun portion of the BOD based on the specified URL to BOD definition name and the object definition file for the object. The application then iterates through the request parameters to continue populating the noun. For each parameter, the application determines whether the noun contains a corresponding defined element in the object definition file. For every parameter that has a corresponding definition and associated data, the noun element is populated with the URL parameter value.
For example, if the object definition file defines catalogEntryId
to be
/CatalogEntry/CatalogEntryIdentifier/UniqueID and the URL request is
catentryId=1234, then the noun that is produced has a UniqueID
element that is
populated with the value 1234
.
UserData within a noun
If you require more data in a noun and Management Center object, you can use UserData. UserData is used as a data extension point for adding data for objects without changing your WebSphere Commerce logical model. If you use UserData, your configuration must include definitions for how to handle the mapping of the UserData. For more information about User Data, see Management Center business object UserData.
Process verb creation
To create a process verb, a special URL parameter
that is 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 that is 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 the actionCode
parameter is
Add
and Delete
, the process verb has two action expressions: one
with an action code for Add
and another with action code for
Delete
. Each verb points to the same noun.
Example
catentryId
and
actionCode
parameters.
https://localhost/webapp/wcs/cmc/servlet/ProcessCatalogEntry.do?catentryId=10259&actionCode=Delete&...
When the URL request is transformed into a process BOD, the following object model XML can be
created.
[...]
<_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>
[...]