public void remove(WorkflowExecution workflowExecution) {
   String collection = workflowExecution.getCollection();
   if (!workflowsExecutionsMap.containsKey(collection + workflowExecution.getId())) {
     throw new WorkflowExecutionIndexRuntimeException_WorkflowExecutionNotFound(
         workflowExecution.getId(), collection);
   }
   String filePath =
       collection
           + File.separator
           + EXECUTION_FOLDER
           + File.separator
           + workflowExecution.getId()
           + XML_EXTENSION;
   oneXMLConfigPerCollectionManager.updateXML(
       collection, newRemoveWorkflowExcecutionIndexDocumentAlteration(workflowExecution));
   configManager.delete(filePath);
 }
Exemplo n.º 2
0
 public List<String> getRoles(WorkflowExecution execution) {
   List<String> processedRoles = new ArrayList<>();
   for (String role : roles) {
     if (role.startsWith("${")) {
       processedRoles.add(execution.getVariable(StringUtils.substringBetween(role, "${", "}")));
     } else {
       processedRoles.add(role);
     }
   }
   return processedRoles;
 }
 public void addUpdate(WorkflowExecution workflowExecution) {
   String collection = workflowExecution.getCollection();
   String filePath =
       collection
           + File.separator
           + EXECUTION_FOLDER
           + File.separator
           + workflowExecution.getId()
           + XML_EXTENSION;
   if (!workflowsExecutionsMap.containsKey(collection + workflowExecution.getId())) {
     oneXMLConfigPerCollectionManager.updateXML(
         collection, newAddWorkflowExcecutionIndexDocumentAlteration(workflowExecution));
   } else {
     oneXMLConfigPerCollectionManager.updateXML(
         collection, newUpdateWorkflowExcecutionIndexDocumentAlteration(workflowExecution));
     configManager.delete(filePath);
   }
   configManager.createXMLDocumentIfInexistent(
       filePath, newAddWorkflowExcecutionDocumentAlteration(workflowExecution));
 }
 public void markAsNotWaitingForSystem(String collection, String id) {
   WorkflowExecution workflowExecution = getWorkflow(collection, id);
   workflowExecution.setMarkAsWaitingForSystem(false);
   addUpdate(workflowExecution);
 }