Skip to main content

Gravity_Flow_Step

An abstract class used as the base for all Steps.

Class Gravity_Flow_Step

Since: 1.0

Source: includes/steps/class-step.php:23

Details

  • Kind: class
  • Namespace: (global)
  • Extends: stdClass

Properties

PropertyTypeDescription
$_assigneesGravity_Flow_Assignee[]The assignees for this step.
$_step_typestringA unique key for this step type. This property must be overridden by extending classes.
$_next_step_idint | stringThe next step. This could be either a step ID (integer) or one of the following:
$_rest_basestringThe resource slug for the REST API.

Methods

MethodDescription
__construct()The constructor for the Step. Provide an entry object to perform and entry-specific tasks.
__get()Magic method to allow direct access to the settings as properties.
__set()Sets the value for the specified property.
__isset()Determines if the specified property has been defined.
__unset()Deletes the specified property.
get_status_config()Returns an array of the configuration of the status options for this step.
get_final_status_config()Returns an array of the configuration of the status options for this step.
get_actions()Returns an array of quick actions to be displayed on the inbox.
get_rest_base()Returns the resource slug for the REST API.
handle_rest_request()Process the REST request for an entry.
rest_permission_callback()Check if a REST request has permission.
rest_process_step()Process the REST request for an entry.
get_status_label()Returns the translated label for a status key.
get_label()Returns the label for the step.
get_entry()If set, returns the entry for this step.
refresh_entry()Flushes and reloads the cached entry for this step.
get_form()Returns the Form object for this step.
get_entry_id()Returns the ID for the current entry object. If not set the lid query arg is returned.
get_type()Returns the step type.
get_id()Returns the Step ID.
is_active()Is the step active? The step may have been deactivated by the user in the list of steps.
is_supported()Is this step supported on this server? Override to hide this step in the list of step types if the requirements are not met.
get_required_capabilities()Get required capabilities for the step.
get_form_id()Returns the ID of the Form object for the step.
get_name()Returns the user-defined name of the step.
get_common_settings_api()Get the API for preparing common settings such as those which appear on notification tabs.
get_settings()Override this method to add settings to the step. Use the Gravity Forms Add-On Framework Settings API.
get_step_settings()Get the settings for the current step. Defaults to empty get_settings() method.
get_icon_url()Override this method to set a custom icon in the step settings.
get_base_url()Returns the Gravity Flow base URL.
get_base_path()Returns the Gravity Flow base path.
get_next_step_id()Returns the ID of the next step.
set_next_step_id()Sets the next step.
start()Attempts to start this step for the current entry. If the step is scheduled then the entry will be queued.
is_queued()Is the step currently in the queue waiting for the scheduled start time?
validate_schedule()Validates the step schedule.
get_schedule_timestamp()Returns the schedule timestamp (UTC) calculated from the schedule settings.
is_expired()Determines if the step has expired.
get_due_date_timestamp()Returns the expiration timestamp calculated from the expiration settings.
get_expiration_timestamp()Returns the expiration timestamp calculated from the expiration settings.
get_timestamp_date()Returns the timestamp for the date based expiration or schedule or due date.
get_timestamp_date_field()Returns the timestamp for the date field based expiration or schedule or due date.
get_timestamp_delay()Returns the timestamp for the delay based expiration or schedule or due date.
get_entry_timestamp()Returns the value of the entries workflow_timestamp property.
get_step_timestamp()Returns the step timestamp from the entry meta.
process()Process the step. For example, assign to a user, send to a service, send a notification or do nothing. Return (bool) $complete.
assign()Set the assignee status to pending and trigger sending of the assignee notification if enabled.
maybe_send_assignee_notification()Sends the assignee email if the assignee_notification_setting is enabled.
get_notification()Retrieves the properties for the specified notification type; building an array using the keys required by Gravity Forms.
get_notification_assignees()Retrieve the assignees for the current
send_workflow_notification()Sends the workflow notification, if enabled.
send_assignee_notification()Sends the assignee email.
replace_variables()Override this method to replace merge tags.
replace_workflow_url_variables()Replace the {workflow_entry_link}, {workflow_entry_url}, {workflow_inbox_link}, and {workflow_inbox_url} merge tags.
get_workflow_url_access_token()Get the access token for the workflow_entry_ and workflow_inbox_ merge tags.
replace_workflow_cancel_variables()Replace the {workflow_cancel_link} and {workflow_cancel_url} merge tags.
get_entry_url()Returns the entry URL.
get_inbox_url()Returns the inbox URL.
update_step_status()Updates the status for this step.
end_if_complete()Ends the step if it's complete.
get_entry_meta()Optionally override this method to add additional entry meta. See the Gravity Forms Add-On Framework for details on the return array.
get_status_key()Returns the status key
get_status_timestamp_key()Returns the status timestamp key
get_status()Retrieves the step status from the entry meta.
evaluate_status()Evaluates the status for the step.
status_evaluation()Override this to perform custom evaluation of the step status.
get_expiration_status_key()Return the value of the status expiration setting.
is_condition_met()Processes the conditional logic for the entry in this step.
get_user_status()Returns the status for a user. Defaults to current WordPress user or authenticated email address.
get_current_role_status()Get the current role and status.
get_role_status()Returns the status for the given role.
update_user_status()Updates the status for the given user.
update_role_status()Updates the status for the given role.
get_assignees()Returns an array of assignees for this step.
get_assignee_details()Retrieve an array containing this steps assignee details.
flush_assignees()Flush assignee details.
get_assignee_keys()Retrieve an array containing the assignee keys for this step.
get_assignee()Retrieve the assignee object for the given arguments.
get_current_assignee_key()Get the assignee key for the current access token or user.
get_current_assignee_status()Get the status for the current assignee.
get_current_assignee()Get the assignee object for the current access token or user.
has_assignee()Determines if the given assignee key is assigned to this step.
maybe_add_select_assignees()Adds the assignees when the 'assign to' setting is set to 'select'.
maybe_add_routing_assignees()Adds the assignees when the 'assign to' setting is set to 'routing'.
get_assignee_args()Creates an array containing the assignees id and type from the supplied key.
maybe_add_assignee()Adds the assignee to the step if certain conditions are met.
remove_assignee()Removes assignee from the step. This is only used for maintenance when the assignee settings change.
maybe_process_status_update()Handles POSTed values from the workflow detail page.
process_status_update()Process a status update for a submission.
maybe_process_post_fields()Process any post fields on this step, if they exist.
validate_status_update()Base method for validating a status update. Override to perform custom validation.
workflow_detail_status_box()Displays content inside the Workflow metabox on the workflow detail page.
workflow_detail_box()Displays content inside the Workflow metabox on the workflow detail page.
entry_detail_status_box()Displays content inside the Workflow metabox on the Gravity Forms Entry Detail page.
get_editable_fields()Override to return an array of editable fields for the current user.
maybe_send_notification()Send the applicable notification if it is enabled and has assignees.
send_notification()Sends an email.
gpdf_add_notification_attachment()If Gravity PDF is enabled we'll generate the appropriate PDF and attach it to the current notification
end()Ends the step cleanly and wraps up loose ends.
can_set_workflow_status()Returns TRUE if this step can alter the current and final status.
is_overdue()Returns TRUE if this step is past the defined due date.
is_complete()Override this method to check whether the step is complete in interactive and long running steps.
add_note()Adds a note to the timeline. The timeline is a filtered subset of the Gravity Forms Entry notes.
maybe_add_user_note()Adds a user submitted note.
evaluate_routing_rule()Evaluates a routing rule.
send_notifications()Sends a notification to an array of assignees.
entry_count()Returns the number of entries on this step.
log_debug()Logs debug messages to the Gravity Flow log file generated by the Gravity Forms Logging Add-On.
get_feed_meta()Retrieves the feed meta for the current step.
maybe_process_token_action()Process token action if conditions are satisfied.
log_event()Add a new event to the activity log.
supports_due_date()Override to indicate if the current step supports due date.
supports_expiration()Override to indicate if the current step supports expiration.
get_setting()Returns the correct value for the step setting for the current context - either step settings or step processing.
process_assignee_status()Process a status change for an assignee.
is_assignee()Determines if the supplied assignee key belongs to one of the steps assignees.
maybe_adjust_assignment()Removes assignees from and/or adds assignees to a step. Call after updating entry values.
restart_action()Override this to perform any tasks for the current step when restarting the workflow or step, such as cleaning up custom entry meta.
validate_note()Determine if the note is valid and update the form with the result.
validate_note_mode()Override this with the validation logic to determine if the submitted note for this step is valid.
get_validation_result()Get the validation result for this step.
maybe_filter_validation_result()Override this to implement a custom filter for this steps validation result.
purge_assignees()Purges assignees from the database.
is_user_assignee()Checks whether the current user is an assignee of this step.
assignees_hash()Returns an MD5 hash of the assignees of the given step plus the assignee policy.

