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


Java HistoricProcessInstance.getStartTime方法代码示例

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


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

示例3: publishProcessDocument

import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void publishProcessDocument(Map<String, Object> processMap, HistoricProcessInstance processInstanceDetails) throws Exception {
	String documentId = processInstanceDetails.getProcessDefinitionId() + "-" + processInstanceDetails.getId();
	String indexName = indexPrefix;
	String processState = (String) processMap.get("ProcessState");

	if (processState.equals("Unknown")) {
		// If Status unknown, we need to search for an existing doc in all
		// indexes. Creating the payload for the search
		String idIndexSearchQuery = "{\"query\":{\"term\":{\"_id\":\"" + documentId + "\"}}}";
		// If doc found during search, just update the status. Creating the
		// update request payload below
		String updatePayload = "{\"doc\":{\"ProcessState\":\"Unknown\"}}";

		String searchResponse = elasticHTTPClient.execute(esUrl + "bpmanalyticseventlog*/bpmanalyticsevent/_search",
				idIndexSearchQuery, "POST");
		Map<String, Object> searchResponseMap = null;
		try {
			searchResponseMap = new ObjectMapper().readValue(searchResponse, Map.class);
		} catch (Exception e) {
			logger.error("Error while trying parse the searchResponseMap for documentId: " + documentId);
		}
		if (searchResponseMap != null
				&& (Integer) ((Map<String, Object>) searchResponseMap.get("hits")).get("total") > 0) {
			indexName = (String) ((List<Map<String, Object>>) ((Map<String, Object>) searchResponseMap.get("hits"))
					.get("hits")).get(0).get("_index");
			elasticHTTPClient.execute(esUrl + indexName + "/bpmanalyticsevent/" + documentId + "/_update",
					updatePayload, "POST");
		} else {
			elasticHTTPClient.execute(esUrl + indexName + "/bpmanalyticsevent/" + documentId,
					objectMapper.writeValueAsString(processMap), "PUT");
		}
	} else {

		if (processInstanceDetails.getStartTime() != null) {
			indexName = indexName + '-'
					+ new SimpleDateFormat("yyyy.MM").format(processInstanceDetails.getStartTime());
		}
		elasticHTTPClient.execute(esUrl + indexName + "/bpmanalyticsevent/" + documentId,
				objectMapper.writeValueAsString(processMap), "PUT");
	}

}
 
开发者ID:cijujoseph,项目名称:activiti-analytics-spring-boot,代码行数:44,代码来源:CustomElasticAnalyticsEndpoint.java


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