<p>
The workflow state of a finding.
</p>

@param workflowState
The workflow state of a finding.
423203
public void setWorkflowState(java.util.Collection<StringFilter> workflowState) {
        if (workflowState == null) {
            this.workflowState = null;
            return;
        }

        this.workflowState = new java.util.ArrayList<StringFilter>(workflowState);
    }
646282
public void restart(String workflowId, boolean useLatestDefinitions) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.restartWorkflow(WorkflowServicePb.RestartWorkflowRequest.newBuilder()
                .setWorkflowId(workflowId)
                .setUseLatestDefinitions(useLatestDefinitions)
                .build()
        );
    }
1083150
public List<String> getRunningWorkflow(String workflowName, Integer version) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowName), "Workflow name cannot be blank");
        return getForEntity("workflow/running/{name}", new Object[]{"version", version}, new GenericType<List<String>>() {
        }, workflowName);
    }
662895
def _setup_states(state_definitions, prev=()):
    """"""
    states = list(prev)
    for state_def in state_definitions:
        if len(state_def) != 2:
            raise TypeError(
                "The 'state' attribute of a workflow should be "
                "a two-tuple of strings; got %r instead." % (state_def,)
            )
        name, title = state_def
        state = State(name, title)
        if any(st.name == name for st in states):
            # Replacing an existing state
            states = [state if st.name == name else st for st in states]
        else:
            states.append(state)
    return StateList(states)
1283999
def _find_workflows(mcs, attrs):
        
        workflows = {}
        for attribute, value in attrs.items():
            if isinstance(value, Workflow):
                workflows[attribute] = StateField(value)
        return workflows
734847
public void setEvaluationStatus(com.google.api.ads.admanager.axis.v201811.WorkflowEvaluationStatus evaluationStatus) {
        this.evaluationStatus = evaluationStatus;
    }
1103749
private void stage3CommitProcessing(int state) throws SystemException, RollbackException, HeuristicMixedException, HeuristicHazardException {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "stage3CommitProcessing", TransactionState.stateToString(state));

        switch (state) {
            case TransactionState.STATE_ROLLING_BACK: // could be retries
            case TransactionState.STATE_ROLLED_BACK:
                //
                // As we rolled back we need to throw a RollbackException
                // unless the rollback was triggered by a SystemException or heuristic
                // in which case we should throw a SystemException or heuristic
                //
                if (_systemExceptionOccured) {
                    final SystemException se = new SystemException();
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "stage3CommitProcessing", se);
                    throw se;
                } else if (_heuristicOnPrepare != null) {
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "stage3CommitProcessing", _heuristicOnPrepare);
                    if (_heuristicOnPrepare instanceof HeuristicMixedException)
                        throw (HeuristicMixedException) _heuristicOnPrepare;

                    throw (HeuristicHazardException) _heuristicOnPrepare;
                }

                // PK19059 starts here
                final RollbackException rbe;
                if (getOriginalException() == null) {
                    rbe = new RollbackException();
                } else {
                    rbe = new RollbackException();
                    rbe.initCause(getOriginalException());
                }
                // PK19059 ends here
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "stage3CommitProcessing", rbe);
                throw rbe;
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "stage3CommitProcessing");
    }
956505
private void transitionToFinalBatchStatus() {
        StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
        synchronized (stopLock) {

            BatchStatus currentBatchStatus = runtimeWorkUnitExecution.getBatchStatus();
            if (currentBatchStatus.equals(BatchStatus.STARTED)) {
                updateJobBatchStatus(BatchStatus.COMPLETED);
            } else if (currentBatchStatus.equals(BatchStatus.STOPPING)) {
                updateJobBatchStatus(BatchStatus.STOPPED);
            } else if (currentBatchStatus.equals(BatchStatus.FAILED)) {
                updateJobBatchStatus(BatchStatus.FAILED); // Should have already been done but maybe better for possible code refactoring to have it here.
            } else {
                throw new IllegalStateException("Step batch status should not be in a " + currentBatchStatus.name() + " state");
            }
        }
    }
