Examples of ResourceEntity


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

  public InputStream execute(CommandContext commandContext) {
    ensureNotNull("deploymentId", deploymentId);
    ensureNotNull("resourceName", resourceName);

    ResourceEntity resource = commandContext
      .getResourceManager()
      .findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
    ensureNotNull(DeploymentResourceNotFoundException.class, "no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", "resource", resource);
    return new ByteArrayInputStream(resource.getBytes());
  }
View Full Code Here

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

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

    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

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

    }
    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

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

      } 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

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

  }

  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
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.