public Vertex addProcessInstance(WorkflowExecutionContext context) throws FalconException {
    String processInstanceName = getProcessInstanceName(context);
    LOG.info("Adding process instance: " + processInstanceName);

    Vertex processInstance =
        addVertex(
            processInstanceName,
            RelationshipType.PROCESS_INSTANCE,
            context.getTimeStampAsISO8601());
    addWorkflowInstanceProperties(processInstance, context);

    addInstanceToEntity(
        processInstance,
        context.getEntityName(),
        RelationshipType.PROCESS_ENTITY,
        RelationshipLabel.INSTANCE_ENTITY_EDGE);
    addInstanceToEntity(
        processInstance,
        context.getClusterName(),
        RelationshipType.CLUSTER_ENTITY,
        RelationshipLabel.PROCESS_CLUSTER_EDGE);
    addInstanceToEntity(
        processInstance, context.getWorkflowUser(), RelationshipType.USER, RelationshipLabel.USER);

    if (isPreserveHistory()) {
      Process process = ConfigurationStore.get().get(EntityType.PROCESS, context.getEntityName());
      addDataClassification(process.getTags(), processInstance);
      addPipelines(process.getPipelines(), processInstance);
    }

    return processInstance;
  }
 private static void bindTagsProperties(
     final org.apache.falcon.entity.v0.process.Process process,
     final Properties extensionProperties) {
   String falconSystemTags = process.getTags();
   String tags = extensionProperties.getProperty(ExtensionProperties.JOB_TAGS.getName());
   if (StringUtils.isNotEmpty(tags)) {
     if (StringUtils.isNotEmpty(falconSystemTags)) {
       tags += ", " + falconSystemTags;
     }
     process.setTags(tags);
   }
 }
  public void updateProcessEntity(Process oldProcess, Process newProcess) {
    LOG.info("Updating process entity: {}", newProcess.getName());
    Vertex processEntityVertex = findVertex(oldProcess.getName(), RelationshipType.PROCESS_ENTITY);
    if (processEntityVertex == null) {
      LOG.error("Illegal State: Process entity vertex must exist for {}", oldProcess.getName());
      throw new IllegalStateException(oldProcess.getName() + " entity vertex must exist");
    }

    updateWorkflowProperties(
        oldProcess.getWorkflow(),
        newProcess.getWorkflow(),
        processEntityVertex,
        newProcess.getName());
    updateDataClassification(oldProcess.getTags(), newProcess.getTags(), processEntityVertex);
    updatePipelines(oldProcess.getPipelines(), newProcess.getPipelines(), processEntityVertex);
    updateProcessClusters(
        oldProcess.getClusters().getClusters(),
        newProcess.getClusters().getClusters(),
        processEntityVertex);
    updateProcessInputs(oldProcess.getInputs(), newProcess.getInputs(), processEntityVertex);
    updateProcessOutputs(oldProcess.getOutputs(), newProcess.getOutputs(), processEntityVertex);
  }
  public void addProcessEntity(Process process) {
    String processName = process.getName();
    LOG.info("Adding process entity: {}", processName);
    Vertex processVertex = addVertex(processName, RelationshipType.PROCESS_ENTITY);
    addWorkflowProperties(process.getWorkflow(), processVertex, processName);

    addUserRelation(processVertex);
    addDataClassification(process.getTags(), processVertex);
    addPipelines(process.getPipelines(), processVertex);

    for (org.apache.falcon.entity.v0.process.Cluster cluster :
        process.getClusters().getClusters()) {
      addRelationToCluster(
          processVertex, cluster.getName(), RelationshipLabel.PROCESS_CLUSTER_EDGE);
    }

    addInputFeeds(process.getInputs(), processVertex);
    addOutputFeeds(process.getOutputs(), processVertex);
  }