491461
private void setJobCleanupTaskState(Task task) {
    if (task.isJobCleanupTask()) {
      if (jobFailed) {
        task.setJobCleanupTaskState(
            org.apache.hadoop.mapreduce.JobStatus.State.FAILED);
      } else if (jobKilled) {
        task.setJobCleanupTaskState(
            org.apache.hadoop.mapreduce.JobStatus.State.KILLED);
      } else {
        task.setJobCleanupTaskState(
            org.apache.hadoop.mapreduce.JobStatus.State.SUCCEEDED);
      }
    }
  }
311118
private void processSkippedOperations(final List<OP> shouldskip) {
        for (final OP operation : shouldskip) {
            workflowEngine.event(
                    WorkflowSystemEventType.WillSkipOperation,
                    String.format("Skip condition statisfied for operation: %s, skipping", operation),
                    operation
            );
            StateObj newstate = operation.getSkipState(workflowEngine.getState());
            WorkflowSystem.OperationCompleted<DAT> objectOperationCompleted = WorkflowEngine.dummyResult(newstate);
            stateChangeQueue.add(objectOperationCompleted);
        }
    }
362777
def getObjectWorkflowStates(self):
        
        workflow = getToolByName(self, 'portal_workflow')
        states = {}
        for w in workflow.getWorkflowsFor(self):
            state = w._getWorkflowStateOf(self).id
            states[w.state_var] = state
        return states
1121874
@Service
    public Workflow getExecutionStatus(String workflowId, boolean includeTasks) {
        Workflow workflow = executionService.getExecutionStatus(workflowId, includeTasks);
        if (workflow == null) {
            throw new ApplicationException(ApplicationException.Code.NOT_FOUND,
                    String.format("Workflow with Id: %s not found.", workflowId));
        }
        return workflow;
    }
878610
public function getAllStatuses($workflowId)
	{
		$wDef = $this->getWorkflowDefinition($workflowId);
		if ( $wDef == null) {
			throw new WorkflowException('No workflow found with id ' . $workflowId);
		}
		$allStatuses = [];
		foreach( $wDef[self::KEY_NODES] as $statusId => $statusDef){
			$allStatuses[$statusId] = $this->getStatus($statusId);
		}
		return $allStatuses;
	}
947358
@Service
    public String rerunWorkflow(String workflowId, RerunWorkflowRequest request) {
        request.setReRunFromWorkflowId(workflowId);
        return workflowExecutor.rerun(request);
    }
27393
function initializeLayout(workflowState) {
            var stateForLayout = workflowState.reason ? {} : recordedState;

            stateForLayout["environmentConfig"] = environmentConfig;

            try {
                layout = new LayoutForRoute({
                    request: serverRequest,
                    model: new Backbone.Model(stateForLayout)
                });
            } catch (reason) {
                workflowState.reason = reason;

                layout = new LayoutForRoute({
                    request: serverRequest,
                    model: new Backbone.Model({
                        environmentConfig: environmentConfig
                    })
                });
            }

            layout.setEnvironmentConfig(environmentConfig);

            return workflowState;
        }
497420
public Workflow getWorkflow(String workflowId, boolean includeTasks) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        Workflow workflow = getForEntity("workflow/{workflowId}", new Object[]{"includeTasks", includeTasks}, Workflow.class, workflowId);
        populateWorkflowOutput(workflow);
        return workflow;
    }
481940
def has_completed(self):
        """"""
        objects_in_db = WorkflowObjectModel.query.filter(
            WorkflowObjectModel.id_workflow == self.uuid,
            WorkflowObjectModel.id_parent == None,  # noqa
        ).filter(WorkflowObjectModel.status.in_([
            workflow_object_class.known_statuses.COMPLETED
        ])).count()
        return objects_in_db == len(list(self.objects))