Class WorkflowService

java.lang.Object
ai.nervemind.app.service.WorkflowService
All Implemented Interfaces:
ai.nervemind.common.service.WorkflowServiceInterface

@Service @Transactional public class WorkflowService extends Object implements ai.nervemind.common.service.WorkflowServiceInterface
Service for managing workflows.
  • Constructor Details

    • WorkflowService

      public WorkflowService(WorkflowRepository workflowRepository, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.springframework.beans.factory.ObjectProvider<FileWatcherService> fileWatcherServiceProvider)
      Creates a new WorkflowService with the required dependencies.
      Parameters:
      workflowRepository - the repository for workflow data access
      objectMapper - the object mapper for JSON serialization
      fileWatcherServiceProvider - provider for file watcher service
  • Method Details

    • findAll

      public List<ai.nervemind.common.dto.WorkflowDTO> findAll()
      Specified by:
      findAll in interface ai.nervemind.common.service.WorkflowServiceInterface
    • findById

      public Optional<ai.nervemind.common.dto.WorkflowDTO> findById(Long id)
      Specified by:
      findById in interface ai.nervemind.common.service.WorkflowServiceInterface
    • findByName

      public Optional<ai.nervemind.common.dto.WorkflowDTO> findByName(String name)
      Find a workflow by its exact name.
      Parameters:
      name - the exact name to search for
      Returns:
      an Optional containing the workflow DTO if found
    • findByTriggerType

      public List<ai.nervemind.common.dto.WorkflowDTO> findByTriggerType(ai.nervemind.common.enums.TriggerType triggerType)
      Specified by:
      findByTriggerType in interface ai.nervemind.common.service.WorkflowServiceInterface
    • findActiveScheduledWorkflows

      public List<ai.nervemind.common.dto.WorkflowDTO> findActiveScheduledWorkflows()
      Find all active scheduled workflows.
      Returns:
      a list of active scheduled workflow DTOs
    • create

      public ai.nervemind.common.dto.WorkflowDTO create(ai.nervemind.common.dto.WorkflowDTO dto)
      Specified by:
      create in interface ai.nervemind.common.service.WorkflowServiceInterface
    • update

      public ai.nervemind.common.dto.WorkflowDTO update(ai.nervemind.common.dto.WorkflowDTO dto)
      Specified by:
      update in interface ai.nervemind.common.service.WorkflowServiceInterface
    • delete

      public void delete(Long id)
      Specified by:
      delete in interface ai.nervemind.common.service.WorkflowServiceInterface
    • duplicate

      public ai.nervemind.common.dto.WorkflowDTO duplicate(Long id)
      Specified by:
      duplicate in interface ai.nervemind.common.service.WorkflowServiceInterface
    • setActive

      public void setActive(Long id, boolean active)
      Specified by:
      setActive in interface ai.nervemind.common.service.WorkflowServiceInterface