Class BTLoanResourceSkillAlign
java.lang.Object
overit.geocall.bl.BusinessTask<ResourceSkillNotificationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ResourceSkillNotificationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ResourceSkillNotificationEvent>
overit.geocallapp.wfm.resources.bl.resource.loan.task.BTLoanResourceSkillAlign
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ResourceSkillNotificationEvent.class)
public class BTLoanResourceSkillAlign
extends ValidPermissionBusinessTask<ResourceSkillNotificationEvent>
Business task that aligns the loaned resources with the skills currently associated to the source resource.
When the
When the
ResourceSkillNotificationEvent event is launched the BT notices the call and aligns the BOResourceSkills of the loaned resources with the ones of the source resource basing on the event's input. - Since:
- 18.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 voidalignLoanResourceSkill(NotificationInput<BOResourceSkill> input, PoolKit poolKit) Align the skills of the loan resources.protected voiddeleteResourceSkill(BOResourceSkill loanResourceSkill, PoolKit poolKit) Deletes a resource skill associationprotected voidexecute(ResourceSkillNotificationEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected BOResourceSkillgetLoanResourceSkill(BOResourceSkill resourceSkill, BOResource loanResource) Creates a newBOResourceSkillfor loan resourceprotected voidinsertResourceSkill(BOResourceSkill loanResourceSkill, PoolKit poolKit) Inserts a new resource skill associationbooleanDetermines whether the current state is valid for execution.protected BOResourceloadResource(Long resourceId, PoolKit poolKit) Loads the given resourceIdprotected List<BOResource> searchLoanResources(BOResourceSkill resourceSkill, PoolKit poolKit) Searches for loan resources with copy competences flag associated with the given source resource.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
-
BTLoanResourceSkillAlign
public BTLoanResourceSkillAlign()
-
-
Method Details
-
execute
protected void execute(ResourceSkillNotificationEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<ResourceSkillNotificationEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
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
-
loadResource
protected BOResource loadResource(Long resourceId, PoolKit poolKit) throws DAValidateException, DAException Loads the given resourceId- Parameters:
resourceId- resource id to be loadedpoolKit- thePoolKit- Returns:
- the
BOResource - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
alignLoanResourceSkill
protected void alignLoanResourceSkill(NotificationInput<BOResourceSkill> input, PoolKit poolKit) throws DAException, DAValidateException Align the skills of the loan resources. The method searches for the loan resources and for each resource aligns the skill passed inNotificationInputobject to the original resource- Parameters:
input- theNotificationInputobjectpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
searchLoanResources
protected List<BOResource> searchLoanResources(BOResourceSkill resourceSkill, PoolKit poolKit) throws DAException, DAValidateException Searches for loan resources with copy competences flag associated with the given source resource.- Parameters:
resourceSkill- theBOResourceSkillused to search the loan resourcespoolKit- thePoolKit- Returns:
- a list of loan resources associated with the source resource
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getLoanResourceSkill
protected BOResourceSkill getLoanResourceSkill(BOResourceSkill resourceSkill, BOResource loanResource) throws DAException, DAValidateException Creates a newBOResourceSkillfor loan resource- Parameters:
resourceSkill- theBOResourceSkillused to get the skill dataloanResource- theBOResourceused to get the loan resource data- Returns:
- a
BOResourceSkillwith the skill of loan resource - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertResourceSkill
protected void insertResourceSkill(BOResourceSkill loanResourceSkill, PoolKit poolKit) throws DAException, DAValidateException Inserts a new resource skill association- Parameters:
loanResourceSkill- theBOResourceSkillto be insertedpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
deleteResourceSkill
protected void deleteResourceSkill(BOResourceSkill loanResourceSkill, PoolKit poolKit) throws DAException, DAValidateException Deletes a resource skill association- Parameters:
loanResourceSkill- theBOResourceSkillto be deletedpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-