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


Java HistoricProcessInstance.getEndTime方法代码示例

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


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

示例1: convertToInstanceAndSetVariables

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
public WorkflowInstance convertToInstanceAndSetVariables(HistoricProcessInstance historicProcessInstance, Map<String, Object> collectedVariables)
{
    String processInstanceId = historicProcessInstance.getId();
    String id = processInstanceId;
    ProcessDefinition procDef = activitiUtil.getProcessDefinition(historicProcessInstance.getProcessDefinitionId());
    WorkflowDefinition definition = convert(procDef);
    
    // Set process variables based on historic detail query
    Map<String, Object> variables = propertyConverter.getHistoricProcessVariables(processInstanceId);
    
    Date startDate = historicProcessInstance.getStartTime();
    Date endDate = historicProcessInstance.getEndTime();

    // Copy all variables to map, if not null
    if(collectedVariables != null)
    {
    	collectedVariables.putAll(variables);
    }
    boolean isActive = endDate == null;
    return factory.createInstance(id, definition, variables, isActive, startDate, endDate);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ActivitiTypeConverter.java

示例2: getActivitiToMidpoint

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
private Map<String, String> getActivitiToMidpoint(Set<String> activeProcessInstances, OperationResult result) {
	Map<String,String> rv = new HashMap<>();
	int processWithoutTaskOidCount = 0;
	HistoricProcessInstanceQuery query = activitiEngine.getHistoryService().createHistoricProcessInstanceQuery()
			.includeProcessVariables()
			.excludeSubprocesses(true);
	List<HistoricProcessInstance> processes = query.list();
	for (HistoricProcessInstance process : processes) {
		String taskOid = (String) process.getProcessVariables().get(CommonProcessVariableNames.VARIABLE_MIDPOINT_TASK_OID);
		rv.put(process.getId(), taskOid);
		if (taskOid == null) {
			processWithoutTaskOidCount++;
		}
		if (process.getEndTime() == null) {
			activeProcessInstances.add(process.getId());
		}
	}
	LOGGER.info("Found {} processes; among these, {} have no task OID. Active processes: {}",
			rv.size(), processWithoutTaskOidCount, activeProcessInstances.size());
	return rv;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:ProcessInstanceManager.java

示例3: execute

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
@Override
public Object execute(CommandContext commandContext) {
    if (processInstanceId == null) {
        throw new ActivitiIllegalArgumentException("processInstanceId is null");
    }
    // Check if process instance is still running
    HistoricProcessInstance instance = commandContext
            .getHistoricProcessInstanceEntityManager()
            .findHistoricProcessInstance(processInstanceId);

    if (instance == null) {
        throw new ActivitiObjectNotFoundException("No historic process instance found with id: " + processInstanceId, HistoricProcessInstance.class);
    }
    if (instance.getEndTime() == null) {
        throw new ActivitiException("Process instance is still running, cannot delete historic process instance: " + processInstanceId);
    }

    commandContext
            .getHistoricProcessInstanceEntityManager()
            .deleteHistoricProcessInstanceById(processInstanceId);

    return null;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:DeleteHistoricProcessInstanceCmd.java

示例4: execute

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
public Object execute(CommandContext commandContext) {
  if (processInstanceId == null) {
    throw new ActivitiException("processInstanceId is null");
  }
  // Check if process instance is still running
  HistoricProcessInstance instance = commandContext
    .getHistoricProcessInstanceManager()
    .findHistoricProcessInstance(processInstanceId);
  
  if(instance == null) {
    throw new ActivitiException("No historic process instance found with id: " + processInstanceId);
  }
  if(instance.getEndTime() == null) {
    throw new ActivitiException("Process instance is still running, cannot delete historic process instance: " + processInstanceId);
  }
  
  commandContext
    .getHistoricProcessInstanceManager()
    .deleteHistoricProcessInstanceById(processInstanceId);
  
  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:DeleteHistoricProcessInstanceCmd.java

示例5: getFinishedProcessStatus

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
private AsyncExecutionState getFinishedProcessStatus(HistoricProcessInstance subProcess, ExecutionWrapper execution,
    ErrorType errorType) throws MonitoringException {
    if (subProcess.getEndTime() == null) {
        return AsyncExecutionState.RUNNING;
    }
    if (subProcess.getDeleteReason() == null) {
        return onSuccess(execution.getContext());
    }
    return onAbort(execution.getContext(), errorType);
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:11,代码来源:AbstractSubProcessMonitorExecution.java

示例6: ProcessInfo

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
public ProcessInfo(HistoricProcessInstance processInstance)
{
    this.id = processInstance.getId();
    this.processDefinitionId = processInstance.getProcessDefinitionId();
    this.startedAt = processInstance.getStartTime();
    this.endedAt = processInstance.getEndTime();
    this.durationInMs = processInstance.getDurationInMillis();
    this.deleteReason = processInstance.getDeleteReason();
    this.startUserId = processInstance.getStartUserId();
    this.startActivityId = processInstance.getStartActivityId();
    this.endActivityId = processInstance.getEndActivityId();
    this.businessKey = processInstance.getBusinessKey();
    this.superProcessInstanceId = processInstance.getSuperProcessInstanceId();
    this.completed = (processInstance.getEndTime() != null);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:16,代码来源:ProcessInfo.java

示例7: getVirtualStartTask

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
private WorkflowTask getVirtualStartTask(HistoricProcessInstance historicProcessInstance)
{
    if(historicProcessInstance == null)
    {
        return null;
    }
    String processInstanceId = historicProcessInstance.getId();

    if (!activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && false == isCorrectTenantHistoric(processInstanceId))
    {
        return null;
    }
    
    String id = ActivitiConstants.START_TASK_PREFIX + processInstanceId;
    
    // Since the process instance is complete the Start Task must be complete!
    WorkflowTaskState state = WorkflowTaskState.COMPLETED;

    // We use the process-instance ID as execution-id. It's ended anyway
    WorkflowPath path  = buildCompletedPath(processInstanceId, processInstanceId);
    if(path == null)
    {
        return null;
    }
    
    // Convert start-event to start-task Node
    ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(historicProcessInstance.getProcessDefinitionId());
    WorkflowNode startNode = convert(procDef.getInitial(), true);
    
    String taskDefId = activitiUtil.getStartFormKey(historicProcessInstance.getProcessDefinitionId());
    WorkflowTaskDefinition taskDef = factory.createTaskDefinition(taskDefId, startNode, taskDefId, true);
    
    boolean completed = historicProcessInstance.getEndTime() != null;
    Map<QName, Serializable> properties = propertyConverter.getStartTaskProperties(historicProcessInstance, taskDefId, completed);
    
    // TODO: Figure out what name/description should be used for the start-task, start event's name?
    String defaultTitle = null;
    String defaultDescription = null;
    
    return factory.createTask(id,
                taskDef, taskDef.getId(), defaultTitle, defaultDescription, state, path, properties);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:43,代码来源:ActivitiTypeConverter.java

示例8: viewHistory

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
/**
 * 查看历史【包含流程跟踪、任务列表(完成和未完成)、流程变量】.
 */
@RequestMapping("workspace-viewHistory")
public String viewHistory(
        @RequestParam("processInstanceId") String processInstanceId,
        Model model) {
    String userId = currentUserHolder.getUserId();
    HistoryService historyService = processEngine.getHistoryService();
    HistoricProcessInstance historicProcessInstance = historyService
            .createHistoricProcessInstanceQuery()
            .processInstanceId(processInstanceId).singleResult();

    if (userId.equals(historicProcessInstance.getStartUserId())) {
        // startForm
    }

    List<HistoricTaskInstance> historicTasks = historyService
            .createHistoricTaskInstanceQuery()
            .processInstanceId(processInstanceId).list();
    // List<HistoricVariableInstance> historicVariableInstances = historyService
    // .createHistoricVariableInstanceQuery()
    // .processInstanceId(processInstanceId).list();
    model.addAttribute("historicTasks", historicTasks);

    // 获取流程对应的所有人工任务(目前还没有区分历史)
    List<HumanTaskDTO> humanTasks = humanTaskConnector
            .findHumanTasksByProcessInstanceId(processInstanceId);
    List<HumanTaskDTO> humanTaskDtos = new ArrayList<HumanTaskDTO>();

    for (HumanTaskDTO humanTaskDto : humanTasks) {
        if (humanTaskDto.getParentId() != null) {
            continue;
        }

        humanTaskDtos.add(humanTaskDto);
    }

    model.addAttribute("humanTasks", humanTaskDtos);
    // model.addAttribute("historicVariableInstances",
    // historicVariableInstances);
    model.addAttribute("nodeDtos",
            traceService.traceProcessInstance(processInstanceId));
    model.addAttribute("historyActivities", processEngine
            .getHistoryService().createHistoricActivityInstanceQuery()
            .processInstanceId(processInstanceId).list());

    if (historicProcessInstance.getEndTime() == null) {
        model.addAttribute("currentActivities", processEngine
                .getRuntimeService()
                .getActiveActivityIds(processInstanceId));
    } else {
        model.addAttribute("currentActivities", Collections
                .singletonList(historicProcessInstance.getEndActivityId()));
    }

    Graph graph = processEngine.getManagementService().executeCommand(
            new FindHistoryGraphCmd(processInstanceId));
    model.addAttribute("graph", graph);
    model.addAttribute("historicProcessInstance", historicProcessInstance);

    return "bpm/workspace-viewHistory";
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:64,代码来源:WorkspaceController.java


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