Groovy Code Example
class A implements CheckinVisitPlugin {
// Whether each node executes depends on configuration in the type settings to trigger methods in this class
@Override
CheckinValidate.Result beforeCheckin(CheckinValidate.Arg beforeCheckArg) {
// Parameters included
String checkId = beforeCheckFinishArg.checkId as String // ID of advanced field object (may be null for temporary field operations)
String mainObjApiName = beforeCheckFinishArg.mainObjApiName as String // API name of main object for advanced field visit (may be empty)
String mainObjDataId = beforeCheckFinishArg.mainObjDataId as String // Data ID of main object for advanced field visit (may be empty)
String checkTypeId = beforeCheckFinishArg.checkTypeId as String // Field operation type ID, used to distinguish cases where different types share the same APL class (not needed if different types are configured with different APL classes)
switch(checkTypeId) {
case "641c093ca70a6f56080ab9a7":
return CheckinValidate.Result.builder().success(false).block(false).title("Popup Title").message("Popup Content").build();
break;
default:
return CheckinValidate.Result.builder().success(true).build()
}
}
@Override
CheckinValidate.Result beforeCheckout(CheckinValidate.Arg beforeCheckoutArg) {
// Construct return result
return CheckinValidate.Result.builder().success(false).block(false).title("Popup Title").message("Popup Content").build();
}
@Override
CheckinValidate.Result beforeCheckFinish(CheckinValidate.Arg beforeCheckFinishArg) {
// Construct return result
return CheckinValidate.Result.builder().success(false).block(true).title("Popup Title").message("Popup Content").build();
}
}