Using Change Flow

ChangeFlow WebSphere Commerce Change Flow setup helps in handling store specific features. For example, as shown in the commerce change flow tutorial, thumb nail images may be enabled for a certain store but not other stores. Change flow condition may be evaluated using WebSphere Commerce Flow custom JSP tags. Here is an example:

<flow:ifEnabled feature="showThumbs">
showThumbs related code fragment
</flow:ifEnabled>

In the above code, showThumbs is the id of the feature you want to use. If showThumbs is enabled for the current store, then the showThumbs related code fragment is executed. If configured correctly, these change flow features can be enabled/disabled using commerce accelerator.

If you are using the change flow features of Commerce for the first time be prepared to face some frustrating moments. Most of the problems you face may be related to updating the correct files in the correct locations. The key is to understand the following file locations and their importance. The goal of this article is to present you with the same. Please note that I worked with ExtendedSites using B2B Direct Store model. In other store models, there might be slight variations to the location of the files discussed.

The following are the key files when working with "Change Flow". In this list Stores may be replaced with Stores.war if you are on the server.

  1. fsf.xml

    FSF stands for Feature Selection File. This file is found under Stores\WebContent\WEB-INF\xml\tools\stores\yourStoreName\devtools\flow\fsf\. This file contains the selected change flow features for yourStoreName. When a change flow feature is enabled there will be an entry in this file. If showThumbs feature is enabled you will see <feature id="showThumbs"/> under the <selected-features> node. This file is used to generate the scf.xml described next. To disable the feature simply delete the entry.

  2. scf.xml

    SCF stands for Store Configuration File. This file is found under Stores\WebContent\WEB-INF\xml\tools\stores\yourStoreName\devtools\flow\scf\. This file contains a list all the enabled features for the store. To disable the feature simply delete the entry. This is the file that is actually used at run time.

If you want to enable/disable these change features using Commerce Accelerator, you will need the following files. Replace CommerceAccelerator with CommerceAccelerator.war when working on the server. It is preferred to work with the files in the following order.

  1. notebook.xml

    This file is used to build the left navigation on Commerce Accelerator’s Change Flow page. It is found under WCS_HOME\CommerceAccelerator\WebContent\WEB-INF\xml\tools\stores\B2BDirectStorefrontAssetStore\devtools\flow\. If you need a new section, simply copy and paste one of the lines and make amends. Here is an example of one such lines: <panel parameters="id" url="FlexflowPanelView?panel=NewNamePanel" name="NewNamePanel" helpKey="SS.common.ConfigureStore.Help"/>.  NewName may be replaced with an appropriate name. Notice that the word Panel is left intact for each NewName. Also notice that this is a file under CommerceAccelerator.

  2. NewName.xml

    If you need a new section to be on the Change Flow pages of the accelerator you create a new file called NewName.xml where NewName may be replaced with an appropriate name. This file should be located under WCS_HOME\Stores\WebContent\WEB-INF\xml\tools\stores\B2BDirectStorefrontAssetStore\devtools\flow\ui\. Make sure that this NewName matches with NewName used in notebook.xml in 1. above. This file has some entries that should match the entries in uiconfig.properties file discussed next.

  3. uiconfig.properties

    This file is found under WCS_HOME\properties\tools\stores\yourStoreModel\devtools\flow\. The contents of this file, which are self explanatory, are used to build the accelerator change flow pages. You should use appropriate locale specific version of this file. You can add your new feature under an existing section or a  new section. In case you are creating a new section, simply copy and paste an existing section and make amends. The key here is to use the feature id, such as showThumbs, to build your section.

  4. Features.xml

    This is the file used to declare the feature ids. Example: <feature id="showThumbs"/>. This file is found under WCS_HOME\Stores\WebContent\WEB-INF\xml\tools\stores\yourStoreModel\devtools\flow\repository\Features.xml.

Further references:

  1. WebSphere Commerce Infrastructure Flow: This contains some basic information on change flow infrastructure files and what they mean.
  2. Tutorial: Adding a New Change Flow Feature: This is a tutorial on how you add a new change flow feature. This tutorial is generally good but not up to the mark. There are some missing links and the information, in my opinion, is not well rounded!

Leave a Comment