Friday, March 14, 2014

CSS Override causing validation errors during migration from 6.2 to 7.5



Problem Statement

When you import any process artifact from Teamworks 6.2 into IBM BPM 7.5, that has coach(s) containing CSS override, it creates a validation error. The error is marked on an empty web-app file that looks similar to “<#=tw.local.css#>”.

Why is this problem encountered

In Teamworks 6.2, you could provide CSS overrides by providing path to the CSS file in the “CSS Override” field. Often this path was fetched from an EPV, local variable or localization resources. The value was passed using the “<#= #>” notation. An illustration of is shown below:




Whereas in IBM BPM 7.5, you cannot use variables (EPV, Localization or Local) to specify the CSS override. You select one of the “Managed Files” as your CSS override. This is outlined below :



Therefore, when you import a service with a coach from 6.2 and import it into 7.5, it tries to fetch the contents of the CSS file by using the contents inside the CSS override box. But, instead of evaluating the variable’s value, it uses it literally as it is. Hence, it cannot find the CSS file’s contents and ends up creating an empty managed file, with a pointer to that empty file in the coach.

 Using approach taken by IBM BPM 7.5 may not be preferable because of one or more of the following reasons:
  1. Your CSS files are not maintained as managed files. Instead they are kept on the web-server or some content management system.
  2. You want the flexibility of using different CSS files based upon the user preferences (Themes).
  3. You want the look and feel to be uniform and easily customizable (hence you choose to store the CSS override file’s location in an EPV)

How to resolve the issue

The simplest way to resolve this is as follows.
  1. Delete the empty file created through the import.
  2. Note down the variable used for CSS override. For example “tw.epv.UAM.PNCCSS”.
  3. Go to the CSS tab for the coach and use the @import syntax as shown below@import url('<#= tw.epv.UAM.PNCCSS + "" #>')
  4. Remove the link to the empty file in CSS Override.