Interface CustomFormApi.DocumentActionApi

Enclosing interface:
CustomFormApi

public static interface CustomFormApi.DocumentActionApi
Helper class to work with Custom Forms statuses. The custom form status is updated in the database by invoking the submit, withdraw or revoke methods.

Note: no permissions are checked when the custom form status is updated/recalculated.

Example:

 api.customFormApi()
     .withId(customForm.id)
     .documentAction()
     .submit()
 
See Also:
  • Method Details

    • withReason

      To pass a String reason to submit() method for the WorkFlow logic.

      Example:

      
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .withReason('some reason')
           .submit()
       
      Parameters:
      reason - String value to be passed to workflow as submit reason, works only with submit()
      Returns:
      a Document Action builder instance
    • withUser

      To pass a Users login name as the WorkFlow logic submitter.
      NOTE: works only for submit()

      Example:

      
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .withUser('existingUserLoginName')
           .submit()
       
      Parameters:
      loginName - login name to be passed to workflow as the submitter, works only with submit()
      Returns:
      a Document Action builder instance
      Since:
      14.0 - Caribou Lou
      See Also:
    • submit

      Object submit() throws XExpression
      Finishes the submit operation. When this is executed, the Custom Form will be updated in the database.

      Note: Since 12.0.0, this operation only works in contexts that allow object modification. The previous behaviour can still be achieved by using the 'customFormApiAlwaysAllowsObjectModification' application property.

      Example:
      
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .submit()
       

      Warning: if this operation is used in a custom form logic, and the id of the custom form being submitted is the same as the current custom form, the process could end in an infinite loop.

      Returns:
      an Object containing the data of the submitted Custom Form or null if failed
      Throws:
      XExpression - if the custom form fails submit with the specified data
      See Also:
    • revoke

      Object revoke() throws XExpression
      Finishes the revoke operation. When this is executed, the Custom Form will be updated in the database.

      Note: Since 12.0.0, this operation only works in contexts that allow object modification. The previous behaviour can still be achieved by using the 'customFormApiAlwaysAllowsObjectModification' application property.

      Example:
      
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .revoke()
       
      Returns:
      an Object containing the data of the revoked Custom Form or null if failed
      Throws:
      XExpression - if the custom form fails revoke with the specified data
      See Also:
    • withdraw

      Object withdraw() throws XExpression
      Finishes the withdrawal operation. When this is executed, the Custom Form will be updated in the database.

      Note: Since 12.0.0, this operation only works in contexts that allow object modification. The previous behaviour can still be achieved by using the 'customFormApiAlwaysAllowsObjectModification' application property.

      Example:
      
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .withdraw()
       
      Returns:
      an Object containing the data of the withdrawn Custom Form or null if failed
      Throws:
      XExpression - if the custom form fails withdrawal with the specified data
      See Also: