Basket calculation - two gross calculations for two organizations

71 Views Asked by At

Structurally there is one project with two organizations. Each organization "resides" in own cartridges.

There are two gross calculations created, each has own rule set and both are registered in Component Framework.

With this configuration second defined calculation overrides first one.


How can that be architecturally solved - to separate basket calculation based on organization?

Or i will need to have one gross calculation with one rule set and in that set different rules with analyzing site/app and moving this calculation classes to some common cartridge for both organizations?

2

There are 2 best solutions below

0
Ronny Wilms On

With the described preconditions you can go into the direction @johannes-metzner pointed you.

The basket calculation resolves the RuleSet implementation by its name, which is resolved by a call to a pipeline extension point.

So you could try to provide own implementations for the pipeline extenstion point ProcessBasketCalculation-GetRuleSet with higher priority then the default implementation. The implementation has to return the RuleSetName specific for your organization. The calculation should then resolve the RuleSet behind and use it for the calculation.

0
user2575814 On

You can also provide different implementation app specific. So for app X in org1 you can bind your Ruleset A and for app Y in org2 you can bind Ruleset B.