Skip to content

[Improvement-18249][DAO] Route WorkflowTaskRelationMapper access through WorkflowTaskRelationDao#18260

Open
ruanwenjun wants to merge 1 commit into
apache:devfrom
ruanwenjun:dao/workflow-task-relation
Open

[Improvement-18249][DAO] Route WorkflowTaskRelationMapper access through WorkflowTaskRelationDao#18260
ruanwenjun wants to merge 1 commit into
apache:devfrom
ruanwenjun:dao/workflow-task-relation

Conversation

@ruanwenjun
Copy link
Copy Markdown
Member

Was this PR generated or assisted by AI?

YES, gpt 5.5

Purpose of the pull request

Introduce WorkflowTaskRelationDao to encapsulate the mapper so the api layer depends only on the repository abstraction.

The Dao exposes the methods the api layer needs (queryByWorkflowDefinitionCode, queryUpstreamByCode(s), queryDownstreamByWorkflowDefinitionCode, queryWorkflowTaskRelationsByWorkflowDefinitionCode, queryWorkflowTaskRelationByTaskCodeAndTaskVersion, queryByCode(projectCode, workflowCode, pre, post), batchInsert, and deleteByWorkflowDefinitionCodeAndVersion). updateWorkflowTaskRelationTaskVersion returns boolean (row count > 0) to match the IDao convention.

The remove counter loop in TaskDefinitionServiceImpl keeps an int total by mapping the boolean updateById result via ? 1 : 0 so the insert + remove != log invariant still works.

TaskDefinitionServiceImplTest keeps its WorkflowTaskRelationMapper mock for the @Injectmocks ProcessServiceImpl since the service module migration is out of scope.

Tracking issue: #18249

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

…ugh WorkflowTaskRelationDao

Introduce WorkflowTaskRelationDao to encapsulate the mapper so the api
layer depends only on the repository abstraction.

The Dao exposes the methods the api layer needs (queryByWorkflowDefinitionCode,
queryUpstreamByCode(s), queryDownstreamByWorkflowDefinitionCode,
queryWorkflowTaskRelationsByWorkflowDefinitionCode, queryWorkflowTaskRelationByTaskCodeAndTaskVersion,
queryByCode(projectCode, workflowCode, pre, post), batchInsert, and
deleteByWorkflowDefinitionCodeAndVersion). updateWorkflowTaskRelationTaskVersion
returns boolean (row count > 0) to match the IDao convention.

The remove counter loop in TaskDefinitionServiceImpl keeps an int total
by mapping the boolean updateById result via ? 1 : 0 so the
insert + remove != log invariant still works.

TaskDefinitionServiceImplTest keeps its WorkflowTaskRelationMapper mock
for the @Injectmocks ProcessServiceImpl since the service module
migration is out of scope.

Tracking issue: apache#18249
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant