Skip to content
Merged
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
@@ -0,0 +1,24 @@
package org.cloudfoundry.multiapps.controller.web.configuration;

import org.flowable.variable.api.types.ValueFields;
import org.flowable.variable.service.impl.types.LongStringType;

public class CustomLongStringType extends LongStringType {

private static final String CUSTOM_TYPE_NAME = "deployServiceLongString";

public CustomLongStringType() {
super(4000);
}

@Override
public String getTypeName() {
return CUSTOM_TYPE_NAME;
}

@Override
public void setValue(Object value, ValueFields valueFields) {
super.setValue(value, valueFields);
valueFields.setCachedValue(value);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cloudfoundry.multiapps.controller.web.configuration;

import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import jakarta.inject.Inject;
import javax.sql.DataSource;

import jakarta.inject.Inject;
import org.cloudfoundry.multiapps.controller.core.util.ApplicationConfiguration;
import org.flowable.common.engine.impl.AbstractEngineConfiguration;
import org.flowable.common.engine.impl.async.DefaultAsyncTaskExecutor;
Expand Down Expand Up @@ -61,6 +61,10 @@ public SpringProcessEngineConfiguration processEngineConfiguration(DataSource da
AsyncExecutor jobExecutor,
@Lazy FailedJobCommandFactory abortFailedProcessCommandFactory) {
SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
//We set custom variable type because when we update a value in the context, we see in your code that it has been updated
//but the cache isn't. That's why with custom type we manually update the cache
//Link to the Flowable Github issue: https://github.com/flowable/flowable-engine/issues/4130
processEngineConfiguration.setCustomPreVariableTypes(List.of(new CustomLongStringType()));
processEngineConfiguration.setDatabaseSchemaUpdate(DATABASE_SCHEMA_UPDATE);
processEngineConfiguration.setDataSource(dataSource);
processEngineConfiguration.setTransactionManager(transactionManager);
Expand Down Expand Up @@ -137,5 +141,4 @@ public RuntimeService runtimeService(ProcessEngine processEngine) {
public HistoryService historyService(ProcessEngine processEngine) {
return processEngine.getHistoryService();
}

}
Loading