Extending WHS – Adding a new location directive strategy


To create a new location directive strategy, follow these steps:

  1. Create an enum extension of the WhsLocDirStrategy enum. Add an entry with name and label for your strategy.
  2. Create a class extending the WhsLocationDirectiveStrategy abstract class. Implement the performStrategy() method
  3. Decorate your new class with the WhsLocationDirectiveStrategyFactoryAttribute, linking your class and enum entry together.

Notice: The strategies are instantiated only once each – following the singleton pattern. This means your strategy class must not contain any state.

Here is a diagram showing the extension points:

Here is an example:

THIS POST APPLIES TO MICROSOFT DYNAMICS FOR OPERATIONS SPRING 2017 PREVIEW; IS PROVIDED AS-IS AND CONFERS NO RIGHTS.


Comments (0)

Skip to main content