Class CustomFormApi.OperationsApi

Object
OperationsApi
Enclosing class:
CustomFormApi

public static class CustomFormApi.OperationsApi extends Object
  • Method Details

    • updateData

      public CustomFormApi.UpdateApi updateData()
      Initiates an update operation. The operation is finished with the doUpdate method.

      Example:

      
       api.customFormApi()
           .withId(customForm.id)
           .updateData()
               .setLabel("after label")
               .setInputValue("input1000", 1001)
           .doUpdate()
       
      Returns:
      an Update builder instance
    • duplicate

      public Object duplicate()
      Duplicates a custom form, including inputs, outputs, and embedded objects.

      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:
      
       def duplicate = api.customFormApi().withId(customFormOriginal.id).duplicate()
       
      Returns:
      an Object containing the data of the created Custom Form, or null in case of syntax check mode or allow object modification being false. The data that can be extracted is:
      • id
      • uniqueName
      • label
      • attributeXX (1..30)
      • inputs (the specific type of the inputs can vary)
      • outputs (the specific type of the outputs can vary)
    • createRevision

      public Object createRevision()
      Creates a revision of a custom form, including attributes, inputs or outputs, but not attached documents, actions, notes, messages. If the custom form contains embedded objects, then those are duplicated.

      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.

      Notes: A revision can only be created if:
      • The custom form is of type standalone.
      • the document status is 'APPROVED' and the workflow status is any of 'APPROVED', 'NO_APPROVAL_REQUIRED'.

      Example:

      
       def revision = api.customFormApi().withId(customFormOriginal.id).createRevision()
       
      Returns:
      an Object containing the data of the Custom Form revision, or null in case of syntax check mode or allow object modification being false. The data that can be extracted is:
      • id
      • uniqueName
      • label
      • attributeXX (1..30)
      • inputs (the specific type of the inputs can vary)
      • outputs (the specific type of the outputs can vary)
    • recalculation

      public CustomFormApi.RecalculateApi recalculation()
      Initiates a recalculation operation. The operation is finished with the doRecalculate method.

      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)
           .recalculation()
           .doRecalculate()
       
      Returns:
      a Recalculate builder instance
    • workflowAction

      public CustomFormApi.WorkflowActionApi workflowAction()
      Initiates a workflow action operation. The operation is finished with the approve or deny methods.

      Example:

      
       api.customFormApi()
           .withId(customForm.id)
           .workflowAction()
               .withReason('approve reason')
           .approve()
       
      Returns:
      a WorkflowActionApi builder instance
    • delete

      public void delete() throws XExpression
      Deletes a custom form with the specified id. All objects which have the current custom form as 'parent id' will also be deleted.

      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(someCustomForm.id)
           .delete()
       
      Throws:
      XExpression - on deletion errors, like for example
      • not having edit permissions on the custom form to delete
      • the custom form being in a the workflow statuses 'APPROVED', 'NO_APPROVAL_REQUIRED', 'INVALIDATED', 'SUBMITTED'
      • non existing custom form id
      See Also:
    • documentAction

      public CustomFormApi.DocumentActionApi documentAction()
      Initiates an operation action on statuses. The operation is finished with the particular method from DocumentActionApi

      Example:

      
       // For submitting a custom form
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .submit()
       // For withdrawing a custom form
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .withdraw()
       // For revoking a custom form
       api.customFormApi()
           .withId(customForm.id)
           .documentAction()
           .revoke()
       
      Returns:
      a Document Action builder instance