本文整理汇总了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);
}
示例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);
}
示例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