Method Reference

__construct()

public function __construct( $feed=[], $entry=null )

The constructor for the Step. Provide an entry object to perform and entry-specific tasks.

Parameters

NameTypeDefaultDescription
$feedarray[]Required. The Feed on which this step is based.
$entrynull | arraynullOptional. Instantiate with an entry to perform entry related tasks.

Source: includes/steps/class-step.php:109

__get()

public function&__get( $name )

Magic method to allow direct access to the settings as properties.

Returns an empty string for undefined properties allowing for graceful backward compatibility where new settings may not have been defined in stored settings.

Parameters

NameTypeDefaultDescription
$namestringThe property key.

Returns

  • mixed

Source: includes/steps/class-step.php:130

__set()

public function __set( $key, $value )

Sets the value for the specified property.

Parameters

NameTypeDefaultDescription
$keystringThe property key.
$valuemixedThe property value.

Source: includes/steps/class-step.php:144

__isset()

public function __isset( $key )

Determines if the specified property has been defined.

Parameters

NameTypeDefaultDescription
$keystringThe property key.

Returns

  • bool

Source: includes/steps/class-step.php:156

__unset()

public function __unset( $key )

Deletes the specified property.

Parameters

NameTypeDefaultDescription
$keystringThe property key.

Source: includes/steps/class-step.php:165

