本文整理汇总了Java中org.activiti.engine.history.HistoricProcessInstance.getId方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricProcessInstance.getId方法的具体用法?Java HistoricProcessInstance.getId怎么用?Java HistoricProcessInstance.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.history.HistoricProcessInstance
的用法示例。
在下文中一共展示了HistoricProcessInstance.getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createItem
import org.activiti.engine.history.HistoricProcessInstance; //导入方法依赖的package包/类
protected ProcessInstanceItem createItem(HistoricProcessInstance processInstance) {
ProcessInstanceItem item = new ProcessInstanceItem();
item.addItemProperty("id", new ObjectProperty<String>(processInstance.getId(), String.class));
ProcessDefinition processDefinition = getProcessDefinition(processInstance.getProcessDefinitionId());
String itemName = getProcessDisplayName(processDefinition) + " (" + processInstance.getId() + ")";
item.addItemProperty("name", new ObjectProperty<String>(itemName, String.class));
return item;
}
示例4: 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);
}
示例5: 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