Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add a DataStage Project Environment Variable to store the state of our feature toggle. It is recommended that all Feature Toggles follow a naming conventions such as “FEATURE_XXX” to ensure they are easy to identify and remain grouped together in DataStage selection dialogs. In this example, we chose FEATURE_UPGRADED_TARGET:

  2. Create a copy of the job being changed and name it to reflect the logic when the Feature Toggle is on. In this example, we copied the Load job and renamed it to Load_Upgraded:

    Image RemovedImage Added

  3. Rename the job being changed to reflect the logic when the Feature Toggle is off. DataStage may notify you that the job is being referenced by another item, click continue. In this this example, we renamed the Load to Load_Legacy:

    Image RemovedImage Added

  4. Create a new Sequence Job and call it Load. This sequence will be run instead of our original Load job and will run either Load_Legacy or Load_Upgraded when the Feature Toggle is On or Off. Ensure that the Sequence has the same parameters as both Load_Upgraded and Load_Legacy jobs and the “Automatically handle activities that fail” option is set in the Job properties:

    Image RemovedImage Added

  5. Setup the sequence design as follows:

  6. The Load_Upgraded and Load_Legacy job activities call the relevant job versions. All Job Parameters are transferred directly from the Job Sequence Parameters

    Image Removed

...

  1. Image Added

Removing a Feature Toggle

  1. Remove the Sequence Job. In the example, this is called Load

  2. Renamed the job version which contains the intended behavior. In this example, we would rename Load_Upgraded to Load

  3. Remove the job version which is no longer required. In this example, we would remove Load_Legacy

  4. Remove the Project Environment variable. In this example, we would remove FEATURE_UPGRADED_TARGET

Attachments

View file
nameFeatureToggleExample.dsx
View file
nameIsFeatureToggleEnabled.dsx

...