Package org.camunda.bpm.engine.impl.persistence.entity

Examples of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity


    Cmmn.writeModelToStream(outputStream, modelInstance);
    InputStream inputStream = IoUtil.convertOutputStreamToInputStream(outputStream);

    byte[] model = org.camunda.bpm.engine.impl.util.IoUtil.readInputStream(inputStream, "model");

    ResourceEntity resource = new ResourceEntity();
    resource.setBytes(model);
    resource.setName("test");

    transformer.setResource(resource);
    List<CaseDefinitionEntity> definitions = transformer.transform();

    IoUtil.closeSilently(outputStream);
View Full Code Here


    for (String resourceName : resources.keySet()) {
      BpmnParse bpmnParse = null;

      LOG.info("Processing resource " + resourceName);
      if (isBpmnResource(resourceName)) {
        ResourceEntity resource = resources.get(resourceName);
        byte[] bytes = resource.getBytes();
        ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);


        bpmnParse = bpmnParser
          .createParse()
View Full Code Here

    }
    return bpmnFileResource;
  }

  protected void createResource(String name, byte[] bytes, DeploymentEntity deploymentEntity) {
    ResourceEntity resource = new ResourceEntity();
    resource.setName(name);
    resource.setBytes(bytes);
    resource.setDeploymentId(deploymentEntity.getId());

    // Mark the resource as 'generated'
    resource.setGenerated(true);

    Context
      .getCommandContext()
      .getDbEntityManager()
      .insert(resource);
View Full Code Here

      } finally {
        IoUtil.closeSilently(resourceAsStream);
      }
    }
    else if (resourceType.equals("deployment")) {
      ResourceEntity resourceEntity = deployment.getResource(resourceLocation);
      if (resourceEntity != null) {
        resourceBytes = resourceEntity.getBytes();
      }
    }

    if (resourceBytes != null) {
      return new String(resourceBytes, Charset.forName("UTF-8"));
View Full Code Here

  }

  protected String getFormTemplateString(FormData formInstance, String formKey) {
    String deploymentId = formInstance.getDeploymentId();

    ResourceEntity resourceStream = Context
      .getCommandContext()
      .getResourceManager()
      .findResourceByDeploymentIdAndResourceName(deploymentId, formKey);

    ensureNotNull("Form with formKey '" + formKey + "' does not exist", "resourceStream", resourceStream);

    byte[] resourceBytes = resourceStream.getBytes();
    String encoding = "UTF-8";
    String formTemplateString = "";
    try {
      formTemplateString = new String(resourceBytes, encoding);
    } catch (UnsupportedEncodingException e) {
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity

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.