Package org.jbpm.pvm.internal.xml

Examples of org.jbpm.pvm.internal.xml.Parse


    }
   
    for (Element importElement : XmlUtil.elements(documentElement, "import")) {
      if (importElement.hasAttribute("resource")) {
        String resource = importElement.getAttribute("resource");
        Parse importParse = createParse()
          .setResource(resource)
          .pushObject(jbpmConfiguration)
          .execute();
       
        parse.addProblems(importParse.getProblems());
      }
    }

    Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
    if (processEngineElement != null) {
View Full Code Here


    for (String resourceName: deployment.getResourceNames()) {
     
      if (resourceName.endsWith(".jpdl.xml")) {
        byte[] bytes = deployment.getBytes(resourceName);
        InputStream inputStream = new ByteArrayInputStream(bytes);
        Parse parse = jpdlParser.createParse();
        parse.setProblems(deployment.getProblems());
        parse.setInputStream(inputStream);
        parse.execute();
        JpdlProcessDefinition processDefinition = (JpdlProcessDefinition) parse.getDocumentObject();
        if ((processDefinition != null) && (processDefinition.getName() != null)) {
          String processDefinitionName = processDefinition.getName();
         
          processDefinition.setSuspended(deployment.isSuspended());
         
View Full Code Here

    for (String resourceName: deployment.getResourceNames()) {
     
      if (resourceName.endsWith(extension)) {
        byte[] bytes = deployment.getBytes(resourceName);
        InputStream inputStream = new ByteArrayInputStream(bytes);
        Parse parse = parser.createParse();
        parse.contextMapPut(Parse.CONTEXT_KEY_DEPLOYMENT, deployment);
        parse.setProblems(deployment.getProblems());
        parse.setInputStream(inputStream);
        parse.execute();
        List<ProcessDefinitionImpl> processDefinitions = (List<ProcessDefinitionImpl>) parse.getDocumentObject();
        if (processDefinitions!=null) {
          for (ProcessDefinitionImpl processDefinition : processDefinitions) {
            if ((processDefinition != null) && (processDefinition.getName() != null)) {
              String processDefinitionName = processDefinition.getName();

              processDefinition.setSuspended(deployment.isSuspended());

              String imageResourceName = resourceName.substring(0, resourceName.lastIndexOf(extension)) + ".png";
              if (deployment.getResourceNames().contains(imageResourceName)) {
                processDefinition.setImageResourceName(imageResourceName);
              }

              processDefinition.setDeploymentDbid(deployment.getDbid());

              if (deployment.hasObjectProperties(processDefinitionName)) {
                String key = deployment.getProcessDefinitionKey(processDefinitionName);
                String id = deployment.getProcessDefinitionId(processDefinitionName);
                Long version = deployment.getProcessDefinitionVersion(processDefinitionName);
                processDefinition.setId(id);
                processDefinition.setKey(key);
                processDefinition.setVersion(version.intValue());
           
              } else {
                checkKey(processDefinition, deployment);
                checkVersion(processDefinition, deployment);
                checkId(processDefinition, deployment);

                deployment.setProcessDefinitionId(processDefinitionName, processDefinition.getId());
                deployment.setProcessDefinitionKey(processDefinitionName, processDefinition.getKey());
                deployment.setProcessDefinitionVersion(processDefinitionName, new Long(processDefinition.getVersion()));
               
                //execute migration
                Map<ProcessDefinition, MigrationDescriptor> migrations = (Map<ProcessDefinition, MigrationDescriptor>)parse.contextMapGet(Parse.CONTEXT_KEY_MIGRATIONS);
                if (migrations != null) {
                  MigrationDescriptor migrationDescriptor = migrations.get(processDefinition);
                  if (migrationDescriptor != null) {
                    InstanceMigrator.migrateAll(processDefinition, migrationDescriptor);
                  }
View Full Code Here

    }

    for (Element importElement : XmlUtil.elements(documentElement, "import")) {
      if (importElement.hasAttribute("resource")) {
        String resource = importElement.getAttribute("resource");
        Parse importParse = createParse()
          .setResource(resource)
          .contextStackPush(configuration)
          .propagateContexMap(parse)
          .execute();
       
        parse.addProblems(importParse.getProblems());
      }
    }

    Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
    if (processEngineElement != null) {
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.xml.Parse

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.