当前位置: 首页>>代码示例>>Java>>正文


Java HistoricActivityInstanceEntity.setId方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.setId方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricActivityInstanceEntity.setId方法的具体用法?Java HistoricActivityInstanceEntity.setId怎么用?Java HistoricActivityInstanceEntity.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity的用法示例。


在下文中一共展示了HistoricActivityInstanceEntity.setId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notify

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
public void notify(DelegateExecution execution) {
  IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
  
  ExecutionEntity executionEntity = (ExecutionEntity) execution;
  String processDefinitionId = executionEntity.getProcessDefinitionId();
  String processInstanceId = executionEntity.getProcessInstanceId();
  String executionId = execution.getId();

  HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
  historicActivityInstance.setId(idGenerator.getNextId());
  historicActivityInstance.setProcessDefinitionId(processDefinitionId);
  historicActivityInstance.setProcessInstanceId(processInstanceId);
  historicActivityInstance.setExecutionId(executionId);
  historicActivityInstance.setActivityId(executionEntity.getActivityId());
  historicActivityInstance.setActivityName((String) executionEntity.getActivity().getProperty("name"));
  historicActivityInstance.setActivityType((String) executionEntity.getActivity().getProperty("type"));
  historicActivityInstance.setStartTime(ClockUtil.getCurrentTime());
  
  Context
    .getCommandContext()
    .getDbSqlSession()
    .insert(historicActivityInstance);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:24,代码来源:ActivityInstanceStartHandler.java

示例2: recordActivityStart

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Record the start of an activitiy, if activity history is enabled.
 */
public void recordActivityStart(ExecutionEntity executionEntity) {
  if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
    IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
    
    String processDefinitionId = executionEntity.getProcessDefinitionId();
    String processInstanceId = executionEntity.getProcessInstanceId();
    String executionId = executionEntity.getId();

    HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
    historicActivityInstance.setId(idGenerator.getNextId());
    historicActivityInstance.setProcessDefinitionId(processDefinitionId);
    historicActivityInstance.setProcessInstanceId(processInstanceId);
    historicActivityInstance.setExecutionId(executionId);
    historicActivityInstance.setActivityId(executionEntity.getActivityId());
    historicActivityInstance.setActivityName((String) executionEntity.getActivity().getProperty("name"));
    historicActivityInstance.setActivityType((String) executionEntity.getActivity().getProperty("type"));
    historicActivityInstance.setStartTime(ClockUtil.getCurrentTime());
    
    getDbSqlSession().insert(historicActivityInstance);
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:25,代码来源:HistoryManager.java

示例3: recordActivityStart

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
@Override
public void recordActivityStart(ExecutionEntity executionEntity) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
        if (executionEntity.getActivity() != null) {
            IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();

            String processDefinitionId = executionEntity.getProcessDefinitionId();
            String processInstanceId = executionEntity.getProcessInstanceId();
            String executionId = executionEntity.getId();

            HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
            historicActivityInstance.setId(idGenerator.getNextId());
            historicActivityInstance.setProcessDefinitionId(processDefinitionId);
            historicActivityInstance.setProcessInstanceId(processInstanceId);
            historicActivityInstance.setExecutionId(executionId);
            historicActivityInstance.setActivityId(executionEntity.getActivityId());
            historicActivityInstance.setActivityName((String) executionEntity.getActivity().getProperty("name"));
            historicActivityInstance.setActivityType((String) executionEntity.getActivity().getProperty("type"));
            historicActivityInstance.setStartTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());

            // Inherit tenant id (if applicable)
            if (executionEntity.getTenantId() != null) {
                historicActivityInstance.setTenantId(executionEntity.getTenantId());
            }

            getDbSqlSession().insert(historicActivityInstance);

            // Fire event
            ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
            if (config != null && config.getEventDispatcher().isEnabled()) {
                config.getEventDispatcher().dispatchEvent(
                        ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED, historicActivityInstance));
            }

        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:38,代码来源:DefaultHistoryManager.java

示例4: recordProcessInstanceStart

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Record a process-instance started and record start-event if activity history is enabled.
 */
public void recordProcessInstanceStart(ExecutionEntity processInstance) {
  if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
    HistoricProcessInstanceEntity historicProcessInstance = new HistoricProcessInstanceEntity(processInstance);
    
    // Insert historic process-instance
    getDbSqlSession().insert(historicProcessInstance);

    // Also record the start-event manually, as there is no "start" activity history listener for this
    IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
    
    String processDefinitionId = processInstance.getProcessDefinitionId();
    String processInstanceId = processInstance.getProcessInstanceId();
    String executionId = processInstance.getId();

    HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
    historicActivityInstance.setId(idGenerator.getNextId());
    historicActivityInstance.setProcessDefinitionId(processDefinitionId);
    historicActivityInstance.setProcessInstanceId(processInstanceId);
    historicActivityInstance.setExecutionId(executionId);
    historicActivityInstance.setActivityId(processInstance.getActivityId());
    historicActivityInstance.setActivityName((String) processInstance.getActivity().getProperty("name"));
    historicActivityInstance.setActivityType((String) processInstance.getActivity().getProperty("type"));
    Date now = ClockUtil.getCurrentTime();
    historicActivityInstance.setStartTime(now);
    
    getDbSqlSession()
      .insert(historicActivityInstance);
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:33,代码来源:HistoryManager.java

示例5: recordProcessInstanceStart

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
@Override
public void recordProcessInstanceStart(ExecutionEntity processInstance) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
        HistoricProcessInstanceEntity historicProcessInstance = new HistoricProcessInstanceEntity(processInstance);

        // Insert historic process-instance
        getDbSqlSession().insert(historicProcessInstance);

        // Fire event
        ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
        if (config != null && config.getEventDispatcher().isEnabled()) {
            config.getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_PROCESS_INSTANCE_CREATED, historicProcessInstance));
        }

        // Also record the start-event manually, as there is no "start" activity history listener for this
        IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();

        String processDefinitionId = processInstance.getProcessDefinitionId();
        String processInstanceId = processInstance.getProcessInstanceId();
        String executionId = processInstance.getId();

        HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
        historicActivityInstance.setId(idGenerator.getNextId());
        historicActivityInstance.setProcessDefinitionId(processDefinitionId);
        historicActivityInstance.setProcessInstanceId(processInstanceId);
        historicActivityInstance.setExecutionId(executionId);
        historicActivityInstance.setActivityId(processInstance.getActivityId());
        historicActivityInstance.setActivityName((String) processInstance.getActivity().getProperty("name"));
        historicActivityInstance.setActivityType((String) processInstance.getActivity().getProperty("type"));
        Date now = Context.getProcessEngineConfiguration().getClock().getCurrentTime();
        historicActivityInstance.setStartTime(now);

        // Inherit tenant id (if applicable)
        if (processInstance.getTenantId() != null) {
            historicActivityInstance.setTenantId(processInstance.getTenantId());
        }

        getDbSqlSession().insert(historicActivityInstance);

        // Fire event
        if (config != null && config.getEventDispatcher().isEnabled()) {
            config.getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED, historicActivityInstance));
        }

    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:49,代码来源:DefaultHistoryManager.java

