How does riskRankCalculator work?

Mat10
Tera Contributor

There's a business rule provided OOB that looks at risk Probability and Impact and uses riskRankCalculator to calculate the risk ranking and value.
What does this function actually do and can I reuse it with other fields?
e.g. I want to create residual risk probability and impact and calculate the residual ranking.

Here's the full business rule:

 

(function executeRule(current, previous /*null when async*/ ) {
    if (!previous || (current.risk_rank == previous.risk_rank) || (current.risk_value == previous.risk_value)) {
        var riskRankCalculator = new RiskRankCalculator();
        var result = riskRankCalculator.getRiskRankDetails(current.riskId, current.impact, current.probability);
		current.risk_rank = result.rank;
        current.risk_value = result.value;
	}
})(current, previous);

 

If I try to duplicate this and change the names to match my new fields it doesn't do anything.

0 REPLIES 0