“History Time To Live 不能为空 |资源 Orchestration.bpmn“升级到 camunda 7.20 后

"History Time To Live cannot be null | resource Orchestration.bpmn" after upgrading to camunda 7.20

提问人:Shubham Shekhar 提问时间:10/18/2023 最后编辑:Jan GalinskiShubham Shekhar 更新时间:11/13/2023 访问量:469

问:

我已经升级到 camunda 7.20 和 springboot 升级到 3.x,但我收到以下错误:-

History Time To Live 不能为 null |资源 Orchestration.bpmn

我以前从未将历史记录时间设置为 bpmn 文件,在我的工作区中也找不到 Orchestration.bpmn。

堆栈跟踪:-

Caused by: org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors:
* History Time To Live cannot be null: History Time To Live cannot be null | resource Orchestration.bpmn | line 3 | column 56
        at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:66)
        at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:240)
        at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:354)
        at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.transformDefinitions(BpmnDeployer.java:105)
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.transformResource(AbstractDefinitionDeployer.java:99)
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:74)
        at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:64)
        at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:54)
        at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:51)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547)
        at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:51)
        at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:71)
        at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:64)
        at org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:258)
        at org.camunda.bpm.engine.impl.cmd.DeployCmd.lambda$doExecute$0(DeployCmd.java:155)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547)
        at org.camunda.bpm.engine.impl.cmd.DeployCmd.doExecute(DeployCmd.java:141)
        at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:101)
        at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:81)
        at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
        at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:71)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
        at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:71)
        at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
        at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.camunda.bpm.engine.impl.interceptor.ExceptionCodeInterceptor.execute(ExceptionCodeInterceptor.java:55)
        at org.camunda.bpm.engine.impl.RepositoryServiceImpl.deployWithResult(RepositoryServiceImpl.java:104)
        at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deployWithResult(DeploymentBuilderImpl.java:270)
        at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:266)
        at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.autoDeployResources(SpringTransactionsProcessEngineConfiguration.java:156)
        at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.buildProcessEngine(SpringTransactionsProcessEngineConfiguration.java:67)
        at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:55)
        at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:34)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:148)
弹簧靴 卡蒙达

评论


答:

0赞 Jan Galinski 10/18/2023 #1

自 7.20 起需要历史生存时间。

如果您不想手动将 TTL 添加到流程实例中,则可以使用 :application.yml

camunda:
  bpm:
    generic-properties:
      properties:
        historyTimeToLive: P1D

这会将默认值设置为 1 天。

评论

0赞 Jan Galinski 10/23/2023
我刚刚意识到一种更简单的方法:设置可以解决问题。enforceHistoryTimeToLive =false
0赞 Jan Rohwer 10/22/2023 #2

此外,还有一个标志用于禁用非空历史记录 TTL 的新要求。https://docs.camunda.org/manual/7.20/update/minor/719-to-720/#enforce-history-time-to-live如果将 enforceHistoryTimeToLive 设置为 false,则会恢复旧行为。

1赞 Lho Ben 11/2/2023 #3

如果根本不使用历史记录,请将 enforceHistoryTimeToLive 属性设置为 false(默认设置为 true)

camunda:
    bpm:
        generic-properties:
            properties:
                enforceHistoryTimeToLive: false

如果要设置特定的 TTL,请使用 historyTimeToLive 属性

camunda:
  bpm:
    generic-properties:
      properties:
        historyTimeToLive: P1D
0赞 Simon Zambrovski 11/13/2023 #4

如果您依赖旧堆栈(例如通过测试)并且不启动 Spring Boot,则可以在文件中插入以下属性:camunda.cfg.xml

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="processEngineConfiguration"
          class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <property name="historyTimeToLive" value="P1D" />
    </bean>
</beans>