Package org.jbpm.pvm.internal.env

Examples of org.jbpm.pvm.internal.env.Environment


  public URL getDiagramURL(String id)
  {
    URL result = null;

    // check resource availability
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
    boolean hasImageResource = false;

    try
    {
      RepositoryService repositoryService = this.processEngine.getRepositoryService();
      ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
          .processDefinitionId(id)
          .uniqueResult();

      InputStream inputStream = null;
      if(processDefinition!=null)//TODO: JBPM-2383 Suspended definitions don't show up here
      {
        String imgRes = processDefinition.getImageResourceName();
        inputStream = repositoryService.getResourceAsStream(
            processDefinition.getDeploymentId(), imgRes
        );
      }

      if(inputStream!=null)
      {
        hasImageResource = true;
        try
        {
          inputStream.close();
        }
        catch (IOException e)
        {
          throw new RuntimeException("Failed to close stream", e);
        }
      }

    }
    finally{
      env.close();
    }

    if(hasImageResource)
    {
      StringBuilder sb = getBaseUrl().append("/process/definition/");
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.env.Environment

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.