-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d282cfc
commit 1f93ca6
Showing
32 changed files
with
579 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 17 additions & 1 deletion
18
...c/main/java/io/flexwork/modules/teams/repository/WorkflowTransitionHistoryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
package io.flexwork.modules.teams.repository; | ||
|
||
import io.flexwork.modules.teams.domain.WorkflowTransitionHistory; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface WorkflowTransitionHistoryRepository | ||
extends JpaRepository<WorkflowTransitionHistory, Long> {} | ||
extends JpaRepository<WorkflowTransitionHistory, Long> { | ||
|
||
/** | ||
* Finds and sorts the workflow transition history for a specific team request. | ||
* | ||
* @param teamRequestId the ID of the team request | ||
* @return a list of WorkflowTransitionHistory sorted by transitionDate | ||
*/ | ||
@Query( | ||
"SELECT wth FROM WorkflowTransitionHistory wth " | ||
+ "WHERE wth.teamRequest.id = :teamRequestId " | ||
+ "ORDER BY wth.transitionDate ASC") | ||
List<WorkflowTransitionHistory> findByTeamRequestId(@Param("teamRequestId") Long teamRequestId); | ||
} |
24 changes: 23 additions & 1 deletion
24
server/src/main/java/io/flexwork/modules/teams/repository/WorkflowTransitionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
package io.flexwork.modules.teams.repository; | ||
|
||
import io.flexwork.modules.teams.domain.WorkflowState; | ||
import io.flexwork.modules.teams.domain.WorkflowTransition; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface WorkflowTransitionRepository extends JpaRepository<WorkflowTransition, Long> {} | ||
public interface WorkflowTransitionRepository extends JpaRepository<WorkflowTransition, Long> { | ||
/** | ||
* Finds all valid target workflow states for a given workflow and current state. | ||
* | ||
* @param workflowId the ID of the workflow | ||
* @param sourceStateId the name of the current state | ||
* @return a list of WorkflowState objects representing valid target states | ||
*/ | ||
@Query( | ||
"SELECT ws FROM WorkflowState ws " | ||
+ "JOIN WorkflowTransition wt ON ws.id = wt.targetState.id " | ||
+ "WHERE wt.workflow.id = :workflowId AND wt.sourceState.id = :sourceStateId") | ||
List<WorkflowState> findValidTargetStates( | ||
@Param("workflowId") Long workflowId, @Param("sourceStateId") Long sourceStateId); | ||
|
||
Optional<WorkflowTransition> findByWorkflowIdAndSourceStateIdAndTargetStateId( | ||
Long workflowId, Long sourceStateId, Long targetStateId); | ||
} |
Oops, something went wrong.