get_status_config()

public function get_status_config()

Returns an array of the configuration of the status options for this step.

These options will appear in the step settings. Override this method to add status options.

For example, a status configuration may look like this: array( 'status' => 'complete', 'status_label' => __( 'Complete', 'gravityflow' ), 'destination_setting_label' => __( 'Next Step', 'gravityflow' ), 'default_destination' => 'next', )

Returns

  • array — An array of arrays

Source: includes/steps/class-step.php:184

get_final_status_config()

public function get_final_status_config()

Returns an array of the configuration of the status options for this step.

Returns

  • array

Source: includes/steps/class-step.php:202

get_actions()

public function get_actions()

Returns an array of quick actions to be displayed on the inbox.

Example:

array( array( 'key' => 'approve', 'icon' => $this->get_approve_icon(), 'label' => __( 'Approve', 'gravityflow' ), 'show_note_field' => true ), array( 'key' => 'reject', 'icon' => $this->get_reject_icon(), 'label' => __( 'Reject', 'gravityflow' ), 'show_note_field' => false ), );

Returns

  • array

Source: includes/steps/class-step.php:228

get_rest_base()

public function get_rest_base()

Returns the resource slug for the REST API.

Returns

  • string

Deprecated: 3.0.0. (Steps only need to implement rest_process_step() to add REST API support)

Source: includes/steps/class-step.php:239

handle_rest_request()

public function handle_rest_request( $request )

Process the REST request for an entry.

Parameters

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns

  • WP_REST_Response | mixed — If response generated an error, WP_Error, if response is already an instance, WP_HTTP_Response, otherwise returns a new WP_REST_Response instance.

Deprecated: 1.7.1

Source: includes/steps/class-step.php:256

rest_permission_callback()

public function rest_permission_callback( $request )

Check if a REST request has permission.

Parameters

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns

Since: 1.4.3

Source: includes/steps/class-step.php:270

rest_process_step()

public function rest_process_step( $request )

Process the REST request for an entry.

Parameters

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns

  • WP_REST_Response | mixed — If response generated an error, WP_Error, if response is already an instance, WP_HTTP_Response, otherwise returns a new WP_REST_Response instance.

Source: includes/steps/class-step.php:317

get_status_label()

public function get_status_label( $status )

Returns the translated label for a status key.

Parameters

NameTypeDefaultDescription
$statusstringThe status key.

Returns

  • string

Source: includes/steps/class-step.php:330

get_label()

public function get_label()

Returns the label for the step.

Override this method to return a custom label.

Returns

  • string

Source: includes/steps/class-step.php:351

get_entry()

public function get_entry( $force_refresh=false )

If set, returns the entry for this step.

Parameters

NameTypeDefaultDescription
$force_refreshboolfalseWhether to force a refresh of the entry from the database.

Returns

  • array | null

Source: includes/steps/class-step.php:362

refresh_entry()

public function refresh_entry()

Flushes and reloads the cached entry for this step.

Returns

  • array | mixed | null

Source: includes/steps/class-step.php:376

get_form()

public function get_form()

Returns the Form object for this step.

Returns

  • mixed

Source: includes/steps/class-step.php:391

get_entry_id()

public function get_entry_id()

Returns the ID for the current entry object. If not set the lid query arg is returned.

Returns

  • int

Source: includes/steps/class-step.php:421

get_type()

public function get_type()

Returns the step type.

Returns

  • string

Source: includes/steps/class-step.php:435

get_id()

public function get_id()

Returns the Step ID.

Returns

  • int

Source: includes/steps/class-step.php:444

is_active()

public function is_active()

Is the step active? The step may have been deactivated by the user in the list of steps.

Returns

  • bool

Source: includes/steps/class-step.php:453

is_supported()

public function is_supported()

Is this step supported on this server? Override to hide this step in the list of step types if the requirements are not met.

Returns

  • bool

Source: includes/steps/class-step.php:462

get_required_capabilities()

public function get_required_capabilities()

Get required capabilities for the step.

Since: 2.5

Source: includes/steps/class-step.php:471

get_form_id()

public function get_form_id()

Returns the ID of the Form object for the step.

Returns

  • int

Source: includes/steps/class-step.php:480

get_name()

public function get_name()

Returns the user-defined name of the step.

Returns

  • string

Source: includes/steps/class-step.php:493

get_common_settings_api()

public function get_common_settings_api()

Get the API for preparing common settings such as those which appear on notification tabs.

Returns

  • Gravity_Flow_Common_Step_Settings

Since: 1.5.1-dev

Source: includes/steps/class-step.php:504

get_settings()

public function get_settings()

