Skip to main content
Kinetic Community

Submission Locks

This article describes how to leverage submission locking (Kinetic Request 5.1.0) in your service items.

Implementing submission locking involves two steps.

  1. Configure service item submission locking options using the submission_locking function within the service_item do-end block.
  2. Create submission lock/unlock events using the event function with either the :lock or the :unlock option.

Configuring Service Items

To configure the submission locking options of a service item use the submission_locking function within the do-end block of the service_item function call.

The first parameter is the locking type either :automatic or :manual.

The :lock_expiration option configures the lock expiration of the service item.  This option is not required and the default value is "0".

The :lockable_by option configures the lockable by group of the service item.  This option is not required and the default value is "Public".

The :unlockable_by option configures the unlockable by group of the service item.  This option is not required and the default value is "Public".

Below is an example of configuring the submission locking options of a service item.

  submission_locking :manual,
    :lock_expiration => "0",
    :lockable_by => "Public",
    :unlockable_by => "Public"

Creating Lock/Unlock Events

To create lock and unlock events use the event function with either the :lock or the :unlock option used.

Lock and unlock events have the following options, none of them are required.

If :display_confirmation_dialog is used, the event will display a dialog asking the user to confirm the submission locking action.

The :response_handler option configures a handler function to be used in response to the submission locking action.

The :response_element_id option configures an element id to be used as a container for the response message of the submission locking action.  This functionality does not exist if a response handler is configured

The :confirmation_message option configures the confirmation dialog message displayed if the :display_confirmation_dialog option is configured.  The default value is "Are you sure?".

Below are some examples of lock and unlock events.

      event "Lock Event", :click, :lock,
        :display_confirmation_dialog,
        :response_handler => "handler",
        :confirmation_message => "Are you sure?"
 
This event locks a submission.  Note that it takes advantage of the response handler option to configure a handler function to be called in response to the submission locking action.
      event "Unlock Event", :click, :unlock,
        :display_confirmation_dialog,
        :response_element_id => "lockingMessage",
        :confirmation_message => "Are you sure?"
 
This event unlocks a submission.  Note that it takes advantage of the response element id option to configure a placeholder for the response message of the submission locking action. 

Sample

This file contains KURL code for a working service item that contains the features documented above:  Submission Locking Demo.rb