Create service check decision state.

@param flow the flow
516672
protected void createServiceCheckDecisionState(final Flow flow) {
        createDecisionState(flow, CasWebflowConstants.STATE_ID_SERVICE_CHECK,
            "flowScope.service != null",
            CasWebflowConstants.STATE_ID_GENERATE_SERVICE_TICKET,
            CasWebflowConstants.STATE_ID_VIEW_GENERIC_LOGIN_SUCCESS);
    }
1335889
protected void createWarnDecisionState(final Flow flow) {
        createDecisionState(flow, CasWebflowConstants.STATE_ID_WARN,
            "flowScope.warnCookieValue",
            CasWebflowConstants.STATE_ID_SHOW_WARNING_VIEW,
            CasWebflowConstants.STATE_ID_REDIRECT);
    }
259461
protected void createGenerateServiceTicketAction(final Flow flow) {
        val handler = createActionState(flow,
            CasWebflowConstants.STATE_ID_GENERATE_SERVICE_TICKET,
            createEvaluateAction(CasWebflowConstants.ACTION_ID_GENERATE_SERVICE_TICKET));
        createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.STATE_ID_REDIRECT);
        createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_WARN, CasWebflowConstants.STATE_ID_WARN);
        createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, CasWebflowConstants.STATE_ID_HANDLE_AUTHN_FAILURE);
        createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_ERROR, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
        createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_GATEWAY, CasWebflowConstants.STATE_ID_GATEWAY_SERVICES_MGMT_CHECK);
    }
923071
@Override
    public Flow getFlow()
    {
        return new Flow()
        {
            @Override
            public boolean isHandled()
            {
                return false;
            }

            @Override
            public boolean is(Flow type)
            {
                return false;
            }
        };
    }
798259
protected void createRealSubmitAction(final Flow flow) {
        val state = createActionState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, "authenticationViaFormAction");
        createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_WARN, CasWebflowConstants.STATE_ID_WARN);
        createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.STATE_ID_CREATE_TICKET_GRANTING_TICKET);
        createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_SUCCESS_WITH_WARNINGS, CasWebflowConstants.STATE_ID_SHOW_AUTHN_WARNING_MSGS);
        createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, CasWebflowConstants.STATE_ID_HANDLE_AUTHN_FAILURE);
        createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_ERROR, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
    }
798838
public void addActionsToActionStateExecutionListAt(final Flow flow, final String actionStateId, final int position, final EvaluateAction... actions) {
        val actionState = getState(flow, actionStateId, ActionState.class);
        val currentActions = new ArrayList<Action>();
        val actionList = actionState.getActionList();
        actionList.forEach(currentActions::add);
        val index = position < 0 || position == Integer.MAX_VALUE ? currentActions.size() : position;
        currentActions.forEach(actionList::remove);
        Arrays.stream(actions).forEach(a -> currentActions.add(index, a));
        actionList.addAll(currentActions.toArray(Action[]::new));
    }
1089157
protected void createRealizationAndState(
    MessageProcessor messageProcessor,
    TransactionCommon transaction)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "createRealizationAndState",
        new Object[] {
          messageProcessor,
          transaction });

                                         
    /*
     * Create associated state handler of appropriate type
     */
      _ptoPRealization = new LinkState(this,
                                          messageProcessor,
                                          getLocalisationManager());
      _protoRealization = _ptoPRealization;
    
          
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createRealizationAndState");
  }
811551
public TransitionableState getTransitionableState(final Flow flow, final String stateId) {
        if (containsFlowState(flow, stateId)) {
            return (TransitionableState) flow.getTransitionableState(stateId);
        }
        return null;
    }
553694
protected void createRememberMeAuthnWebflowConfig(final Flow flow) {
        if (casProperties.getTicket().getTgt().getRememberMe().isEnabled()) {
            createFlowVariable(flow, CasWebflowConstants.VAR_ID_CREDENTIAL, RememberMeUsernamePasswordCredential.class);
            val state = getState(flow, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM, ViewState.class);
            val cfg = getViewStateBinderConfiguration(state);
            cfg.addBinding(new BinderConfiguration.Binding("rememberMe", null, false));
        } else {
            createFlowVariable(flow, CasWebflowConstants.VAR_ID_CREDENTIAL, UsernamePasswordCredential.class);
        }
    }