Override this method to add settings to the step. Use the Gravity Forms Add-On Framework Settings API.

Returns

  • array

Source: includes/steps/class-step.php:515

get_step_settings()

public function get_step_settings()

Get the settings for the current step. Defaults to empty get_settings() method.

Returns

  • array

Since: 2.9

Source: includes/steps/class-step.php:526

get_icon_url()

public function get_icon_url()

Override this method to set a custom icon in the step settings.

32px x 32px

Returns

  • string

Source: includes/steps/class-step.php:536

get_base_url()

public function get_base_url()

Returns the Gravity Flow base URL.

Returns

  • string

Source: includes/steps/class-step.php:545

get_base_path()

public function get_base_path()

Returns the Gravity Flow base path.

Returns

  • string

Source: includes/steps/class-step.php:554

get_next_step_id()

public function get_next_step_id()

Returns the ID of the next step.

Returns

  • int | string

Source: includes/steps/class-step.php:563

set_next_step_id()

public function set_next_step_id( $id )

Sets the next step.

Parameters

NameTypeDefaultDescription
$idint | stringThe ID of the next step.

Source: includes/steps/class-step.php:585

start()

public function start()

Attempts to start this step for the current entry. If the step is scheduled then the entry will be queued.

Returns

  • bool — Is the step complete?

Source: includes/steps/class-step.php:594

is_queued()

public function is_queued()

Is the step currently in the queue waiting for the scheduled start time?

Returns

  • bool

Source: includes/steps/class-step.php:662

validate_schedule()

public function validate_schedule()

Validates the step schedule.

Returns

  • bool — Returns true if step is ready to proceed.

Source: includes/steps/class-step.php:673

get_schedule_timestamp()

public function get_schedule_timestamp()

Returns the schedule timestamp (UTC) calculated from the schedule settings.

Returns

  • bool | int

Source: includes/steps/class-step.php:698

is_expired()

public function is_expired()

Determines if the step has expired.

Returns

  • bool

Source: includes/steps/class-step.php:738

get_due_date_timestamp()

public function get_due_date_timestamp()

Returns the expiration timestamp calculated from the expiration settings.

Returns

  • bool | int

Source: includes/steps/class-step.php:776

get_expiration_timestamp()

public function get_expiration_timestamp()

Returns the expiration timestamp calculated from the expiration settings.

Returns

  • bool | int

Source: includes/steps/class-step.php:817

get_timestamp_date()

public function get_timestamp_date( $setting_type )

Returns the timestamp for the date based expiration or schedule or due date.

Parameters

NameTypeDefaultDescription
$setting_typestringThe setting type: expiration or schedule or due date.

Returns

  • bool | int

Since: 2.3.2

Source: includes/steps/class-step.php:861

get_timestamp_date_field()

public function get_timestamp_date_field( $setting_type )

Returns the timestamp for the date field based expiration or schedule or due date.

Parameters

NameTypeDefaultDescription
$setting_typestringThe setting type: expiration or schedule or due date.

Returns

  • bool | int

Since: 2.3.2

Source: includes/steps/class-step.php:883

get_timestamp_delay()

public function get_timestamp_delay( $setting_type )

Returns the timestamp for the delay based expiration or schedule or due date.

Parameters

NameTypeDefaultDescription
$setting_typestringThe setting type: expiration or schedule or due date.

Returns

  • bool | int

Since: 2.3.2

Source: includes/steps/class-step.php:936

get_entry_timestamp()

public function get_entry_timestamp()

Returns the value of the entries workflow_timestamp property.

Returns

  • string | int

Source: includes/steps/class-step.php:969

get_step_timestamp()

public function get_step_timestamp()

Returns the step timestamp from the entry meta.

Returns

  • bool | int

Source: includes/steps/class-step.php:980

process()

public function process()

Process the step. For example, assign to a user, send to a service, send a notification or do nothing. Return (bool) $complete.

Returns

  • bool — Is the step complete?

Source: includes/steps/class-step.php:991

assign()

public function assign()

Set the assignee status to pending and trigger sending of the assignee notification if enabled.

Returns

  • bool

Source: includes/steps/class-step.php:1000

maybe_send_assignee_notification()

public function maybe_send_assignee_notification( $assignee, $is_reminder=false )

Sends the assignee email if the assignee_notification_setting is enabled.

Parameters

NameTypeDefaultDescription
$assigneeGravity_Flow_AssigneeThe assignee properties.
$is_reminderboolfalseIndicates if this is a reminder notification. Default is false.

Source: includes/steps/class-step.php:1025

get_notification()

public function get_notification( $type )

Retrieves the properties for the specified notification type; building an array using the keys required by Gravity Forms.

Parameters

NameTypeDefaultDescription
$typestringThe type of notification currently being processed e.g. assignee, approval, or rejection.

Returns

  • array

Source: includes/steps/class-step.php:1038

get_notification_assignees()

public function get_notification_assignees( $type )

Retrieve the assignees for the current

Parameters

