Examples of ProcessDefinitionBehavior


Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    String processId = StringUtil.getString(processDataMap.get("PROCESS_ID"));
    String deploymentId = StringUtil.getString(processDataMap.get("DEPLOYMENT_ID"));
    String resourceName = StringUtil.getString(processDataMap.get("RESOURCE_NAME"));
    String processKey = StringUtil.getString(processDataMap.get("PROCESS_KEY"));
    DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
    ProcessDefinitionBehavior processDefinition = deploymentCache.getProcessDefinitionCache().get(processId);
    if (processDefinition == null) {
      String sqlText = "SELECT BYTES FROM FIXFLOW_DEF_BYTEARRAY WHERE NAME=? and DEPLOYMENT_ID=?";
      // 构建查询参数
      List<Object> objectParamWhere = new ArrayList<Object>();
      objectParamWhere.add(resourceName);
      objectParamWhere.add(deploymentId);
      List<Map<String, Object>> dataObj = sqlCommand.queryForList(sqlText, objectParamWhere);
      Map<String, Object> dataMap = dataObj.get(0);
      Object bytesObject = dataMap.get("BYTES");
      if (bytesObject != null) {
        byte[] bytes = (byte[]) bytesObject;
        ResourceSet resourceSet = getResourceSet();
        String fixflowFilePath =  ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration().getNoneTemplateFilePath();
        URL url = ReflectUtil.getResource(fixflowFilePath);
        if(url == null){
          throw new FixFlowClassLoadingException(ExceptionCode.CLASSLOAD_EXCEPTION_FILENOTFOUND,fixflowFilePath);
        }
        String filePath = url.toString();
        Resource ddddResource = null;
        try {
          if (!filePath.startsWith("jar")) {
            filePath = java.net.URLDecoder.decode(url.getFile(),"utf-8");
            ddddResource = resourceSet.createResource(URI.createFileURI(filePath));
          } else {
            ddddResource = resourceSet.createResource(URI.createURI(filePath));
          }
          ddddResource.load(new ByteArrayInputStream(bytes), null);
        } catch (Exception e) {
          throw new FixFlowClassLoadingException(ExceptionCode.CLASSLOAD_EXCEPTION, e);
        }
        DefinitionsBehavior definitions = (DefinitionsBehavior) ddddResource.getContents().get(0).eContents().get(0);
        definitions.setProcessId(processId);

        for (RootElement rootElement : definitions.getRootElements()) {
          if (rootElement instanceof ProcessDefinitionBehavior) {
            ProcessDefinitionBehavior processObj = (ProcessDefinitionBehavior) rootElement;
            if (processObj.getProcessDefinitionKey().equals(processKey)) {
              processDefinition = (ProcessDefinitionBehavior) rootElement;
              break;
            }
          }
        }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    List<Object> objectParamWhere = new ArrayList<Object>();
    objectParamWhere.add(processDefinitionKey);
    objectParamWhere.add(processDefinitionVersion);
    List<Map<String, Object>> dataObj = sqlCommand.queryForList(sqlText, objectParamWhere);
    Map<String, Object> dataMap = dataObj.get(0);
    ProcessDefinitionBehavior processDefinition = getProcessDefinition(dataMap);
    return processDefinition;
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    List<Object> objectParamWhere = new ArrayList<Object>();
    objectParamWhere.add(processKeyTemp);
    objectParamWhere.add(deploymentIdTemp);
    List<Map<String, Object>> dataObj = sqlCommand.queryForList(sqlText, objectParamWhere);
    Map<String, Object> dataMap = dataObj.get(0);
    ProcessDefinitionBehavior processDefinition = getProcessDefinition(dataMap);

    return processDefinition;
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

public class CoreUtil {

  public static List<TaskCommandInst> getTaskCommandInst(TaskInstance taskInstance,boolean isProcessTracking) {

    ProcessDefinitionManager processDefinitionManager = Context.getCommandContext().getProcessDefinitionManager();
    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(taskInstance.getProcessDefinitionId());

    return getTaskCommandInst(taskInstance, processDefinition,isProcessTracking);

  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

      if(state){
        Map<String, String> dataMap=new HashMap<String, String>();
       
   

        ProcessDefinitionBehavior processDefinition = processDefinitionManager
            .findLatestProcessDefinitionByKey(processKey);
       
       
       
        String startFormKey=null;
        if(processDefinition!=null){
          startFormKey=processDefinition.getStartFormKey();
        }
        else{
          continue;
        }
       
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

  private static String processState(TaskInstance taskInstanceQueryTo,ProcessEngine engine)
      throws Exception {
    String taskInfo = "";
    String assignee = taskInstanceQueryTo.getAssignee();
    ProcessDefinitionBehavior processDefinition = engine.getModelService().getProcessDefinition(taskInstanceQueryTo
        .getProcessDefinitionId());
    String nodeName = processDefinition.getFlowElement(
        taskInstanceQueryTo.getNodeId()).getName();
    taskInfo = taskInfo + nodeName;
    IdentityService identityService = engine.getIdentityService();
    if (assignee == null) {
      List<UserTo> userTos = new ArrayList<UserTo>();
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token=processInstanceImpl.getTokenMap().get(tokenId);
   
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

 
  public String execute(CommandContext commandContext) {
    // TODO Auto-generated method stub
    ProcessDefinitionManager processDefinitionManager =commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager
        .findLatestProcessDefinitionByKey(processDefinitionKey);
    if(processDefinition==null)
    {
      throw new FixFlowException("Key 为 :"+processDefinitionKey+" 的流程定义不存在!");
    }
   
   
   

    return processDefinition.getStartFormKey();
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    String processInstanceId = taskInstanceQuery.getProcessInstanceId();

    ProcessDefinitionManager processDefinitionManager = Context.getCommandContext().getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token = processInstanceImpl.getTokenMap().get(tokenId);

    ExecutionContext executionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(token);
   
   
    UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(nodeId);
   
    TaskCommandInst taskCommandInst =userTask.getTaskCommandsMap().get(taskCommandId);
    List<TaskInstance> taskInstances=new ArrayList<TaskInstance>();
   
   
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.bpmn.behavior.ProcessDefinitionBehavior

    stencilsetNode.put("url", "../editor/stencilsets/bpmn2.0/bpmn2.0.json");
    modelNode.put("stencilset", stencilsetNode);
   
    ArrayNode shapesArrayNode = objectMapper.createArrayNode();
   
    ProcessDefinitionBehavior mainProcess = null;
    mainProcess=(ProcessDefinitionBehavior)BpmnModelUtil.getProcess(model);
    EMFExtensionUtil.getDataVariables(mainProcess);

    ObjectNode propertiesNode = objectMapper.createObjectNode();
    if (StringUtils.isNotEmpty(mainProcess.getId())) {
      propertiesNode.put(PROPERTY_OVERRIDE_ID, mainProcess.getId());
    }
    if (StringUtils.isNotEmpty(mainProcess.getName())) {
      propertiesNode.put(PROPERTY_NAME, mainProcess.getName());
    }
   
    //fixflow扩展流程属性
    String category = mainProcess.getCategory();
  if(category != null){
    propertiesNode.put(PROPERTY_PROCESS_CATEGORY, mainProcess.getCategory());
  }
    TaskSubjectBehavior taskSubject =  mainProcess.getTaskSubject();
    if(taskSubject!= null){
      propertiesNode.put(PROPERTY_PROCESS_SUBJECT, mainProcess.getTaskSubject().getExpressionValue());
    }
  
    FormUri formObj = mainProcess.getFormUriObj();
    if(formObj != null){
       propertiesNode.put(PROPERTY_PROCESS_DEFAULT_FORMURI,formObj.getExpression().getValue());
    }
    boolean isVerify = mainProcess.isVerification();
    propertiesNode.put(PROPERTY_PROCESS_IS_VERIFY,isVerify);
    //由于获取流程模型的时候没有loadvariable,所以此处先用emf原始加载的方式加载数据变量,后期可能需要改掉
    List<DataVariable> dataVariables = EMFExtensionUtil.getDataVariables(mainProcess);
    if(dataVariables != null){
      ObjectNode datavariableNode = objectMapper.createObjectNode();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.