Camunda不包含任何历史

时间:2019-01-02 13:42:11

标签: camunda

我有一个问题,每当我在Camunda Process Service中创建流程实例时,它都不会向ACT_HI_OP_LOG写入任何内容。我不确定为什么不将历史记录保存到数据库中。

@Component
@Order(Ordering.DEFAULT_ORDER + 1)
public class ProcessEngineConfiguration implements ProcessEnginePlugin {

    private String tenantId;

    @Override
    public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
        HistoryLevel historyLevel = new HistoryLevelFull();
        processEngineConfiguration.setHistoryLevel(historyLevel);
        processEngineConfiguration.setTenantCheckEnabled(true);
//      processEngineConfiguration.setHistory(org.camunda.bpm.engine.ProcessEngineConfiguration.HISTORY_FULL);
        processEngineConfiguration.setTenantIdProvider(new TenantIdProvider() {

            @Override
            public String provideTenantIdForProcessInstance(TenantIdProviderProcessInstanceContext ctx) {
                return tenantId;
            }

            @Override
            public String provideTenantIdForHistoricDecisionInstance(TenantIdProviderHistoricDecisionInstanceContext ctx) {
                return tenantId;
            }

            @Override
            public String provideTenantIdForCaseInstance(TenantIdProviderCaseInstanceContext ctx) {
                return tenantId;
            }
        });

        processEngineConfiguration.setJobExecutor(processEngineConfiguration.getJobExecutor());

    }

这就是我开始流程的方式。

ProcessInstance pi = null;

        try {
            identityService.setAuthentication(getAuthentication());
            pi = runtimeService.startProcessInstanceByKey(flowName, businessKey, variables);


        } finally {
            identityService.setAuthentication(null);
        }
        if (pi == null)
            return null;

1 个答案:

答案 0 :(得分:0)

您检查配置了吗?

historyLevelCheckEnabled的默认值为true

您能否尝试设置值false

如果将其设置为false,则不会执行此检查。