NameTypeDefaultDescription
$typestringThe type of notification currently being processed e.g. assignee, approval, or rejection.

Returns

  • array

Source: includes/steps/class-step.php:1085

send_workflow_notification()

public function send_workflow_notification()

Sends the workflow notification, if enabled.

Since:

Source: includes/steps/class-step.php:1131

send_assignee_notification()

public function send_assignee_notification( $assignee, $is_reminder=false )

Sends the assignee email.

Parameters

NameTypeDefaultDescription
$assigneeGravity_Flow_AssigneeThe assignee properties.
$is_reminderboolfalseIndicates if this is a reminder notification. Default is false.

Source: includes/steps/class-step.php:1158

replace_variables()

public function replace_variables( $text, $assignee )

Override this method to replace merge tags.

Important: call the parent method first. $text = parent::replace_variables( $text, $assignee );

Parameters

NameTypeDefaultDescription
$textstringThe text containing merge tags to be processed.
$assigneeGravity_Flow_AssigneeThe assignee properties.

Returns

  • string

Source: includes/steps/class-step.php:1180

replace_workflow_url_variables()

public function replace_workflow_url_variables( $text, $assignee )

Replace the {workflow_entry_link}, {workflow_entry_url}, {workflow_inbox_link}, and {workflow_inbox_url} merge tags.

Parameters

NameTypeDefaultDescription
$textstringThe text being processed.
$assigneeGravity_Flow_AssigneeThe assignee properties.

Returns

  • string

Source: includes/steps/class-step.php:1192

get_workflow_url_access_token()

public function get_workflow_url_access_token( $a, $assignee )

Get the access token for the workflow_entry_ and workflow_inbox_ merge tags.

Parameters

NameTypeDefaultDescription
$aarrayThe merge tag attributes.
$assigneeGravity_Flow_AssigneeThe assignee properties.

Returns

  • string

Source: includes/steps/class-step.php:1213

replace_workflow_cancel_variables()

public function replace_workflow_cancel_variables( $text, $assignee )

Replace the {workflow_cancel_link} and {workflow_cancel_url} merge tags.

Parameters

NameTypeDefaultDescription
$textstringThe text being processed.
$assigneeGravity_Flow_AssigneeThe assignee properties.

Returns

  • string

Source: includes/steps/class-step.php:1236

get_entry_url()

public function get_entry_url( $page_id=null, $assignee=null, $access_token='' )

Returns the entry URL.

Parameters

NameTypeDefaultDescription
$page_idint | nullnullThe ID of the WordPress Page where the shortcode is located.
$assigneeGravity_Flow_AssigneenullThe assignee properties.
$access_tokenstring''The access token for the current assignee.

Returns

  • string

Source: includes/steps/class-step.php:1260

get_inbox_url()

public function get_inbox_url( $page_id=null, $assignee=null, $access_token='' )

Returns the inbox URL.

Parameters

NameTypeDefaultDescription
$page_idint | nullnullThe ID of the WordPress Page where the shortcode is located.
$assigneeGravity_Flow_AssigneenullThe assignee properties.
$access_tokenstring''The access token for the current assignee.

Returns

  • string

Source: includes/steps/class-step.php:1283

update_step_status()

public function update_step_status( $status=false )

Updates the status for this step.

Parameters

NameTypeDefaultDescription
$statusstring | boolfalseThe step status.

Source: includes/steps/class-step.php:1298

end_if_complete()

public function end_if_complete()

Ends the step if it's complete.

Returns

  • bool — Is the step complete?

Source: includes/steps/class-step.php:1313

get_entry_meta()

public function get_entry_meta( $entry_meta, $form_id )

Optionally override this method to add additional entry meta. See the Gravity Forms Add-On Framework for details on the return array.

Parameters

NameTypeDefaultDescription
$entry_metaarrayThe entry meta properties.
$form_idintThe current form ID.

Returns

  • array

Source: includes/steps/class-step.php:1333

get_status_key()

public function get_status_key( $assignee, $type=false )

Returns the status key

Parameters

NameTypeDefaultDescription
$assigneestringThe assignee key.
$typebool | stringfalseThe assignee type.

Returns

  • string

Source: includes/steps/class-step.php:1345

get_status_timestamp_key()

public function get_status_timestamp_key( $assignee_key, $type=false )

Returns the status timestamp key

Parameters

NameTypeDefaultDescription
$assignee_keystringThe assignee key.
$typebool | stringfalseThe assignee type.

Returns

  • string

Source: includes/steps/class-step.php:1365

get_status()

public function get_status()

Retrieves the step status from the entry meta.

Returns

  • bool | string

Source: includes/steps/class-step.php:1382

evaluate_status()

public function evaluate_status()

Evaluates the status for the step.

Returns

  • string — 'queued' or 'complete'

Source: includes/steps/class-step.php:1394

status_evaluation()

public function status_evaluation()

Override this to perform custom evaluation of the step status.

Returns

  • string

Source: includes/steps/class-step.php:1417

get_expiration_status_key()

