Skip to content

Commit

Permalink
camunda to 7.20
Browse files Browse the repository at this point in the history
Camunda 7.20. enforces process history time to live values in process
models, added code to set a P30D default value if TTL is not specified
in the bpmn file.
  • Loading branch information
hhund committed Oct 10, 2023
1 parent 846d574 commit ab1831c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Resource getResource()
private static final String PROCESS_ID_PATTERN_STRING = "^(?<domainNoDots>[a-zA-Z0-9-]+)_(?<processName>[a-zA-Z0-9-]+)$";
private static final Pattern PROCESS_ID_PATTERN = Pattern.compile(PROCESS_ID_PATTERN_STRING);

private static final String DEFAULT_PROCESS_HISTORY_TIME_TO_LIVE = "P30D";

private final D processPluginDefinition;
private final A processPluginApi;
private final boolean draft;
Expand Down Expand Up @@ -679,6 +681,18 @@ file, getDefinitionName(), getDefinitionVersion(), VERSION_PLACEHOLDER_PATTERN_S

property.setCamundaName(MODEL_ATTRIBUTE_PROCESS_API_VERSION);
property.setCamundaValue(getProcessPluginApiVersion());

if (process.getCamundaHistoryTimeToLiveString() == null
|| process.getCamundaHistoryTimeToLiveString().isBlank())
{
if (isDraft())
logger.info("Setting process history time to live for process {} from {} to {}",
process.getId(), jarFile.toString(), DEFAULT_PROCESS_HISTORY_TIME_TO_LIVE);
else
logger.debug("Setting process history time to live for process {} from {} to {}",
process.getId(), jarFile.toString(), DEFAULT_PROCESS_HISTORY_TIME_TO_LIVE);
process.setCamundaHistoryTimeToLiveString(DEFAULT_PROCESS_HISTORY_TIME_TO_LIVE);
}
});

return new BpmnFileAndModel(draft, file, model, getJarFile());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--
-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
-- under one or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information regarding copyright
-- ownership. Camunda licenses this file to you under the Apache License,
-- Version 2.0; you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- 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.
--

insert into ACT_GE_SCHEMA_LOG
values ('900', CURRENT_TIMESTAMP, '7.20.0');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<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="camunda.org" id="db.camunda_engine.changelog-1.3.0">
<sqlFile dbms="postgresql" encoding="utf8" path="db/camunda/postgres_engine_7.19_to_7.20.sql" />
</changeSet>

</databaseChangeLog>
2 changes: 2 additions & 0 deletions dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
<include file="db/db.process_states.changelog-1.0.0.xml" />

<include file="db/db.last_event.changelog-1.0.0.xml" />

<include file="db/db.camunda_engine.changelog-1.3.0.xml" />
</databaseChangeLog>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<tyrus.version>2.1.3</tyrus.version>
<spring.version>6.0.12</spring.version>
<jackson.version>2.15.2</jackson.version>
<camunda.version>7.19.0</camunda.version>
<camunda.version>7.20.0</camunda.version>
<hapi.fhir.version>5.1.0</hapi.fhir.version>
<hapi.hl7v2.version>2.3</hapi.hl7v2.version>
</properties>
Expand Down

0 comments on commit ab1831c

Please sign in to comment.