Class CheckValidationReportUserTask
This extension performs a validation report check on the newly created and modified records when the user clicks the 'accept' or the 'reject' button. If any of those records are in error, the work item completion is blocked and the specified error message is reported.
For example, if modifying record A leads to the creation of record B in another table within the same dataset, this method will verify whether record A has new errors and if record B contains any errors. If either record has errors, the work item is blocked.
The following should be added in the work item configuration under Extension:
- Rule:
com.apgar.common.lib.workflow.usertask.CheckValidationReportUserTask - Parameters:
- Parameter name:
user(e.g., ${user}) - Parameter name:
message(e.g., "Please correct the errors before submitting.")
- Parameter name:
This also requires two data context variables to be defined in the workflow to retrieve the dataset to validate.
workSpacedataSet
- Author:
- APGAR Consulting
-
Nested Class Summary
Nested classes/interfaces inherited from class com.orchestranetworks.workflow.UserTask
com.orchestranetworks.workflow.UserTask.CompletionStrategy, com.orchestranetworks.workflow.UserTask.UserTaskMode, com.orchestranetworks.workflow.UserTask.WorkItem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckBeforeWorkItemCompletion(com.orchestranetworks.workflow.UserTaskBeforeWorkItemCompletionContext context) Performs a blocking validation report check, at the dataset level, on the created/modified records.voidsetMessage(String message) Sets the error message displayed if the created/modified records have errors.Methods inherited from class com.apgar.common.lib.workflow.usertask.AffectationUserTask
getUser, handleCreate, setUserMethods inherited from class com.apgar.common.lib.workflow.usertask.CommonUserTask
handleWorkItemCompletionMethods inherited from class com.orchestranetworks.workflow.UserTask
getUsersForAllocation
-
Constructor Details
-
CheckValidationReportUserTask
public CheckValidationReportUserTask()
-
-
Method Details
-
checkBeforeWorkItemCompletion
public void checkBeforeWorkItemCompletion(com.orchestranetworks.workflow.UserTaskBeforeWorkItemCompletionContext context) Performs a blocking validation report check, at the dataset level, on the created/modified records.This method reports an error if the created/modified records introduce new errors.
- Overrides:
checkBeforeWorkItemCompletionin classcom.orchestranetworks.workflow.UserTask- Parameters:
context- the context to perform checks on before the work item is actually completed.
-
setMessage
Sets the error message displayed if the created/modified records have errors.- Parameters:
message- the error message to be displayed
-