public function get_expiration_status_key()

Return the value of the status expiration setting.

Returns

  • string

Source: includes/steps/class-step.php:1426

is_condition_met()

public function is_condition_met( $form )

Processes the conditional logic for the entry in this step.

Parameters

NameTypeDefaultDescription
$formarrayThe current form.

Returns

  • bool

Source: includes/steps/class-step.php:1439

get_user_status()

public function get_user_status( $user_id=false )

Returns the status for a user. Defaults to current WordPress user or authenticated email address.

Parameters

NameTypeDefaultDescription
$user_idint | boolfalseThe user ID.

Returns

  • bool | string

Source: includes/steps/class-step.php:1474

get_current_role_status()

public function get_current_role_status()

Get the current role and status.

Returns

  • array

Source: includes/steps/class-step.php:1498

get_role_status()

public function get_role_status( $role )

Returns the status for the given role.

Parameters

NameTypeDefaultDescription
$rolestringThe user role.

Returns

  • bool | string

Source: includes/steps/class-step.php:1519

update_user_status()

public function update_user_status( $user_id=false, $new_assignee_status=false )

Updates the status for the given user.

Parameters

NameTypeDefaultDescription
$user_idbool | intfalseThe user ID.
$new_assignee_statusbool | stringfalseThe assignee status.

Source: includes/steps/class-step.php:1534

update_role_status()

public function update_role_status( $role=false, $new_assignee_status=false )

Updates the status for the given role.

Parameters

NameTypeDefaultDescription
$rolebool | stringfalseThe user role.
$new_assignee_statusbool | stringfalseThe assignee status.

Source: includes/steps/class-step.php:1550

get_assignees()

public function get_assignees()

Returns an array of assignees for this step.

Returns

Source: includes/steps/class-step.php:1570

get_assignee_details()

public function get_assignee_details()

Retrieve an array containing this steps assignee details.

Returns

Deprecated: 1.8.1

Source: includes/steps/class-step.php:1603

flush_assignees()

public function flush_assignees()

Flush assignee details.

Source: includes/steps/class-step.php:1611

get_assignee_keys()

public function get_assignee_keys()

Retrieve an array containing the assignee keys for this step.

Returns

  • array

Source: includes/steps/class-step.php:1620

get_assignee()

public function get_assignee( $args )

Retrieve the assignee object for the given arguments.

Parameters

NameTypeDefaultDescription
$argsstring | arrayAn assignee key or array containing the id, type and editable_fields (if applicable).

Returns

Source: includes/steps/class-step.php:1636

get_current_assignee_key()

public function get_current_assignee_key()

Get the assignee key for the current access token or user.

Returns

  • string | bool

Source: includes/steps/class-step.php:1647

get_current_assignee_status()

public function get_current_assignee_status()

Get the status for the current assignee.

Returns

  • bool | string

Source: includes/steps/class-step.php:1657

get_current_assignee()

public function get_current_assignee()

Get the assignee object for the current access token or user.

Returns

Since: 3.0.0

Source: includes/steps/class-step.php:1676

has_assignee()

public function has_assignee( $assignee_key )

Determines if the given assignee key is assigned to this step.

Parameters

NameTypeDefaultDescription
$assignee_keystringThe assignee key.

Returns

  • bool — True if the assignee key is assigned to this step. False otherwise.

Since: 3.0.0

Source: includes/steps/class-step.php:1695

maybe_add_select_assignees()

public function maybe_add_select_assignees()

Adds the assignees when the 'assign to' setting is set to 'select'.

Source: includes/steps/class-step.php:1708

maybe_add_routing_assignees()

public function maybe_add_routing_assignees()

Adds the assignees when the 'assign to' setting is set to 'routing'.

Source: includes/steps/class-step.php:1731

get_assignee_args()

public function get_assignee_args( $assignee_key )

Creates an array containing the assignees id and type from the supplied key.

Parameters

NameTypeDefaultDescription
$assignee_keystringThe assignee key.

Returns

  • array

Source: includes/steps/class-step.php:1759

maybe_add_assignee()

public function maybe_add_assignee( $args )

Adds the assignee to the step if certain conditions are met.

Parameters

NameTypeDefaultDescription
$argsstring | arrayAn assignee key or array containing the id, type and editable_fields (if applicable).

Source: includes/steps/class-step.php:1775

remove_assignee()

public function remove_assignee( $assignee=false )

Removes assignee from the step. This is only used for maintenance when the assignee settings change.

Parameters

NameTypeDefaultDescription
$assigneeGravity_Flow_Assignee | boolfalseThe assignee properties.

Source: includes/steps/class-step.php:1822

maybe_process_status_update()

public function maybe_process_status_update( $form, $entry )

Handles POSTed values from the workflow detail page.

Parameters

NameTypeDefaultDescription
$formarrayThe current form.
$entryarrayThe current entry.

Returns

  • string | bool | WP_Error — Return a success feedback message safe for page output or a WP_Error instance with an error.

Source: includes/steps/class-step.php:1839

