Class BTInterventionMeasureLink
java.lang.Object
overit.geocall.bl.BusinessTask<InterventionMeasureLinkEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<InterventionMeasureLinkEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<InterventionMeasureLinkEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.intervention.measure.task.BTInterventionMeasureLink
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(InterventionMeasureLinkEvent.class)
public class BTInterventionMeasureLink
extends ValidPermissionBusinessTask<InterventionMeasureLinkEvent>
Business task in order to link a
When the
BOMeasure to an intervention. When the
InterventionMeasureLinkEvent is launched the BT notices the call and
updates the BOMeasure intervention reference according to the event's input. Permissions:
Error codes:
- Since:
- 20.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(InterventionMeasureLinkEvent event, PoolKit pk) Updates theBOMeasureobject linking the intervention.protected WorkOrdersIntegrationServiceRetrieves theWorkOrdersIntegrationServiceinstance.booleanDetermines whether the current state is valid for execution.protected voidValidates the measure data.protected voidvalidateWorkOrderStatus(BOWorkOrderHeader workOrder) Validates that the work order is in a valid status.Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTInterventionMeasureLink
public BTInterventionMeasureLink()
-
-
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.
-
execute
protected void execute(InterventionMeasureLinkEvent event, PoolKit pk) throws DAException, DAValidateException Updates theBOMeasureobject linking the intervention.- Specified by:
executein classValidExecutionBusinessTask<InterventionMeasureLinkEvent>- Parameters:
event- theInterventionMeasureLinkEventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
Validates the measure data.Performs the following validations:
- Checks if the intervention reference exists
- Checks if the measuring element reference exists
- Ensures the intervention is in a valid status for measure insertion
- Ensures the measuring element technical object matches the intervention technical object
- Ensures the measuring element matches at least one census rule's criteria
- Parameters:
measure- the measure to validatepk- thePoolKit- Throws:
DAValidateException- if the measure is invalid or addresses don't matchDAException- if a data access error occurs
-
validateWorkOrderStatus
Validates that the work order is in a valid status. Throws an exception if the work order is in CLOSED, TECHNICALLY_CLOSED, CANCELLED or ALIGNED status.- Parameters:
workOrder- the work order header to validate- Throws:
DAValidateException- if the work order is in an invalid status
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-