790493
public static boolean isFinished(final ExecutableFlow flow) {
    switch (flow.getStatus()) {
      case SUCCEEDED:
      case FAILED:
      case KILLED:
        return true;
      default:
        return false;
    }
  }
540322
public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) {
        Exceptions.checkNotClosed(closed.get(), this);
        Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled.");
        log.info("Creating Flow {} for endpoint {}. The current Channel is {}.", flow.getFlowId(), connectionName, channel.get());
        if (flowIdReplyProcessorMap.put(flow.getFlowId(), rp) != null) {
            throw new IllegalArgumentException("Multiple flows cannot be created with the same Flow id " + flow.getFlowId());
        }
        return new ClientConnectionImpl(connectionName, flow.getFlowId(), batchSizeTracker, this);
    }
59342
function handleSuccess() {

    // If any activities failed, we need to fail the workflow
    if (context.failed()) {
      winston.log('warn', 'One of more activities failed in workflow: %s, marking workflow as failed', self.name);

      // Respond back to SWF failing the workflow
      decisionTask.response.fail('Activities failed', { failures: context.errorMessages }, function (err) {
        if (err) {
          winston.log('error', 'Unable to mark workflow: %s as failed due to: %s', self.name, JSON.stringify(err));
          return;
        }
      });

    } else {

      // Check to see if we are done with the workflow
      if (context.done()) {
        winston.log('info', 'Workflow: %s has completed successfuly', self.name);

        // Stop the workflow
        decisionTask.response.stop({
          result: JSON.stringify(context.results)
        });
      }

      // If no decisions made this round, skip
      if (!decisionTask.response.decisions) {
        winston.log('debug', 'No decision can be made this round for workflow: %s', self.name);
        // Record our state when we can't make a decision to help in debugging
        // decisionTask.response.add_marker('current-state', JSON.stringify(context.currentStatus()));
        decisionTask.response.wait();
      }

      // Respond back to SWF with all decisions
      decisionTask.response.respondCompleted(decisionTask.response.decisions, function (err) {
        if (err) {
          winston.log('error', 'Unable to respond to workflow: %s with decisions due to: %s', self.name, JSON.stringify(err));
          return;
        }
      });
    }
  }
124451
protected synchronized void create(boolean stream) throws IOException {
        this.stream = stream;

        if (!stream) {
            ResourceManager.beforeUdpCreate();
            try {
                socketCreate(false);
            } catch (IOException ioe) {
                ResourceManager.afterUdpClose();
                throw ioe;
            }
        } else {
            socketCreate(true);
        }
        if (socket != null)
            socket.setCreated();
        if (serverSocket != null)
            serverSocket.setCreated();

        // socketCreate will set |fd| if it succeeds.
        if (fd != null && fd.valid()) {
            guard.open("close");
        }
    }
1362190
protected void createRedirectUnauthorizedServiceUrlEndState(final Flow flow) {
        val state = createEndState(flow, CasWebflowConstants.STATE_ID_VIEW_REDIR_UNAUTHZ_URL, "flowScope.unauthorizedRedirectUrl", true);
        state.getEntryActionList().add(createEvaluateAction("redirectUnauthorizedServiceUrlAction"));
    }
782940
protected void createTransitionStateToAcceptableUsagePolicy(final Flow flow) {
        val submit = getRealSubmissionState(flow);
        createTransitionForState(submit, CasWebflowConstants.TRANSITION_ID_SUCCESS, STATE_ID_AUP_CHECK, true);
    }
71411
def CreateFlow(self, name=None, args=None, runner_args=None):
    """"""

    if not name:
      raise ValueError("name can't be empty")

    request = flow_pb2.ApiCreateFlowArgs(client_id=self.client_id)

    request.flow.name = name
    if runner_args:
      request.flow.runner_args.CopyFrom(runner_args)

    if args:
      request.flow.args.value = args.SerializeToString()
      request.flow.args.type_url = utils.GetTypeUrl(args)

    data = self._context.SendRequest("CreateFlow", request)
    return flow.Flow(data=data, context=self._context)
1297646
public static void putServiceIntoFlowScope(final RequestContext context, final Service service) {
        context.getFlowScope().put(PARAMETER_SERVICE, service);
    }