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


Java HistoricVariableInstance.getValue方法代码示例

本文整理汇总了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";
}
 
开发者ID:usplssb,项目名称:SemanticSCo,代码行数:17,代码来源:Activiti.java

示例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;
}
 
开发者ID:lz84,项目名称:bachelor,代码行数:18,代码来源:BpmHistoryServiceImpl.java

示例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));
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:10,代码来源:StepsUtil.java

示例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));
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:10,代码来源:StepsUtil.java

示例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;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:10,代码来源:ActivitiEventToDelegateExecutionAdapter.java

示例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();
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:12,代码来源:AbortProcessListener.java

示例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;
	}
 
开发者ID:lz84,项目名称:bachelor,代码行数:48,代码来源:BpmRuntimeServiceImpl.java


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