To create a new location directive strategy, follow these steps:
- Create an enum extension of the WhsLocDirStrategy enum. Add an entry with name and label for your strategy.
- Create a class extending the WhsLocationDirectiveStrategy abstract class. Implement the performStrategy() method
- 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.