How to specify which states are successful in a threshold check
When running a threshold check, by default the the threshold check will look for a state called 'Complete'. If it receives an outcome with this value, then it will recognise the outcome as successful. Otherwise, it will assume the outcome is failure. There are two approaches to do this:
By Java Class Injection
It may be that you require to specify your own state matching mechanism for this. In order to do this we simply inject into the spring context a new 'DebulkerThresholdStateOutcome' for example adding this to a config file:
@Bean
public DebulkerThresholdStateOutcome mySuccessMatcher() {
return new DebulkerThresholdStateOutcome("myFlow", "mySuccessState", true);
}
Here for the flow 'myFlow' when it receives the state 'mySuccessState' then it will result in a positive match.
By Configuration
You can define your state outcomes by configuration using the following example:
ipf.debulker.threshold.outcomes = [
{
flowName = "ABC"
stateName = "MatchedOne"
success = false
},
{
flowName = "ABC"
stateName = "MatchedTwo"
success = true
},
]
Here we are setting up two outcomes that will then be used just like the java one defined previously.