Checker
📌 Purpose
🏗️ Inheritance from EntityChecker
EntityChecker@Component
public class CreateApplicationExecutionChecker extends EntityChecker<CampaignExecution, Long> {
@Autowired
private CreateApplicationService createApplicationService;
@Autowired
private TransactionTemplateBuilder ttb;
@Override
protected void registerListeners(CheckerListenerRegistry<CampaignExecution> registry) {
registry.entityChange().updated(CampaignExecution_.STATUS);
}
@Override
protected boolean isAvailable(CampaignExecution execution) {
return execution.getStatus() == CampaignExecutionStatus.FINISHED;
}
@Override
protected void perform(CampaignExecution execution) {
final Long executionId = execution.getId();
TransactionUtils.afterTransaction(() -> {
execution.getClients().forEach(borrower ->
createApplicationService.create(borrower.getId(), executionId)
);
});
}
}🔔 Reacting to FINISHED Status
FINISHED Status🛠️ Core Logic in perform(...)
perform(...)📦 Components and Dependencies
🔄 How It Works in the System
🧪 Example Usage
📌 Summary
Last updated
Was this helpful?