Class BTDynamicFormsSheetAutomaticInitializationFromOutcome
java.lang.Object
overit.geocall.bl.BusinessTask<DynamicFormsSheetAutomaticInitializationFromOutcomeEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DynamicFormsSheetAutomaticInitializationFromOutcomeEvent>
overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection<DynamicFormsSheetAutomaticInitializationFromOutcomeEvent>
overit.geocallapp.wfm.mobileforms.bl.sheet.task.BTDynamicFormsSheetAutomaticInitializationFromOutcome
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DynamicFormsSheetAutomaticInitializationFromOutcomeEvent.class)
public class BTDynamicFormsSheetAutomaticInitializationFromOutcome
extends BTDataCollection<DynamicFormsSheetAutomaticInitializationFromOutcomeEvent>
Business task to automatically initialize Dynamic Froms Sheets from outcome.
This task creates Dynamic Forms Sheets for all templates that are marked as "auto generable from mobile" in the Mobile Card configuration and have an outcome rule with the "required if auto-generable" flag set to true for the specified outcome reason.
Algorithm:
- Launch
DynamicFormsTemplateAutoGenerableRequiredSearchEventto search if there are some Dynamic Form Templates configured as 'auto generable' in Dynamic Forms Outcome Rules for which there are no available Dynamic Form Sheets. - For each template ID, create a new Dynamic Forms Sheet
- Associate the sheet with the work order operation using
DataCollectionTemplateInsertSheetFromWOOperationEvent
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildInsertInput(BODataCollectionSheet sheet, Long templateId, Long workOrderOperation) Builds the input for inserting a sheet from work order operation.Builds the search input for missing auto generable templates.protected voidcreateAndAssociateSheet(BODataCollectionTemplateHeader template, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) Creates a new Dynamic Forms Sheet and associates it with the work order operation.protected BODataCollectionSheetcreateSheet(BODataCollectionTemplateHeader template, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input) Creates a new data collection sheet instance.protected voidcreateSheetsForTemplates(Collection<DataCollectionTemplateRelease> templates, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) Creates sheets for all the given templates.protected voidexecute(DynamicFormsSheetAutomaticInitializationFromOutcomeEvent event, PoolKit poolKit) Automatically initialize Dynamic Forms Sheets for missing auto generable templates.protected voidinsertSheetFromWorkOrderOperation(DataCollectionTemplateInsertSheetFromWOOperationInput insertInput, PoolKit poolKit) Inserts a sheet from work order operation.protected Collection<DataCollectionTemplateRelease> launchTemplateSearch(DynamicFormsTemplateAutoGenerableRequiredSearchInput searchInput, PoolKit poolKit) Launches the template search event.protected Collection<DataCollectionTemplateRelease> searchMissingAutoGenerableTemplates(DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) Searches for missing auto generable templates that need to be initialized.Methods inherited from class overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection
getException, isValidExecution, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, checkValidExecution, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTDynamicFormsSheetAutomaticInitializationFromOutcome
public BTDynamicFormsSheetAutomaticInitializationFromOutcome()
-
-
Method Details
-
execute
protected void execute(DynamicFormsSheetAutomaticInitializationFromOutcomeEvent event, PoolKit poolKit) throws DAException, DAValidateException Automatically initialize Dynamic Forms Sheets for missing auto generable templates.- Specified by:
executein classValidExecutionBusinessTask<DynamicFormsSheetAutomaticInitializationFromOutcomeEvent>- Parameters:
event- theDynamicFormsSheetAutomaticInitializationFromOutcomeEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
searchMissingAutoGenerableTemplates
protected Collection<DataCollectionTemplateRelease> searchMissingAutoGenerableTemplates(DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) throws DAValidateException, DAException Searches for missing auto generable templates that need to be initialized.- Parameters:
input- the input containing intervention group, outcome reason, and work order operationpoolKit- the pool kit- Returns:
- collection of missing DataCollectionTemplateRelease objects
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
buildSearchInput
protected DynamicFormsTemplateAutoGenerableRequiredSearchInput buildSearchInput(DynamicFormsSheetAutomaticInitializationFromOutcomeInput input) Builds the search input for missing auto generable templates.- Parameters:
input- the input containing intervention group, outcome reason, and work order operation- Returns:
- the search input
-
launchTemplateSearch
protected Collection<DataCollectionTemplateRelease> launchTemplateSearch(DynamicFormsTemplateAutoGenerableRequiredSearchInput searchInput, PoolKit poolKit) throws DAException, DAValidateException Launches the template search event.- Parameters:
searchInput- the search inputpoolKit- the pool kit- Returns:
- collection of missing DataCollectionTemplateRelease objects
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertSheetFromWorkOrderOperation
protected void insertSheetFromWorkOrderOperation(DataCollectionTemplateInsertSheetFromWOOperationInput insertInput, PoolKit poolKit) throws DAException, DAValidateException Inserts a sheet from work order operation.- Parameters:
insertInput- the insert inputpoolKit- the pool kit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createSheetsForTemplates
protected void createSheetsForTemplates(Collection<DataCollectionTemplateRelease> templates, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) throws DAException, DAValidateException Creates sheets for all the given templates.- Parameters:
templates- the collection of templatesinput- the input containing WO operation and operation centerpoolKit- the pool kit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createAndAssociateSheet
protected void createAndAssociateSheet(BODataCollectionTemplateHeader template, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input, PoolKit poolKit) throws DAValidateException, DAException Creates a new Dynamic Forms Sheet and associates it with the work order operation.- Parameters:
template- the templateinput- the input containing WO operation and operation centerpoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
createSheet
protected BODataCollectionSheet createSheet(BODataCollectionTemplateHeader template, DynamicFormsSheetAutomaticInitializationFromOutcomeInput input) Creates a new data collection sheet instance.- Parameters:
template- the templateinput- the input containing operation center- Returns:
- the created sheet
-
buildInsertInput
protected DataCollectionTemplateInsertSheetFromWOOperationInput buildInsertInput(BODataCollectionSheet sheet, Long templateId, Long workOrderOperation) Builds the input for inserting a sheet from work order operation.- Parameters:
sheet- the sheet to inserttemplateId- the template IDworkOrderOperation- the work order operation ID- Returns:
- the insert input
-