Class BTInterventionMeasureCheck
java.lang.Object
overit.geocall.bl.BusinessTask<InterventionMeasureCheckEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.intervention.measure.task.BTInterventionMeasureCheck
- All Implemented Interfaces:
Serializable,Tool
@Event(InterventionMeasureCheckEvent.class)
public class BTInterventionMeasureCheck
extends BusinessTask<InterventionMeasureCheckEvent>
Business task that checks that all intervention measures are validated in order proceed with the intervention outcome.
When the InterventionMeasureCheckEvent is launched the BT notices the call and checks the intervention measures.
Error codes:
- Since:
- 20.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(InterventionMeasureCheckEvent event, PoolKit pk) Validates the intervention measures according to census rules.protected voidcheckMandatoryMeasures(BOIntervention intervention, List<BOMeasuringElement> measuringElements, List<BOCensusRule> rules, PoolKit poolKit) Checks if all mandatory measuring elements have at least one validated measure for the intervention.protected WorkOrdersIntegrationServiceRetrieves theWorkOrdersIntegrationServiceinstance.protected List<BOCensusRule> getInterventionMeasureCensusRules(BOIntervention intervention, PoolKit poolKit) Loads the active census rules of type measures associated with the given intervention.protected List<BOMeasuringElement> getInterventionMeasuringElements(BOIntervention intervention, PoolKit pk) Loads all measuring elements associated with the intervention's address.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTInterventionMeasureCheck
public BTInterventionMeasureCheck()
-
-
Method Details
-
getIntegrationService
Retrieves theWorkOrdersIntegrationServiceinstance. If the instance hasn't been created yet, it will be created and stored for future use.- Parameters:
pk- ThePoolKit.- Returns:
- The
WorkOrdersIntegrationServiceinstance. - Throws:
DAValidateException- If any validation error occurs.
-
body
protected void body(InterventionMeasureCheckEvent event, PoolKit pk) throws DAException, DAValidateException Validates the intervention measures according to census rules.The method performs the following steps:
- Loads census rules for the intervention
- Loads measuring elements associated with the intervention
- If rules exist, checks that all mandatory measures are validated
- Specified by:
bodyin classBusinessTask<InterventionMeasureCheckEvent>- Parameters:
event- theInterventionMeasureCheckEventcontaining the intervention to checkpk- thePoolKit- Throws:
DAValidateException- if mandatory measures are missing or invalidDAException- the DA exception
-
checkMandatoryMeasures
protected void checkMandatoryMeasures(BOIntervention intervention, List<BOMeasuringElement> measuringElements, List<BOCensusRule> rules, PoolKit poolKit) throws DAValidateException, DAException Checks if all mandatory measuring elements have at least one validated measure for the intervention.The method performs the following steps:
- Collects mandatory catalog groups and characteristics from the rules
- For each measuring element, checks if it belongs to a mandatory group or has mandatory characteristics
- For mandatory elements, verifies existence of at least one validated measure for the intervention
- Parameters:
intervention- theBOInterventionto check measures formeasuringElements- the list ofBOMeasuringElementto validaterules- the list ofBOCensusRulecontaining mandatory requirementspoolKit- thePoolKit- Throws:
DAValidateException- withCodes.InterventionMeasure.MISSING_MANDATORY_MEASUREif a mandatory measure is missing, orCodes.InterventionMeasure.INVALID_MEASURES_VALIDATEDif multiple validated measures exist for the same elementDAException- if a data access error occurs
-
getInterventionMeasuringElements
protected List<BOMeasuringElement> getInterventionMeasuringElements(BOIntervention intervention, PoolKit pk) throws DAValidateException, DAException Loads all measuring elements associated with the intervention's address.The method performs the following steps:
- Gets the work order operation from the intervention
- Gets the work order header from the operation
- Gets the address from the work order
- Searches for all measuring elements at that address that are working
- Parameters:
intervention- theBOInterventionto load measuring elements forpk- thePoolKit- Returns:
- the list of
BOMeasuringElementfound at the intervention address - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getInterventionMeasureCensusRules
protected List<BOCensusRule> getInterventionMeasureCensusRules(BOIntervention intervention, PoolKit poolKit) throws DAValidateException, DAException Loads the active census rules of type measures associated with the given intervention.- Parameters:
intervention- theBOInterventionto load rules forpoolKit- thePoolKit- Returns:
- the list of
BOCensusRuleassociated with the intervention - Throws:
DAValidateException- the DA validate exceptionDAException
-