Search in sources :

Example 1 with ResourceManager

use of org.camunda.bpm.engine.impl.persistence.entity.ResourceManager in project camunda-bpm-platform by camunda.

the class DeployCmd method getResourcesByName.

protected List<ResourceEntity> getResourcesByName(Map<String, Set<String>> resourcesByName, CommandContext commandContext) {
    List<ResourceEntity> result = new ArrayList<ResourceEntity>();
    ResourceManager resourceManager = commandContext.getResourceManager();
    for (String deploymentId : resourcesByName.keySet()) {
        Set<String> resourceNames = resourcesByName.get(deploymentId);
        String[] resourceNameArray = resourceNames.toArray(new String[resourceNames.size()]);
        List<ResourceEntity> resources = resourceManager.findResourceByDeploymentIdAndResourceNames(deploymentId, resourceNameArray);
        ensureResourcesWithNamesExist(deploymentId, resourceNames, resources);
        result.addAll(resources);
    }
    return result;
}
Also used : ResourceEntity(org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity) ArrayList(java.util.ArrayList) ResourceManager(org.camunda.bpm.engine.impl.persistence.entity.ResourceManager)

Example 2 with ResourceManager

use of org.camunda.bpm.engine.impl.persistence.entity.ResourceManager in project camunda-bpm-platform by camunda.

the class DeployCmd method getResourcesById.

protected List<ResourceEntity> getResourcesById(Map<String, Set<String>> resourcesById, CommandContext commandContext) {
    List<ResourceEntity> result = new ArrayList<ResourceEntity>();
    ResourceManager resourceManager = commandContext.getResourceManager();
    for (String deploymentId : resourcesById.keySet()) {
        Set<String> resourceIds = resourcesById.get(deploymentId);
        String[] resourceIdArray = resourceIds.toArray(new String[resourceIds.size()]);
        List<ResourceEntity> resources = resourceManager.findResourceByDeploymentIdAndResourceIds(deploymentId, resourceIdArray);
        ensureResourcesWithIdsExist(deploymentId, resourceIds, resources);
        result.addAll(resources);
    }
    return result;
}
Also used : ResourceEntity(org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity) ArrayList(java.util.ArrayList) ResourceManager(org.camunda.bpm.engine.impl.persistence.entity.ResourceManager)

Aggregations

ArrayList (java.util.ArrayList)2 ResourceEntity (org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity)2 ResourceManager (org.camunda.bpm.engine.impl.persistence.entity.ResourceManager)2