本文整理汇总了Java中org.activiti.engine.history.HistoricVariableInstance.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricVariableInstance.getValue方法的具体用法?Java HistoricVariableInstance.getValue怎么用?Java HistoricVariableInstance.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.history.HistoricVariableInstance
的用法示例。
在下文中一共展示了HistoricVariableInstance.getValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatus
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
public String getStatus(){
HistoryService historyService = processEngine.getHistoryService();
//Get all variables of process generated during execution (data objects and inputs/outputs)
List<HistoricVariableInstance> outVariables = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstance.getId()).list();
//For each variable of process
for (HistoricVariableInstance historicVariableInstance : outVariables)
if(historicVariableInstance.getVariableName().equals("status")){
if(historicVariableInstance.getValue() != null)
return (String) historicVariableInstance.getValue();
}
return "failure";
}
示例2: getBpDataExByBizKey
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
@Override
public BaseBpDataEx getBpDataExByBizKey(String bizKey) {
HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery()
.processInstanceBusinessKey(bizKey).singleResult();
if(hpi == null){
return null;
}
HistoricVariableInstance obj = historyService.createHistoricVariableInstanceQuery()
.processInstanceId(hpi.getId()).variableName(BpmConstant.BPM_BP_DATA_EX_KEY).singleResult();
if(obj != null){
BaseBpDataEx bpDataEx = (BaseBpDataEx)obj.getValue();
bpDataEx.setPiId(hpi.getId());
return bpDataEx;
}
return null;
}
示例3: getDeletedEntriesFromProcess
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
static List<ConfigurationEntry> getDeletedEntriesFromProcess(ActivitiFacade activitiFacade, String processInstanceId) {
HistoricVariableInstance deletedEntries = activitiFacade.getHistoricVariableInstance(processInstanceId,
Constants.VAR_DELETED_ENTRIES);
if (deletedEntries == null) {
return Collections.emptyList();
}
byte[] deletedEntriesByteArray = (byte[]) deletedEntries.getValue();
return Arrays.asList(JsonUtil.getFromBinaryJson(deletedEntriesByteArray, ConfigurationEntry[].class));
}
示例4: getPublishedEntriesFromProcess
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
static List<ConfigurationEntry> getPublishedEntriesFromProcess(ActivitiFacade activitiFacade, String processInstanceId) {
HistoricVariableInstance publishedEntries = activitiFacade.getHistoricVariableInstance(processInstanceId,
Constants.VAR_PUBLISHED_ENTRIES);
if (publishedEntries == null) {
return Collections.emptyList();
}
byte[] binaryJson = (byte[]) publishedEntries.getValue();
return Arrays.asList(JsonUtil.getFromBinaryJson(binaryJson, ConfigurationEntry[].class));
}
示例5: getVariable
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
@Override
public Object getVariable(String variableName) {
HistoricVariableInstance result = event.getEngineServices().getHistoryService().createHistoricVariableInstanceQuery().processInstanceId(
getProcessInstanceId()).variableName(variableName).singleResult();
if (result != null) {
return result.getValue();
}
return result;
}
示例6: getCorrelationId
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
private String getCorrelationId(ActivitiEvent event) {
HistoricVariableInstance correlationId = getHistoricVarInstanceValue(event.getEngineServices().getHistoryService(),
event.getProcessInstanceId(), Constants.VAR_CORRELATION_ID);
if (correlationId != null) {
return (String) correlationId.getValue();
}
// The process was started before we introduced subprocesses in our BPMN
// diagrams. Therefore, the correlation ID is the ID of the
// process instance.
return event.getProcessInstanceId();
}
示例7: getBpDataEx
import org.activiti.engine.history.HistoricVariableInstance; //导入方法依赖的package包/类
@Override
public BaseBpDataEx getBpDataEx(String piId, String userId) {
BaseBpDataEx bpDataEx = (BaseBpDataEx) vlService
.getRequestAttribute(BpmConstant.BPM_BP_DATA_EX_KEY);
// BaseBpDataEx bpDataEx = null;
if (bpDataEx != null && bpDataEx.getTaskEx() != null
&& bpDataEx.getPiId().equals(piId)) {
return bpDataEx;
}
if (bpDataEx == null) {
bpDataEx = new BaseBpDataEx();
}
// long count = runtimeService.createProcessInstanceQuery()
// .processInstanceId(piId).count();
Map<String, Object> gvMap = new HashMap<String, Object>();
// if (count == 0) {
// 将GvMap取出,并为BaseBpDataEx对象填充对应的数据
List<HistoricVariableInstance> variableList = historyService
.createHistoricVariableInstanceQuery()
.processInstanceId(piId).list();
if (variableList == null)
return null;
for (HistoricVariableInstance hvi : variableList) {
if (hvi.getValue() != null)
gvMap.put(hvi.getVariableName(), hvi.getValue());
}
// } else {
// 当前版本BpDataEx不在序列化到数据库中。将通过下面方式返回BpDataEx。
List<TaskEx> tl = bpmTaskService.getActiveTask(piId, userId);
TaskEx taskEx = null;
if (!tl.isEmpty())
taskEx = tl.get(0);
bpDataEx.setTaskEx(taskEx);
// }
try {
BeanUtils.copyProperties(bpDataEx, gvMap);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
fillBusinessMap4BpData(gvMap, bpDataEx);
vlService.setRequestAttribute(BpmConstant.BPM_BP_DATA_EX_KEY, bpDataEx);
bpDataEx.setPiId(piId);
return bpDataEx;
}