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


Java HistoricVariableInstance类代码示例

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


HistoricVariableInstance类属于org.activiti.engine.history包,在下文中一共展示了HistoricVariableInstance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteAllocatedRoutes

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
protected void deleteAllocatedRoutes(HistoryService historyService, String processInstanceId) throws SLException {
    HistoricVariableInstance allocatedPortsInstance = getHistoricVarInstanceValue(historyService, processInstanceId,
        Constants.VAR_ALLOCATED_PORTS);
    if (allocatedPortsInstance == null) {
        return;
    }
    CloudFoundryOperations client = getCloudFoundryClient(historyService, processInstanceId);
    String defaultDomain = client.getDefaultDomain() != null ? client.getDefaultDomain().getName() : null;
    if (defaultDomain == null) {
        LOGGER.warn(Messages.COULD_NOT_COMPUTE_DEFAULT_DOMAIN);
        return;
    }
    Integer[] allocatedPorts = JsonUtil.getFromBinaryJson((byte[]) allocatedPortsInstance.getValue(), Integer[].class);
    for (Integer port : allocatedPorts) {
        try {
            client.deleteRoute(port.toString(), defaultDomain);
        } catch (CloudFoundryException e) {
            LOGGER.warn(format(Messages.COULD_NOT_DELETE_ROUTE_FOR_PORT, port));
        }
    }
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:22,代码来源:AbortProcessListener.java

示例2: deleteDeploymentFiles

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
protected void deleteDeploymentFiles(HistoryService historyService, String processInstanceId) throws FileStorageException {
    HistoricVariableInstance keepFiles = getHistoricVarInstanceValue(historyService, processInstanceId, Constants.PARAM_KEEP_FILES);
    if (shouldKeepFiles(keepFiles)) {
        return;
    }
    HistoricVariableInstance extensionDescriptorFileIds = getHistoricVarInstanceValue(historyService, processInstanceId,
        Constants.PARAM_EXT_DESCRIPTOR_FILE_ID);
    HistoricVariableInstance appArchiveFileIds = getHistoricVarInstanceValue(historyService, processInstanceId,
        Constants.PARAM_APP_ARCHIVE_ID);

    String spaceId = (String) getHistoricVarInstanceValue(historyService, processInstanceId,
        com.sap.cloud.lm.sl.persistence.message.Constants.VARIABLE_NAME_SPACE_ID).getValue();

    FileSweeper fileSweeper = new FileSweeper(spaceId, getBeanProvider().getFileService());
    fileSweeper.sweep(extensionDescriptorFileIds);
    fileSweeper.sweep(appArchiveFileIds);
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:18,代码来源:AbortProcessListener.java

示例3: prepareContext

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
private void prepareContext() {
    context.setVariable(Constants.VAR_SPACE, input.currentSpace.getName());
    context.setVariable(Constants.VAR_ORG, input.currentSpace.getOrganization().getName());

    context.setVariable(Constants.VAR_MTA_MAJOR_SCHEMA_VERSION, majorSchemaVersion);
    context.setVariable(Constants.PARAM_ALLOW_INVALID_ENV_NAMES, false);
    context.setVariable(Constants.PARAM_USE_NAMESPACES, false);
    context.setVariable(Constants.PARAM_USE_NAMESPACES_FOR_SERVICES, false);
    context.setVariable(Constants.VAR_PORT_BASED_ROUTING, false);

    StepsUtil.setPublishedEntries(context, getPublishedEntries());
    StepsUtil.setDeletedEntries(context, getDeletedEntries());

    context.setVariable(Constants.VAR_USER, USER);
    step.orgAndSpaceCalculator = (client, spaceId) -> new Pair<>(spaceId, spaceId);
    Mockito.when(activitiFacade.getHistoricSubProcessIds(Mockito.any())).thenReturn(Arrays.asList("test-subprocess-id"));
    HistoricVariableInstance varInstanceMock = Mockito.mock(HistoricVariableInstance.class);
    Mockito.when(activitiFacade.getHistoricVariableInstance("test-subprocess-id", Constants.VAR_PUBLISHED_ENTRIES))
        .thenReturn(varInstanceMock);
    Mockito.when(varInstanceMock.getValue()).thenReturn(getBytes(getPublishedEntries()));
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:22,代码来源:UpdateSubscribersStepTest.java

示例4: prepareContext

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
private void prepareContext() {
    context.setVariable(Constants.VAR_SPACE, stepInput.space);
    context.setVariable(com.sap.cloud.lm.sl.persistence.message.Constants.VARIABLE_NAME_SPACE_ID, stepInput.spaceId);
    context.setVariable(Constants.VAR_ORG, stepInput.org);
    context.setVariable(Constants.PARAM_MTA_ID, stepInput.mtaId);
    Mockito.when(context.getProcessInstanceId()).thenReturn("process-instance-id");
    Mockito.when(activitiFacade.getHistoricSubProcessIds(Mockito.any())).thenReturn(Arrays.asList("test-subprocess-id"));
    HistoricVariableInstance varInstanceMock = Mockito.mock(HistoricVariableInstance.class);
    Mockito.when(activitiFacade.getHistoricVariableInstance("test-subprocess-id", Constants.VAR_PUBLISHED_ENTRIES))
        .thenReturn(varInstanceMock);
    Mockito.when(varInstanceMock.getValue()).thenReturn(getBytes(stepInput.publishedEntries));
    HistoricVariableInstance varInstanceMockDeletedEntries = Mockito.mock(HistoricVariableInstance.class);
    Mockito.when(activitiFacade.getHistoricVariableInstance("process-instance-id", Constants.VAR_DELETED_ENTRIES))
        .thenReturn(varInstanceMockDeletedEntries);
    Mockito.when(varInstanceMockDeletedEntries.getValue()).thenReturn(getBytes(getEntriesToDelete()));
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:17,代码来源:DeleteDiscontinuedConfigurationEntriesStepTest.java

示例5: getHistoricVarInstanceValue

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Override
protected HistoricVariableInstance getHistoricVarInstanceValue(HistoryService historyService, String processInstanceId,
    String parameter) {
    switch (parameter) {
        case com.sap.cloud.lm.sl.persistence.message.Constants.VARIABLE_NAME_SPACE_ID:
            return createInstanceMock(SPACE_ID);
        case Constants.PARAM_EXT_DESCRIPTOR_FILE_ID:
            return createInstanceMock(extensionDescriptorIds);
        case Constants.PARAM_APP_ARCHIVE_ID:
            return createInstanceMock(archiveIds);
        case Constants.PARAM_KEEP_FILES:
            return createInstanceMock(shouldKeepFiles);
        default:
            return null;
    }
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:17,代码来源:AbortProcessListenerTest.java

示例6: 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

示例7: executeList

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Override
public List<HistoricVariableInstance> executeList(CommandContext commandContext, Page page) {
    checkQueryOk();
    ensureVariablesInitialized();

    List<HistoricVariableInstance> historicVariableInstances = commandContext
            .getHistoricVariableInstanceEntityManager()
            .findHistoricVariableInstancesByQueryCriteria(this, page);

    if (!excludeVariableInitialization) {
        for (HistoricVariableInstance historicVariableInstance : historicVariableInstances) {
            if (historicVariableInstance instanceof HistoricVariableInstanceEntity) {
                HistoricVariableInstanceEntity variableEntity = (HistoricVariableInstanceEntity) historicVariableInstance;
                if (variableEntity.getVariableType() != null) {
                    variableEntity.getValue();

                    // make sure JPA entities are cached for later retrieval
                    if (JPAEntityVariableType.TYPE_NAME.equals(variableEntity.getVariableType().getTypeName()) || JPAEntityListVariableType.TYPE_NAME.equals(variableEntity.getVariableType().getTypeName())) {
                        ((CacheableVariable) variableEntity.getVariableType()).setForceCacheable(true);
                    }
                }
            }
        }
    }
    return historicVariableInstances;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:27,代码来源:HistoricVariableInstanceQueryImpl.java

示例8: getApproveMap

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
/**
 * 获取历史审批结果和审批意见
 *
 * @param activityInstance 历史任务节点
 * @return
 */
public Map<String, String> getApproveMap(HistoricActivityInstance activityInstance) {
    //审批结果和审批意见为Local变量
    Map<String, String> map = new HashMap<>();
    if (StrUtil.isEmpty(activityInstance.getTaskId()))
        return map;
    List<HistoricVariableInstance> variableInstances = historyService.createHistoricVariableInstanceQuery()
            .processInstanceId(activityInstance.getProcessInstanceId()).taskId(activityInstance.getTaskId()).list();
    for (HistoricVariableInstance variableInstance : variableInstances) {
        if (variableInstance.getVariableName().equals(Constants.APPROVE_RESULT)) {
            map.put(Constants.APPROVE_RESULT, variableInstance.getValue().toString());
        } else {
            map.put(Constants.APPROVE_SUGGESTION, variableInstance.getValue().toString());
        }
    }
    return map;
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:23,代码来源:RuntimePageServiceImpl.java

示例9: checkFinished

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
private void checkFinished(ProcessInstance processInstance) {
    // 验证流程已结束
    HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
            .processInstanceId(processInstance.getProcessInstanceId()).singleResult();
    assertNotNull(historicProcessInstance.getEndTime());

    // 查询历史任务
    List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery().list();
    for (HistoricTaskInstance hti : list) {
        System.out.println(hti.getName() + "  " + hti.getDeleteReason());
    }

    // 流程结束后校验监听器设置的变量
    HistoricVariableInstance variableInstance = historyService.createHistoricVariableInstanceQuery().variableName("settedOnEnd").singleResult();
    assertEquals(true, variableInstance.getValue());
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:17,代码来源:TerminateEndEventWithSubprocess.java

示例10: 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

示例11: executeList

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
public List<HistoricVariableInstance> executeList(CommandContext commandContext, Page page) {
  checkQueryOk();
  ensureVariablesInitialized();
  
  List<HistoricVariableInstance> historicVariableInstances = commandContext
          .getHistoricVariableInstanceEntityManager()
          .findHistoricVariableInstancesByQueryCriteria(this, page);
  
  for (HistoricVariableInstance historicVariableInstance: historicVariableInstances) {
    // TODO what about JPAEntityVariableType? see HistoricDetailQueryImpl.executeList
    if (historicVariableInstance instanceof HistoricVariableInstanceEntity) {
      ((HistoricVariableInstanceEntity)historicVariableInstance).getBytes();
    }
  }
  return historicVariableInstances;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:17,代码来源:HistoricVariableInstanceQueryImpl.java

示例12: testScriptExecutionListener

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Deployment(resources = { "org/activiti/examples/bpmn/executionlistener/ScriptExecutionListenerTest.bpmn20.xml" })
public void testScriptExecutionListener() {
	ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("scriptExecutionListenerProcess");     

	if (processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.ACTIVITY)) {
 		List<HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstance.getId()).list();
 		Map<String, Object> varMap = new HashMap<String, Object>();
 		for (HistoricVariableInstance historicVariableInstance : historicVariables) {
 		  varMap.put(historicVariableInstance.getVariableName(), historicVariableInstance.getValue());
     }
 		
 		assertTrue(varMap.containsKey("foo"));
 		assertEquals("FOO", varMap.get("foo"));
 		assertTrue(varMap.containsKey("var1"));
     assertEquals("test", varMap.get("var1"));
     assertFalse(varMap.containsKey("bar"));
     assertTrue(varMap.containsKey("myVar"));
     assertEquals("BAR", varMap.get("myVar"));
	}
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:21,代码来源:ScriptExecutionListenerTest.java

示例13: testSimple

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Deployment
public void testSimple() {
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProc");
  TaskQuery taskQuery = taskService.createTaskQuery();
  Task userTask = taskQuery.singleResult();
  assertEquals("userTask1", userTask.getName());
  
  taskService.complete(userTask.getId(), CollectionUtil.singletonMap("myVar", "test789"));
  
  assertProcessEnded(processInstance.getId());
  
  List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().list();
  assertEquals(1, variables.size());
  
  HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
  assertEquals("test456", historicVariable.getTextValue());
  
  assertEquals(5, historyService.createHistoricActivityInstanceQuery().count());
  assertEquals(3, historyService.createHistoricDetailQuery().count());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:21,代码来源:HistoricVariableInstanceTest.java

示例14: testParallel

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Deployment
public void testParallel() {
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProc");
  TaskQuery taskQuery = taskService.createTaskQuery();
  Task userTask = taskQuery.singleResult();
  assertEquals("userTask1", userTask.getName());
  
  taskService.complete(userTask.getId(), CollectionUtil.singletonMap("myVar", "test789"));
  
  assertProcessEnded(processInstance.getId());
  
  List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().orderByVariableName().asc().list();
  assertEquals(2, variables.size());
  
  HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
  assertEquals("myVar", historicVariable.getName());
  assertEquals("test789", historicVariable.getTextValue());
  
  HistoricVariableInstanceEntity historicVariable1 = (HistoricVariableInstanceEntity) variables.get(1);
  assertEquals("myVar1", historicVariable1.getName());
  assertEquals("test456", historicVariable1.getTextValue());
  
  assertEquals(8, historyService.createHistoricActivityInstanceQuery().count());
  assertEquals(5, historyService.createHistoricDetailQuery().count());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:26,代码来源:HistoricVariableInstanceTest.java

示例15: testTwoSubProcessInParallelWithinSubProcess

import org.activiti.engine.history.HistoricVariableInstance; //导入依赖的package包/类
@Deployment
public void testTwoSubProcessInParallelWithinSubProcess() {
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("twoSubProcessInParallelWithinSubProcess");
  assertProcessEnded(processInstance.getId());
  
  List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().orderByVariableName().asc().list();
  assertEquals(2, variables.size());
  
  HistoricVariableInstanceEntity historicVariable = (HistoricVariableInstanceEntity) variables.get(0);
  assertEquals("myVar", historicVariable.getName());
  assertEquals("test101112", historicVariable.getTextValue());
  
  HistoricVariableInstanceEntity historicVariable1 = (HistoricVariableInstanceEntity) variables.get(1);
  assertEquals("myVar1", historicVariable1.getName());
  assertEquals("test789", historicVariable1.getTextValue());
  
  assertEquals(15, historyService.createHistoricActivityInstanceQuery().count());
  assertEquals(7, historyService.createHistoricDetailQuery().count());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:20,代码来源:HistoricVariableInstanceTest.java


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