Class BTDataCollectionTemplateWOCreationRuleInsert
java.lang.Object
overit.geocall.bl.BusinessTask<DataCollectionTemplateWOCreationRuleInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DataCollectionTemplateWOCreationRuleInsertEvent>
overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection<DataCollectionTemplateWOCreationRuleInsertEvent>
overit.geocallapp.wfm.mobileforms.bl.rule.task.BTDataCollectionTemplateWOCreationRuleInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DataCollectionTemplateWOCreationRuleInsertEvent.class)
public class BTDataCollectionTemplateWOCreationRuleInsert
extends BTDataCollection<DataCollectionTemplateWOCreationRuleInsertEvent>
Business task in order to insert a
When the
BODataCollectionTemplateWOCreationRule. When the
DataCollectionTemplateWOCreationRuleInsertEvent is launched
the BT notices the call and inserts the BODataCollectionTemplateWOCreationRule basing on the event's input. Permission:
- Since:
- 12.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckExistTemplate(Long template, PoolKit poolKit) Verifies that the specified template exists by attempting to load it.protected voidexecute(DataCollectionTemplateWOCreationRuleInsertEvent event, PoolKit poolKit) Inserts the givenBODataCollectionTemplateWOCreationRuleand writes the newly generated id into the event journal.booleanChecks if the user has the data collection module and theDataCollectionPermission.FSM_DATACOLLECTION_CONFIGURATION_EDITenabled.protected voidvalidateInput(BODataCollectionTemplateWOCreationRule dataCollectionTemplateWOCreationRule, PoolKit poolKit) Validates the input data collection template WO creation rule.Methods inherited from class overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection
getException, 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
-
BTDataCollectionTemplateWOCreationRuleInsert
public BTDataCollectionTemplateWOCreationRuleInsert()
-
-
Method Details
-
isValidExecution
public boolean isValidExecution()Checks if the user has the data collection module and theDataCollectionPermission.FSM_DATACOLLECTION_CONFIGURATION_EDITenabled.- Specified by:
isValidExecutionin interfaceValidExecution- Overrides:
isValidExecutionin classBTDataCollection<DataCollectionTemplateWOCreationRuleInsertEvent>- Returns:
- true, if the module and the permission are active, false otherwise
-
execute
protected void execute(DataCollectionTemplateWOCreationRuleInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBODataCollectionTemplateWOCreationRuleand writes the newly generated id into the event journal.- Specified by:
executein classValidExecutionBusinessTask<DataCollectionTemplateWOCreationRuleInsertEvent>- Parameters:
event- theDataCollectionTemplateWOCreationRuleInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateInput
protected void validateInput(BODataCollectionTemplateWOCreationRule dataCollectionTemplateWOCreationRule, PoolKit poolKit) throws DAValidateException, DAException Validates the input data collection template WO creation rule. Sets active to true if null, validates required fields, checks template existence, and ensures rule uniqueness.- Parameters:
dataCollectionTemplateWOCreationRule- the rule to validatepoolKit- the pool kit for database operations- Throws:
DAValidateException- if validation fails (missing required fields or duplicate rule)DAException- if a database error occurs
-
checkExistTemplate
protected void checkExistTemplate(Long template, PoolKit poolKit) throws DAValidateException, DAException Verifies that the specified template exists by attempting to load it.- Parameters:
template- the template ID to checkpoolKit- the pool kit for database operations- Throws:
DAValidateException- if the template does not existDAException- if a database error occurs
-