コード例 #1
0
  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;
  }