Class CustomFormApi.DocumentActionApi
- Enclosing class:
CustomFormApi
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:
-
Constructor Summary
ConstructorDescriptionDocumentActionApi
(Long id, CustomFormService customFormService, ValidationVisitor validationVisitor, FormulaEngineContext formulaEngineContext, CustomFormServiceProperties properties, PersistedObjectService objectService) Document action constructor, which allows to inject custom validatorDocumentActionApi
(Long id, CustomFormService customFormService, PersistedObjectService objectService, FormulaEngineContext formulaEngineContext, CustomFormServiceProperties properties) Default document action constructor with SimpleValidationVisitor hardcoded -
Method Summary
Modifier and TypeMethodDescriptionrevoke()
Finishes the revoke operation.submit()
Finishes the submit operation.withdraw()
Finishes the withdrawal operation.withReason
(String reason) To pass a String reason to submit() method for the WorkFlow logic.
-
Constructor Details
-
DocumentActionApi
public DocumentActionApi(Long id, CustomFormService customFormService, ValidationVisitor validationVisitor, FormulaEngineContext formulaEngineContext, CustomFormServiceProperties properties, PersistedObjectService objectService) Document action constructor, which allows to inject custom validator -
DocumentActionApi
public DocumentActionApi(Long id, CustomFormService customFormService, PersistedObjectService objectService, FormulaEngineContext formulaEngineContext, CustomFormServiceProperties properties) Default document action constructor with SimpleValidationVisitor hardcoded
-
-
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 ba passed to workflow as submit reason, works only withsubmit()
- Returns:
- a Document Action builder instance
-
submit
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
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
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:
-