Class BTSchedulableActivitiesSearch

All Implemented Interfaces:
Serializable, Tool, ValidExecution

Business task for searching schedulable activities in the daily plan.

This task performs a comprehensive search of work order operations that can be scheduled, applying various filters including operation centers, work orders, request types, service types, technical object types, activities, and operation statuses. The search supports date range filtering and pagination.

Required fields:

  • None - all filter fields are optional

Permission:

Since:
22.0
See Also:
GCApi:
task
  • Field Details

  • Constructor Details

    • BTSchedulableActivitiesSearch

      public BTSchedulableActivitiesSearch()
  • Method Details

    • execute

      protected void execute(SchedulableActivitiesSearchEvent event, PoolKit poolKit) throws DAException, DAValidateException
      Executes the search for schedulable activities.
      Specified by:
      execute in class ValidExecutionBusinessTask<SchedulableActivitiesSearchEvent>
      Parameters:
      event - the SchedulableActivitiesSearchEvent
      poolKit - the PoolKit
      Throws:
      DAException - the DA exception
      DAValidateException - the DA validate exception
    • initializeRelatedEntities

      protected void initializeRelatedEntities(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAValidateException, DAException
      Initializes related entities by searching for all filter-related business objects.

      This method performs searches for operation centers, work order headers, operation statuses, request types, service types, technical object types, and activities based on the provided filter. The results are stored in the corresponding filter fields for later use in query construction.

      Parameters:
      filter - the search filter containing the criteria
      poolKit - the pool kit for database access
      Throws:
      DAValidateException - if validation fails during entity searches
      DAException - if a database error occurs during entity searches
    • searchOperationCenters

      protected void searchOperationCenters(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAValidateException, DAException
      Searches for operation centers based on the filter criteria.

      If operation center IDs are specified in the filter, this method retrieves the corresponding operation center business objects and stores them in operationCenterFilters.

      Parameters:
      filter - the search filter containing operation center IDs
      poolKit - the pool kit for database access
      Throws:
      DAValidateException - if validation fails during the search
      DAException - if a database error occurs during the search
    • searchWorkOrderHeaders

      protected void searchWorkOrderHeaders(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for work order headers based on the filter criteria.

      This method searches for work orders by ID, source, or urgency. If any matching work orders are found, they are stored in workOrderHeaderFilters.

      Parameters:
      filter - the search filter containing work order criteria
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchWorkOrderOperationStatus

      protected void searchWorkOrderOperationStatus(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for work order operation statuses based on the filter criteria.

      If operation status IDs are specified in the filter, this method retrieves the corresponding status business objects and stores them in operationStatusFilters.

      Parameters:
      filter - the search filter containing operation status IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchRequestTypes

      protected void searchRequestTypes(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for request types based on the filter criteria.

      If request type IDs are specified in the filter, this method retrieves the corresponding request type business objects and stores them in requestTypeFilters.

      Parameters:
      filter - the search filter containing request type IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchServiceTypes

      protected void searchServiceTypes(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for service types based on the filter criteria.

      If service type IDs are specified in the filter, this method retrieves the corresponding service type business objects and stores them in serviceTypeFilters.

      Parameters:
      filter - the search filter containing service type IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchTechnicalObjectTypes

      protected void searchTechnicalObjectTypes(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for technical object types (assets and accounts) based on the filter criteria.

      This method combines both account type IDs and asset type IDs from the filter and retrieves the corresponding technical object type business objects, storing them in technicalObjectTypeFilters.

      Parameters:
      filter - the search filter containing account type and asset type IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchTechnicalObjects

      protected void searchTechnicalObjects(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Throws:
      DAException
      DAValidateException
    • searchAddresses

      protected void searchAddresses(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for addresses based on the filter criteria.

      If address IDs are specified in the filter, this method retrieves the corresponding address business objects and stores them in addressFilters.

      Parameters:
      filter - the search filter containing address IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • searchActivities

      protected void searchActivities(SchedulableActivitiesSearchFilter filter, PoolKit poolKit) throws DAException, DAValidateException
      Searches for activities based on the filter criteria.

      If activity IDs are specified in the filter, this method retrieves the corresponding activity business objects and stores them in activityFilters.

      Parameters:
      filter - the search filter containing activity IDs
      poolKit - the pool kit for database access
      Throws:
      DAException - if a database error occurs during the search
      DAValidateException - if validation fails during the search
    • convertFilterToParams

      protected Map<String,Object> convertFilterToParams(SchedulableActivitiesSearchFilter filter)
      Converts the filter to search parameters for the DAO query.

      This method transforms the filter objects (operation centers, work orders, etc.) into a map of search parameters that can be used by DAOSearchSchedulingActivities. It extracts IDs from the filtered business objects and includes date range parameters.

      Parameters:
      filter - the search filter to convert
      Returns:
      a map of search parameters for the DAO query
    • executeQuery

      protected DBView executeQuery(PoolKit poolKit, Map<String,Object> searchParams, Page page) throws DAException, DAValidateException
      Executes the query to search for schedulable activities.

      This method uses DAOSearchSchedulingActivities to perform the database query with the provided search parameters and pagination settings. After executing the query, it calls

      invalid reference
      #completeSchedulingActivitiesDBView(DBView)
      to allow for additional data enrichment.
      Parameters:
      poolKit - the pool kit for database access
      searchParams - the search parameters map
      page - the pagination settings
      Returns:
      the DBView containing the query results
      Throws:
      DAException - if a database error occurs during the query
      DAValidateException - if validation fails during the query
    • isValidExecution

      public boolean isValidExecution()
      Description copied from interface: ValidExecution
      Determines whether the current state is valid for execution.
      Returns:
      true if execution is valid, false otherwise