示例6: recordSubProcessInstanceStart

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
@Override
public void recordSubProcessInstanceStart(ExecutionEntity parentExecution, ExecutionEntity subProcessInstance) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {

        HistoricProcessInstanceEntity historicProcessInstance = new HistoricProcessInstanceEntity(subProcessInstance);

        ActivityImpl initialActivity = subProcessInstance.getActivity();
        // Fix for ACT-1728: startActivityId not initialized with subprocess-instance
        if (historicProcessInstance.getStartActivityId() == null) {
            historicProcessInstance.setStartActivityId(subProcessInstance.getProcessDefinition().getInitial().getId());
            initialActivity = subProcessInstance.getProcessDefinition().getInitial();
        }
        getDbSqlSession().insert(historicProcessInstance);

        // Fire event
        ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
        if (config != null && config.getEventDispatcher().isEnabled()) {
            config.getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_PROCESS_INSTANCE_CREATED, historicProcessInstance));
        }

        HistoricActivityInstanceEntity activityInstance = findActivityInstance(parentExecution);
        if (activityInstance != null) {
            activityInstance.setCalledProcessInstanceId(subProcessInstance.getProcessInstanceId());
        }

        // Fix for ACT-1728: start-event not recorded for subprocesses
        IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();

        // Also record the start-event manually, as there is no "start" activity history listener for this
        HistoricActivityInstanceEntity historicActivityInstance = new HistoricActivityInstanceEntity();
        historicActivityInstance.setId(idGenerator.getNextId());
        historicActivityInstance.setProcessDefinitionId(subProcessInstance.getProcessDefinitionId());
        historicActivityInstance.setProcessInstanceId(subProcessInstance.getProcessInstanceId());
        historicActivityInstance.setExecutionId(subProcessInstance.getId());
        historicActivityInstance.setActivityId(initialActivity.getId());
        historicActivityInstance.setActivityName((String) initialActivity.getProperty("name"));
        historicActivityInstance.setActivityType((String) initialActivity.getProperty("type"));
        Date now = Context.getProcessEngineConfiguration().getClock().getCurrentTime();
        historicActivityInstance.setStartTime(now);

        getDbSqlSession().insert(historicActivityInstance);

        // Fire event
        if (config != null && config.getEventDispatcher().isEnabled()) {
            config.getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED, historicActivityInstance));
        }

    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:52,代码来源:DefaultHistoryManager.java


注:本文中的org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。