Class BTBatch<I,O,E extends SimpleBusinessEvent<I,O>,B extends BatchEvent<I,O>>
java.lang.Object
overit.geocall.bl.BusinessTask<B>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<B>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<B>
overit.geocallapp.utilities.core.bl.common.batch.task.BTBatch<I,O,E,B>
- Type Parameters:
I- the type of input items to be processedO- the type of output items produced by processingE- the type of business event used to process each input itemB- the type of batch event containing the collection of input items
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
- Direct Known Subclasses:
BTAccountInsertBatch,BTAddressGeocodingSaveBatch,BTAddressInsertBatch,BTAddressUpdateBatch,BTAssetCharacteristicValueInsertBatch,BTAssetCharacteristicValueUpdateBatch,BTAssetChildInsertBatch,BTAssetInsertBatch,BTAssetTypeTemplateCharacteristicInsertBatch,BTAssetTypeTemplateCharacteristicUpdateBatch,BTAssetUpdateBatch,BTLinearAssetLocationUpdateBatch,BTMeasureInsertBatch,BTMeasureRejectBatch,BTMeasureUpdateBatch,BTMeasureValidateBatch,BTMeterInsertBatch,BTMeterUpdateBatch,BTMobileErrorLogInsertBatch,BTWorkOrderOperationInsertBatch,BTWorkOrderOperationUpdateBatch,BTWorkShiftExceptionDeleteBatch,BTWorkShiftExceptionInsertBatch,BTWorkShiftExceptionUpdateBatch
public abstract class BTBatch<I,O,E extends SimpleBusinessEvent<I,O>,B extends BatchEvent<I,O>>
extends ValidPermissionBusinessTask<B>
Abstract base class for batch processing tasks that execute multiple business events.
This class provides a framework for processing a collection of input items through individual business events and collecting their results. It handles the creation and execution of business events for each input item in the batch.
This class provides a framework for processing a collection of input items through individual business events and collecting their results. It handles the creation and execution of business events for each input item in the batch.
- Since:
- 1.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidExecutes the batch processing by iterating through all input items in the batch event.protected OexecuteEvent(Class<E> eventClass, I eventInput, PoolKit poolKit) Executes a single business event for an individual input item.Returns the class of the business event to be used for processing each input item.protected Constructor<E> getEventConstructor(Class<E> eventClass, Class<?> inputClass) booleanDetermines whether the batch task is valid for execution.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
-
Field Details
-
LOG
-
-
Constructor Details
-
BTBatch
public BTBatch()
-
-
Method Details
-
execute
Executes the batch processing by iterating through all input items in the batch event. For each input item, this method creates and executes a business event of type E, collects the results, and adds them to the batch output. The final collection of results is written to the event journal.- Specified by:
executein classValidExecutionBusinessTask<B extends BatchEvent<I,O>> - Parameters:
event- the batch event containing the collection of input items to processpoolKit- the database connection pool kit- Throws:
DAException- if a data access error occurs during processingDAValidateException- if a validation error occurs during processing
-
getBusinessEventClass
Returns the class of the business event to be used for processing each input item. This method must be implemented by subclasses to specify which business event class should be instantiated for each input item in the batch.- Returns:
- the class object representing the business event type
-
executeEvent
protected O executeEvent(Class<E> eventClass, I eventInput, PoolKit poolKit) throws DAException, DAValidateException Executes a single business event for an individual input item. This method creates a new instance of the specified business event class using reflection, initializes it with the provided input, and launches the event to process the input and produce a result.- Parameters:
eventClass- the class of the business event to instantiateeventInput- the input item to processpoolKit- the database connection pool kit- Returns:
- the result of processing the input item
- Throws:
DAException- if a data access error occurs during processingDAValidateException- if a validation error occurs during processing
-
getEventConstructor
-
isValidExecution
public boolean isValidExecution()Determines whether the batch task is valid for execution. This implementation always returns true, indicating that batch tasks are always valid for execution. Subclasses can override this method to implement specific validation logic if needed.- Returns:
- true, indicating that the batch task is valid for execution
-