Class CustomFormApi.OperationsApi
- Enclosing class:
CustomFormApi
-
Method Summary
Modifier and TypeMethodDescriptionCreates a revision of a custom form, including attributes, inputs or outputs, but not attached documents, actions, notes, messages.void
delete()
Deletes a custom form with the specified id.Initiates an operation action on statuses.Duplicates a custom form, including inputs, outputs, and embedded objects.Initiates a recalculation operation.Initiates an update operation.Initiates a workflow action operation.
-
Method Details
-
updateData
Initiates an update operation. The operation is finished with thedoUpdate
method.Example:
api.customFormApi() .withId(customForm.id) .updateData() .setLabel("after label") .setInputValue("input1000", 1001) .doUpdate()
- Returns:
- an Update builder instance
-
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
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
Initiates a recalculation operation. The operation is finished with thedoRecalculate
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
Initiates a workflow action operation. The operation is finished with theapprove
ordeny
methods.Example:
api.customFormApi() .withId(customForm.id) .workflowAction() .withReason('approve reason') .approve()
- Returns:
- a WorkflowActionApi builder instance
-
delete
public void delete() throws XExpressionDeletes 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
Initiates an operation action on statuses. The operation is finished with the particular method from DocumentActionApiExample:
// 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
-