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


Java DeploymentCache类代码示例

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


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

示例1: deploy

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public void deploy(DeploymentEntity deployment) {
  KnowledgeBuilder knowledgeBuilder = null;

  DeploymentCache deploymentCache = Context
    .getProcessEngineConfiguration()
    .getDeploymentCache();
  
  Map<String, ResourceEntity> resources = deployment.getResources();
  for (String resourceName : resources.keySet()) {
    log.info("Processing resource " + resourceName);
    if (resourceName.endsWith(".drl")) { // is only parsing .drls sufficient? what about other rule dsl's? (@see ResourceType)
      if (knowledgeBuilder==null) {
        knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      }
      ResourceEntity resourceEntity = resources.get(resourceName);
      byte[] resourceBytes = resourceEntity.getBytes();
      Resource droolsResource = ResourceFactory.newByteArrayResource(resourceBytes);
      knowledgeBuilder.add(droolsResource, ResourceType.DRL);
    }
  }
  
  if (knowledgeBuilder!=null) {
    KnowledgeBase knowledgeBase = knowledgeBuilder.newKnowledgeBase();
    deploymentCache.addKnowledgeBase(deployment.getId(), knowledgeBase);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:RulesDeployer.java

示例2: execute

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public ProcessInstance execute(CommandContext commandContext) {
  DeploymentCache deploymentCache = Context
    .getProcessEngineConfiguration()
    .getDeploymentCache();
  
  ProcessDefinitionEntity processDefinition = null;
  if (processDefinitionId!=null) {
    processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
    if (processDefinition == null) {
      throw new ActivitiException("No process definition found for id = '" + processDefinitionId + "'");
    }
  } else if(processDefinitionKey != null){
    processDefinition = deploymentCache.findDeployedLatestProcessDefinitionByKey(processDefinitionKey);
    if (processDefinition == null) {
      throw new ActivitiException("No process definition found for key '" + processDefinitionKey +"'");
    }
  } else {
    throw new ActivitiException("processDefinitionKey and processDefinitionId are null");
  }
  
  ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey);

  if (variables!=null) {
    processInstance.setVariables(variables);
  }
  
  processInstance.start();
  
  return processInstance;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:31,代码来源:StartProcessInstanceCmd.java

示例3: execute

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public ProcessInstance execute(CommandContext commandContext) {
  
  if(messageName == null) {
    throw new ActivitiException("Cannot start process instance by message: message name is null");
  }
  
  MessageEventSubscriptionEntity messageEventSubscription = commandContext.getEventSubscriptionManager()
    .findMessageStartEventSubscriptionByName(messageName);
  
  if(messageEventSubscription == null) {
    throw new ActivitiException("Cannot start process instance by message: no subscription to message with name '"+messageName+"' found.");
  }
  
  String processDefinitionId = messageEventSubscription.getConfiguration();
  if(processDefinitionId == null) {
    throw new ActivitiException("Cannot start process instance by message: subscription to message with name '"+messageName+"' is not a message start event.");
  }
      
  DeploymentCache deploymentCache = Context
          .getProcessEngineConfiguration()
          .getDeploymentCache();
        
  ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
  if (processDefinition == null) {
      throw new ActivitiException("No process definition found for id '" + processDefinitionId + "'");
  }

  ActivityImpl startActivity = processDefinition.findActivity(messageEventSubscription.getActivityId());
  ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, startActivity);

  if (processVariables != null) {
    processInstance.setVariables(processVariables);
  }
  
  processInstance.start();
  
  return processInstance;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:39,代码来源:StartProcessInstanceByMessageCmd.java

示例4: execute

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public Void execute(CommandContext commandContext) {
  
  if (processDefinitionId == null) {
    throw new ActivitiIllegalArgumentException("Process definition id is null");
  }
  
  ProcessDefinitionEntity processDefinition = Context
          .getCommandContext()
          .getProcessDefinitionEntityManager()
          .findProcessDefinitionById(processDefinitionId);

  if (processDefinition == null) {
    throw new ActivitiObjectNotFoundException("No process definition found for id = '" + processDefinitionId + "'", ProcessDefinition.class);
  }
  
  // Update category
  processDefinition.setCategory(category);
  
  // Remove process definition from cache, it will be refetched later
  DeploymentCache<ProcessDefinitionEntity> processDefinitionCache = 
          Context.getProcessEngineConfiguration().getProcessDefinitionCache();
  if (processDefinitionCache != null) {
    processDefinitionCache.remove(processDefinitionId);
  }
  
  return null;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:28,代码来源:SetProcessDefinitionCategoryCmd.java

示例5: getDeploymentCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public DeploymentCache getDeploymentCache() {
  return deploymentCache;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java

示例6: setDeploymentCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public void setDeploymentCache(DeploymentCache deploymentCache) {
  this.deploymentCache = deploymentCache;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java

示例7: getProcessDefinitionCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public DeploymentCache<ProcessDefinitionEntity> getProcessDefinitionCache() {
  return processDefinitionCache;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java

示例8: setProcessDefinitionCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setProcessDefinitionCache(DeploymentCache<ProcessDefinitionEntity> processDefinitionCache) {
  this.processDefinitionCache = processDefinitionCache;
  return this;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:5,代码来源:ProcessEngineConfigurationImpl.java

示例9: getKnowledgeBaseCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public DeploymentCache<Object> getKnowledgeBaseCache() {
  return knowledgeBaseCache;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java

示例10: setKnowledgeBaseCache

import org.activiti.engine.impl.persistence.deploy.DeploymentCache; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setKnowledgeBaseCache(DeploymentCache<Object> knowledgeBaseCache) {
  this.knowledgeBaseCache = knowledgeBaseCache;
  return this;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:5,代码来源:ProcessEngineConfigurationImpl.java


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