Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix-16567] Unable to delete copied nodes in unsaved workflow #16576

Merged
merged 12 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,19 @@ public List<DependentLineageTask> queryDependentWorkflowDefinitions(long project
if (project == null) {
throw new ServiceException(Status.PROJECT_NOT_FOUND, projectCode);
}
List<DependentLineageTask> dependentLineageTaskList = new ArrayList<>();
List<WorkflowTaskLineage> workflowTaskLineageList =
workflowTaskLineageDao.queryWorkFlowLineageByDept(projectCode,
workflowDefinitionCode, taskCode == null ? 0 : taskCode);
if (workflowTaskLineageList.isEmpty()) {
return dependentLineageTaskList;
}
List<WorkflowDefinition> workflowDefinitionList =
workflowDefinitionMapper.queryByCodes(workflowTaskLineageList.stream()
.map(WorkflowTaskLineage::getWorkflowDefinitionCode).distinct().collect(Collectors.toList()));
List<TaskDefinition> taskDefinitionList = taskDefinitionMapper.queryByCodeList(workflowTaskLineageList.stream()
.map(WorkflowTaskLineage::getTaskDefinitionCode).filter(code -> code != 0).distinct()
.collect(Collectors.toList()));
List<DependentLineageTask> dependentLineageTaskList = new ArrayList<>();
for (WorkflowTaskLineage workflowTaskLineage : workflowTaskLineageList) {
DependentLineageTask dependentLineageTask = new DependentLineageTask();
taskDefinitionList.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ export function useDependencies() {
workFlowCode: workflowCode,
taskCode: taskCode
} as DependentTaskReq
const res = await queryDependentTasks(projectCode, dependentTaskReq)
res
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
tasks.push(
item.processDefinitionName + '->' + item.taskDefinitionName
)
})
await queryDependentTasks(projectCode, dependentTaskReq)
.then((res: any) => {
if (res?.data?.length > 0) {
res.data
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
tasks.push(
item.processDefinitionName + '->' + item.taskDefinitionName
)
})
}
})
}
return tasks
}
Expand All @@ -51,14 +55,18 @@ export function useDependencies() {
const dependentTaskReq = {
workFlowCode: workflowCode
} as DependentTaskReq
const res = await queryDependentTasks(projectCode, dependentTaskReq)
res
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
tasks.push(
item.processDefinitionName + '->' + item.taskDefinitionName
)
})
await queryDependentTasks(projectCode, dependentTaskReq)
.then((res: any) => {
if (res?.data?.length > 0) {
res.data
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
tasks.push(
item.processDefinitionName + '->' + item.taskDefinitionName
)
})
}
})
}
return tasks
}
Expand Down Expand Up @@ -110,25 +118,27 @@ export function useDependencies() {
if (workflowCode && projectCode) {
await queryDependentTasks(projectCode, dependentTaskReq).then(
(res: any) => {
res.data
.filter((item: any) => {
if (item.processDefinitionCode) {
return item.processDefinitionCode !== workflowCode
} else {
return false
}
})
.forEach((item: any) => {
dependentTaskLinks.push({
text:
item.processDefinitionName + '->' + item.taskDefinitionName,
show: true,
action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank')
}
})
})
if (res?.data?.length > 0) {
res.data
.filter((item: any) => {
if (item.processDefinitionCode) {
return item.processDefinitionCode !== workflowCode
} else {
return false
}
})
.forEach((item: any) => {
dependentTaskLinks.push({
text:
item.processDefinitionName + '->' + item.taskDefinitionName,
show: true,
action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank')
}
})
})
}
}
)
}
Expand All @@ -148,19 +158,21 @@ export function useDependencies() {
if (workflowCode && projectCode) {
await queryDependentTasks(projectCode, dependentTaskReq).then(
(res: any) => {
res
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
dependentTaskLinks.push({
text:
item.processDefinitionName + '->' + item.taskDefinitionName,
show: true,
action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank')
}
})
})
if (res?.data?.length > 0) {
res.data
.filter((item: any) => item.processDefinitionCode !== workflowCode)
.forEach((item: any) => {
dependentTaskLinks.push({
text:
item.processDefinitionName + '->' + item.taskDefinitionName,
show: true,
action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank')
}
})
})
}
}
)
}
Expand Down
Loading