コード例 #1
0
  private void updateState() {
    synchronized (sync) {
      boolean allComplete = true;

      for (ExecutableFlow flow : flows) {
        switch (flow.getStatus()) {
          case FAILED:
            jobState = Status.FAILED;
            returnProps = new Props();
            return;
          case COMPLETED:
          case SUCCEEDED:
            continue;
          default:
            allComplete = false;
        }
      }

      if (allComplete) {
        jobState = Status.SUCCEEDED;

        returnProps = new Props();

        for (ExecutableFlow flow : flows) {
          returnProps = new Props(returnProps, flow.getReturnProps());
        }

        returnProps.logProperties("Output properties for " + getName());
      }
    }
  }
コード例 #2
0
  private void setAndVerifyParentProps() {
    for (ExecutableFlow flow : flows) {
      if (flow.getStatus() == Status.READY) {
        continue;
      }

      final Props childsParentProps = flow.getParentProps();

      if (parentProps == null) {
        parentProps = childsParentProps;
      } else {
        if (childsParentProps != null && !parentProps.equalsProps(childsParentProps)) {
          throw new IllegalStateException(
              String.format("Parent props differ for sub flows. Flow Id[%s]", id));
        }
      }
    }
  }