The following practices are coming from several consultants:
GIT
- must be used by everybody on the project
- if customer is co-operating on the project, they must use it as well
- everybody commits their changes to GIT
- nobody does the changes directly to the partition (without committing to GIT as well)
- the actual version (of the configuration) from GIT can be deployed to the partition at any time
Such approach helps to avoid overrides and solve collisions.
Note: It would be good to have a Role to be able to see the logics in the ReadOnly mode.
Check of the Inputs (from User and Data tables)
- if it is allowed to have missing or wrong values, then we can solve it by Alerts (Yellow, Red, Critical), eventually use api.abortCalculation()
- if configuration data is missing, and calculation does not make sense without them, we can use api.throwException()
- we can make additional field, which shows to the user the reasons for the Alert
- Sample
def priceType = "CostPlus" def price = null def reason = "Unknown error" def targetMargin = api.getElement("TargetMargin") if (targetMargin) { def vat = api.getElement("VAT") def cost = api.getElement("Cost") if (cost && vat != null) { price = cost * targetMargin * (1 + vat) reason = "OK" } else { reason = "No Average or Calculated cost price in PX Cost_RRP or VAT defined" api.redAlert(reason) } } else { reason = "No target margin defined" api.redAlert(reason) } api.local.reason = reason return price