process_status_update()

public function process_status_update( $form, $entry )

Process a status update for a submission.

Parameters

NameTypeDefaultDescription
$form
$entry

Returns

Since: 2.9

Source: includes/steps/class-step.php:1853

maybe_process_post_fields()

public function maybe_process_post_fields( $form, $post_id )

Process any post fields on this step, if they exist.

Parameters

NameTypeDefaultDescription
$form
$post_id

Returns

  • void

Since: 2.9

Source: includes/steps/class-step.php:1870

validate_status_update()

public function validate_status_update( $new_status, $entry )

Base method for validating a status update. Override to perform custom validation.

Parameters

NameTypeDefaultDescription
$new_status
$entry

Returns

  • bool

Since: 2.9

Source: includes/steps/class-step.php:1884

workflow_detail_status_box()

public function workflow_detail_status_box( $form )

Displays content inside the Workflow metabox on the workflow detail page.

Parameters

NameTypeDefaultDescription
$formarrayThe Form array which may contain validation details.

Deprecated: since 1.3.2

Source: includes/steps/class-step.php:1895

workflow_detail_box()

public function workflow_detail_box( $form, $args )

Displays content inside the Workflow metabox on the workflow detail page.

Parameters

NameTypeDefaultDescription
$formarrayThe Form array which may contain validation details.
$argsarrayAdditional args which may affect the display.

Source: includes/steps/class-step.php:1918

entry_detail_status_box()

public function entry_detail_status_box( $form )

Displays content inside the Workflow metabox on the Gravity Forms Entry Detail page.

Parameters

NameTypeDefaultDescription
$formarrayThe current form.

Source: includes/steps/class-step.php:1927

get_editable_fields()

public function get_editable_fields()

Override to return an array of editable fields for the current user.

Returns

  • array

Source: includes/steps/class-step.php:1936

maybe_send_notification()

public function maybe_send_notification( $type )

Send the applicable notification if it is enabled and has assignees.

Parameters

NameTypeDefaultDescription
$typestringThe type of notification currently being processed; approval or rejection.

Source: includes/steps/class-step.php:1945

send_notification()

public function send_notification( $notification )

Sends an email.

Parameters

NameTypeDefaultDescription
$notificationarrayThe notification properties.

Source: includes/steps/class-step.php:1965

gpdf_add_notification_attachment()

public function gpdf_add_notification_attachment( $notification, $gpdf_id )

If Gravity PDF is enabled we'll generate the appropriate PDF and attach it to the current notification

Parameters

NameTypeDefaultDescription
$notificationarrayThe notification array currently being sent.
$gpdf_idstringThe Gravity PDF ID.

Returns

  • array

Source: includes/steps/class-step.php:1996

end()

public function end()

Ends the step cleanly and wraps up loose ends.

Sets the next step. Deletes assignee status entry meta.

Source: includes/steps/class-step.php:2027

can_set_workflow_status()

public function can_set_workflow_status()

Returns TRUE if this step can alter the current and final status.

If the only status option available for this step is 'complete' then, by default, the step will not set the status. The default final status for the workflow is 'complete'.

Returns

  • bool

Source: includes/steps/class-step.php:2072

is_overdue()

public function is_overdue()

Returns TRUE if this step is past the defined due date.

Returns

  • bool

Since: 2.5

Source: includes/steps/class-step.php:2085

is_complete()

public function is_complete()

Override this method to check whether the step is complete in interactive and long running steps.

Returns

  • bool

Source: includes/steps/class-step.php:2099

add_note()

public function add_note( $note, $is_user_event=false, $deprecated=false )

Adds a note to the timeline. The timeline is a filtered subset of the Gravity Forms Entry notes.

Parameters

NameTypeDefaultDescription
$notestringThe note to be added.
$is_user_eventboolfalseFormerly $user_id; as of 1.7.1-dev indicates if the current note is the result of an assignee action.
$deprecatedboolfalseFormerly $user_name; no longer used as of 1.7.1-dev.

Since:

  • 1.7.1-dev (Updated to store notes in the entry meta.)
  • unknown

Source: includes/steps/class-step.php:2115

maybe_add_user_note()

public function maybe_add_user_note()

Adds a user submitted note.

Returns

  • string — The user note which was added or an empty string.

Since: 1.7.1-dev

Source: includes/steps/class-step.php:2160

evaluate_routing_rule()

public function evaluate_routing_rule( $routing_rule )

Evaluates a routing rule.

Parameters

NameTypeDefaultDescription
$routing_rulearrayThe routing rule properties.

Returns

  • bool — Is the routing rule a match?

Source: includes/steps/class-step.php:2178

send_notifications()

public function send_notifications( $assignees, $notification )

Sends a notification to an array of assignees.

Parameters

NameTypeDefaultDescription
$assigneesGravity_Flow_Assignee[]The assignee properties.
$notificationarrayThe notification properties.

Source: includes/steps/class-step.php:2214

entry_count()

public function entry_count()

