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
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2024 Ritense BV, the Netherlands.
* Copyright 2015-2026 Ritense BV, the Netherlands.
*
* Licensed under EUPL, Version 1.2 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,9 +16,13 @@

package com.ritense.valtimo.operaton.repository;

import com.ritense.valtimo.contract.BlueprintId;
import com.ritense.valtimo.contract.audit.utils.AuditHelper;
import com.ritense.valtimo.contract.buildingblock.BuildingBlockDefinitionId;
import com.ritense.valtimo.contract.case_.CaseDefinitionId;
import com.ritense.valtimo.contract.utils.RequestHelper;
import com.ritense.valtimo.domain.process.event.ProcessDefinitionDeletedEvent;
import com.ritense.valtimo.event.ProcessDefinitionDeleted;
import java.time.LocalDateTime;
import java.util.UUID;
import org.operaton.bpm.engine.impl.RepositoryServiceImpl;
Expand Down Expand Up @@ -46,6 +50,20 @@ public void deleteProcessDefinition(String processDefinitionId, boolean cascade,
processDefinition.getKey()
)
);
applicationEventPublisher.publishEvent(
new ProcessDefinitionDeleted(
processDefinitionId,
getBlueprintId(processDefinition.getVersionTag())
)
);
}

private BlueprintId getBlueprintId(String versionTag) {
CaseDefinitionId caseDefinitionId = CaseDefinitionId.fromProcessVersionTag(versionTag);
if (caseDefinitionId != null) {
return caseDefinitionId;
}
return BuildingBlockDefinitionId.Companion.fromProcessVersionTag(versionTag);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2015-2026 Ritense BV, the Netherlands.
~
~ Licensed under EUPL, Version 1.2 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" basis,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<include file="20260813-delete-orphaned-process-definition-case-definition.xml" relativeToChangelogFile="true"/>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<!--
~ Copyright 2015-2026 Ritense BV, the Netherlands.
~
~ Licensed under EUPL, Version 1.2 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" basis,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">

<changeSet author="Ritense" id="1">
<delete tableName="process_definition_case_definition">
<where>process_definition_id NOT IN (SELECT id_ FROM act_re_procdef)</where>
</delete>
</changeSet>

<changeSet author="Ritense" id="2">
<delete tableName="process_link">
<where>process_definition_id NOT IN (SELECT id_ FROM act_re_procdef)</where>
</delete>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
<include file="/13-29-0/13-29-0-master.xml" relativeToChangelogFile="true"/>
<include file="/13-32-0/13-32-0-master.xml" relativeToChangelogFile="true"/>
<include file="/13-38-0/13-38-0-master.xml" relativeToChangelogFile="true"/>
<include file="/13-42-0/13-42-0-master.xml" relativeToChangelogFile="true"/>

</databaseChangeLog>
Loading
Loading