Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -30,10 +30,8 @@ public Long saveProcessModel(Long projectId, String name, String xml, String des
ProcessModelTable existingProcessModel = repository.findByNameOrBpmnProcessIdWithoutCollaborations(name,
bpmnProcessId, projectId);

if (existingProcessModel != null) {
if (!isUploadedProcessCollaboration) {
return replaceProcessModel(projectId, existingProcessModel.getId(), name, xml, description);
}
if (existingProcessModel != null && !isUploadedProcessCollaboration) {
return replaceProcessModel(projectId, existingProcessModel.getId(), name, xml, description);
}

if (isUploadedProcessCollaboration) {
Expand Down Expand Up @@ -189,4 +187,4 @@ private void copyConnections(Long projectId, Long oldProcessId, Long newProcessI
private void copyMessageFlowsAndRelations(Long projectId, Long oldProcessId, Long newProcessId) {
processMapRepository.copyMessageFlowsAndRelations(projectId, oldProcessId, newProcessId);
}
}
}
22 changes: 14 additions & 8 deletions frontend/src/components/ProcessList/ProcessList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,13 @@ interface ProcessModelInformation {
description: string;
createdAt: string;
childrenIds: number[];
processType: string;
processType: ProcessType;
}

enum ProcessType {
COLLABORATION = "COLLABORATION",
PARTICIPANT = "PARTICIPANT",
PROCESS = "PROCESS"
}

export interface ProcessModelNode extends ProcessModelInformation {
Expand Down Expand Up @@ -401,8 +407,8 @@ export default defineComponent({
processModelNode: ProcessModelNode,
skipConfirm: boolean = false
) {
const isParticipant = processModelNode.processType === "PARTICIPANT";
if (!skipConfirm && isParticipant) {
const isProcess = processModelNode.processType === ProcessType.PROCESS;
if (!skipConfirm && !isProcess) {
this.processModelToBeDeleted = processModelNode;
this.confirmDeleteDialog = true;
return;
Expand Down Expand Up @@ -436,9 +442,9 @@ export default defineComponent({
const modelMap = new Map<number, ProcessModelInformation>();
processModelInformation.forEach((model) => modelMap.set(model.id, model));
return processModelInformation
.filter((model) => model.processType !== "PARTICIPANT")
.filter((model) => model.processType !== ProcessType.PARTICIPANT)
.map((model) => {
if (model.processType === "COLLABORATION") {
if (model.processType === ProcessType.COLLABORATION) {
const children = model.childrenIds.map((id) => modelMap.get(id)!);
const childrenAsNodes = children.map((child) => ({
...child,
Expand Down Expand Up @@ -488,9 +494,9 @@ export default defineComponent({
const xmlDoc = parser.parseFromString(content, "text/xml");

const isCollaboration =
xmlDoc.getElementsByTagName("bpmn:participant")?.length > 1 ||
xmlDoc.getElementsByTagName("semantic:participant")?.length > 1 ||
xmlDoc.getElementsByTagName("participant")?.length > 1;
xmlDoc.getElementsByTagName("bpmn:participant")?.length > 1 ||
xmlDoc.getElementsByTagName("semantic:participant")?.length > 1 ||
xmlDoc.getElementsByTagName("participant")?.length > 1;

if (isCollaboration) {
const collaboration =
Expand Down