Returns the number of entries on this step.

Returns

  • int | mixed

Source: includes/steps/class-step.php:2238

log_debug()

public function log_debug( $message )

Logs debug messages to the Gravity Flow log file generated by the Gravity Forms Logging Add-On.

Parameters

NameTypeDefaultDescription
$messagestringThe message to be logged.

Source: includes/steps/class-step.php:2262

get_feed_meta()

public function get_feed_meta()

Retrieves the feed meta for the current step.

Returns

  • array

Source: includes/steps/class-step.php:2271

maybe_process_token_action()

public function maybe_process_token_action( $action, $token, $form, $entry )

Process token action if conditions are satisfied.

Parameters

NameTypeDefaultDescription
$actionarrayThe action properties.
$tokenarrayThe assignee token properties.
$formarrayThe current form.
$entryarrayThe current entry.

Returns

  • bool | WP_Error — Return a success feedback message safe for page output or false.

Source: includes/steps/class-step.php:2285

log_event()

public function log_event( $step_event, $step_status='', $duration=0 )

Add a new event to the activity log.

Parameters

NameTypeDefaultDescription
$step_eventstringThe event name.
$step_statusstring''The step status.
$durationint0The duration in seconds, if any.

Source: includes/steps/class-step.php:2312

supports_due_date()

public function supports_due_date()

Override to indicate if the current step supports due date.

Returns

  • bool

Since: 2.5

Source: includes/steps/class-step.php:2325

supports_expiration()

public function supports_expiration()

Override to indicate if the current step supports expiration.

Returns

  • bool

Source: includes/steps/class-step.php:2334

get_setting()

public function get_setting( $setting )

Returns the correct value for the step setting for the current context - either step settings or step processing.

Parameters

NameTypeDefaultDescription
$settingstringThe setting key.

Returns

  • array | mixed | string

Source: includes/steps/class-step.php:2345

process_assignee_status()

public function process_assignee_status( $assignee, $new_status, $form )

Process a status change for an assignee.

Parameters

NameTypeDefaultDescription
$assigneeGravity_Flow_AssigneeThe assignee properties.
$new_statusstringThe assignee status.
$formarrayThe current form.

Returns

  • string | bool — Return a success feedback message safe for page output or false.

Source: includes/steps/class-step.php:2366

is_assignee()

public function is_assignee( $assignee_key )

Determines if the supplied assignee key belongs to one of the steps assignees.

Parameters

NameTypeDefaultDescription
$assignee_keystringThe assignee key.

Returns

  • bool

Source: includes/steps/class-step.php:2381

maybe_adjust_assignment()

public function maybe_adjust_assignment( $previous_assignees )

Removes assignees from and/or adds assignees to a step. Call after updating entry values.

Make sure you call get_assignees() to get the assignees before you update the entry before you update the entry or the previous assignees may not get removed.

Parameters

NameTypeDefaultDescription
$previous_assigneesGravity_Flow_Assignee[]The previous assignees.

Source: includes/steps/class-step.php:2403

restart_action()

public function restart_action()

Override this to perform any tasks for the current step when restarting the workflow or step, such as cleaning up custom entry meta.

Source: includes/steps/class-step.php:2433

validate_note()

public function validate_note( $new_status, &$form )

Determine if the note is valid and update the form with the result.

Parameters

NameTypeDefaultDescription
$new_statusstringThe new status for the current step.
&$formarrayThe form currently being processed.

Returns

  • bool

Source: includes/steps/class-step.php:2445

validate_note_mode()

public function validate_note_mode( $new_status, $note )

Override this with the validation logic to determine if the submitted note for this step is valid.

Parameters

NameTypeDefaultDescription
$new_statusstringThe new status for the current step.
$notestringThe submitted note.

Returns

  • bool

Source: includes/steps/class-step.php:2467

get_validation_result()

public function get_validation_result( $valid, $form, $new_status )

Get the validation result for this step.

Parameters

NameTypeDefaultDescription
$validboolThe steps current validation state.
$formarrayThe form currently being processed.
$new_statusstringThe new status for the current step.

Returns

Source: includes/steps/class-step.php:2480

maybe_filter_validation_result()

public function maybe_filter_validation_result( $validation_result, $new_status )

Override this to implement a custom filter for this steps validation result.

Parameters

NameTypeDefaultDescription
$validation_resultarrayThe validation result and form currently being processed.
$new_statusstringThe new status for the current step.

Returns

  • array

Source: includes/steps/class-step.php:2511

purge_assignees()

public function purge_assignees()

Purges assignees from the database.

Since: 2.1.2

Source: includes/steps/class-step.php:2520

is_user_assignee()

public function is_user_assignee()

Checks whether the current user is an assignee of this step.

Returns

  • bool

Since: 2.5

Source: includes/steps/class-step.php:2560

assignees_hash()

public function assignees_hash()

Returns an MD5 hash of the assignees of the given step plus the assignee policy.

Returns

  • string

Since: 2.7

Source: includes/steps/class-step.php:2582