Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.ProcessDefinition


    if( StringUtils.isEmpty(bizKey) ){
      this.addActionError("流程["+procInstId+"]无业务数据关联!");
      return INPUT;
    }
   
    ProcessDefinition procDef = workflowManager.getProcessDefinition(
        hisProc.getProcessDefinitionId());
    if( procDef == null ){
      this.addActionError("流程定义["+hisProc.getProcessDefinitionId()+"]数据不存在!");
      return INPUT;
    }
   
    request.setAttribute("bizKey", bizKey);
    BizView bizView = bizViewManager.get( procDef.getKey() );
    if( bizView == null ){
      this.addActionError("流程定义["+procDef.getKey()+"]数据展示未配置!");
      return INPUT;
    }
    request.setAttribute("bizView", bizView);
   
    return SUCCESS;
View Full Code Here


    String procInstId = execution.getProcessInstanceId();
    String bizKey = execution.getProcessBusinessKey();
   
    log.debug("流程挂钩业务处理,流程定义Id[{}],业务关联Key[{}]",procDefId,bizKey);
   
    ProcessDefinition procDef = workflowManager.getProcessDefinition(procDefId);
    if( procDef == null ){
      log.error("工作流定义[{}]不存在!",procDefId);
      return;
    }
   
    String procDefKey = procDef.getKey(); //流程定义Key
    BusinessManager bizMgr = getBizManager( procDefKey );
   
    Object motion = execution.getVariable(
        WorkflowConstant.TASK_ACTIOIN_VARIABLE_NAME );
   
View Full Code Here

    @Override
    public WorkflowDefinitionTO getDefinition()
            throws WorkflowException {

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);
        Reader reader = null;
        Writer writer = new StringWriter();
        try {
            reader = new BufferedReader(new InputStreamReader(procDefIS));

            int n;
            char[] buffer = new char[1024];
            while ((n = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, n);
            }
        } catch (IOException e) {
            LOG.error("While reading workflow definition {}", procDef.getKey(), e);
        } finally {
            IOUtils.closeQuietly(reader);
            IOUtils.closeQuietly(procDefIS);
        }
View Full Code Here

    @Override
    public WorkflowDefinitionTO getDefinition()
            throws WorkflowException {

        ProcessDefinition procDef;
        try {
            procDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey(
                    ActivitiUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().singleResult();
        } catch (ActivitiException e) {
            throw new WorkflowException(e);
        }

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);
        Reader reader = null;
        Writer writer = new StringWriter();
        try {
            reader = new BufferedReader(new InputStreamReader(procDefIS));

            int n;
            char[] buffer = new char[1024];
            while ((n = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, n);
            }
        } catch (IOException e) {
            LOG.error("While reading workflow definition {}", procDef.getKey(), e);
        } finally {
            try {
                if (reader != null) {
                    reader.close();
                }
                if (procDefIS != null) {
                    procDefIS.close();
                }
            } catch (IOException ioe) {
                LOG.error("While closing input stream for {}", procDef.getKey(), ioe);
            }
        }

        WorkflowDefinitionTO definitionTO = new WorkflowDefinitionTO();
        definitionTO.setId(ActivitiUserWorkflowAdapter.WF_PROCESS_ID);
View Full Code Here

    public List<String> getDefinedTasks()
            throws WorkflowException {

        List<String> result = new ArrayList<String>();

        ProcessDefinition procDef;
        try {
            procDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey(
                    ActivitiUserWorkflowAdapter.WF_PROCESS_ID).latestVersion().singleResult();
        } catch (ActivitiException e) {
            throw new WorkflowException(e);
        }

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);

        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder builder = domFactory.newDocumentBuilder();
            Document doc = builder.parse(procDefIS);

            XPath xpath = XPathFactory.newInstance().newXPath();

            NodeList nodeList = (NodeList) xpath.evaluate("//userTask | //serviceTask | //scriptTask", doc,
                    XPathConstants.NODESET);
            for (int i = 0; i < nodeList.getLength(); i++) {
                result.add(nodeList.item(i).getAttributes().getNamedItem("id").getNodeValue());
            }
        } catch (Exception e) {
            throw new WorkflowException(e);
        } finally {
            try {
                procDefIS.close();
            } catch (IOException ioe) {
                LOG.error("While closing input stream for {}", procDef.getKey(), ioe);
            }
        }

        return result;
    }
View Full Code Here

    @Override
    public WorkflowDefinitionTO getDefinition()
            throws WorkflowException {

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);
        Reader reader = null;
        Writer writer = new StringWriter();
        try {
            reader = new BufferedReader(new InputStreamReader(procDefIS));

            int n;
            char[] buffer = new char[1024];
            while ((n = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, n);
            }
        } catch (IOException e) {
            LOG.error("While reading workflow definition {}", procDef.getKey(), e);
        } finally {
            IOUtils.closeQuietly(reader);
            IOUtils.closeQuietly(procDefIS);
        }
View Full Code Here

    public List<String> getDefinedTasks()
            throws WorkflowException {

        List<String> result = new ArrayList<String>();

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);

        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder builder = domFactory.newDocumentBuilder();
            Document doc = builder.parse(procDefIS);
View Full Code Here

    @Override
    public WorkflowDefinitionTO getDefinition()
            throws WorkflowException {

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);
        Reader reader = null;
        Writer writer = new StringWriter();
        try {
            reader = new BufferedReader(new InputStreamReader(procDefIS));

            int n;
            char[] buffer = new char[1024];
            while ((n = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, n);
            }
        } catch (IOException e) {
            LOG.error("While reading workflow definition {}", procDef.getKey(), e);
        } finally {
            IOUtils.closeQuietly(reader);
            IOUtils.closeQuietly(procDefIS);
        }
View Full Code Here

    @Override
    public WorkflowDefinitionTO getDefinition()
            throws WorkflowException {

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);
        Reader reader = null;
        Writer writer = new StringWriter();
        try {
            reader = new BufferedReader(new InputStreamReader(procDefIS));

            int n;
            char[] buffer = new char[1024];
            while ((n = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, n);
            }
        } catch (IOException e) {
            LOG.error("While reading workflow definition {}", procDef.getKey(), e);
        } finally {
            IOUtils.closeQuietly(reader);
            IOUtils.closeQuietly(procDefIS);
        }
View Full Code Here

    public List<String> getDefinedTasks()
            throws WorkflowException {

        List<String> result = new ArrayList<String>();

        ProcessDefinition procDef = getProcessDefinition();

        InputStream procDefIS = repositoryService.getResourceAsStream(procDef.getDeploymentId(), WF_PROCESS_RESOURCE);

        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder builder = domFactory.newDocumentBuilder();
            Document doc = builder.parse(procDefIS);
View Full Code Here

TOP

Related Classes of org.activiti.engine.repository.ProcessDefinition

Copyright © 2018 www.massapicom. 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.