updating sequence of flows

This commit is contained in:
2025-11-02 19:48:31 +02:00
parent 683da10748
commit 29e5036346
4 changed files with 16 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ public class StewardIntegrationProcessor implements TransactionProcessorInterfac
.build();
if(Objects.equals(powertelClientId, transaction.getBillClientId())) {
logger.info("send confirmation again");
logger.info("send confirmation again for - " + transaction.getBillClientId());
String url = aggregatorUrl + "/merchant/aggregation/transaction";
LinkedHashMap response = restService.postWithToken(token, url, request, LinkedHashMap.class);
logger.info("response: {}", response.toString());

View File

@@ -66,7 +66,7 @@ public class TransactionWorkflow extends WorkflowDefinition {
permit(GATEWAY_PAYMENT_SUCCESS, INTEGRATION);
permit(INTEGRATION, PURCHASE_INVOICE, TRAN_FAILED);
permit(PURCHASE_INVOICE, PURCHASE_INVOICE_PAYMENT);
permit(PURCHASE_INVOICE_PAYMENT, PURCHASE_INVOICE_PAYMENT_SUCCESS);
permit(PURCHASE_INVOICE_PAYMENT, PURCHASE_INVOICE_PAYMENT_SUCCESS, DONE);
permit(PURCHASE_INVOICE_PAYMENT_SUCCESS, POLL_STATUS);
permit(POLL_STATUS, SALES_INVOICE, TRAN_FAILED);
permit(SALES_INVOICE, JOURNAL_ENTRY);
@@ -219,6 +219,13 @@ public class TransactionWorkflow extends WorkflowDefinition {
transaction = (Transaction) handlerInterface.process(transaction);
execution.setVariable("body", Utils.toJson(transaction));
// it's possible to have a flow that ends up event though
// polling has already happened
if(transaction.getPollingStatus() == Status.SUCCESS){
return NextAction.moveToState(DONE,
"Polling already complete");
}
return NextAction.moveToState(PURCHASE_INVOICE_PAYMENT_SUCCESS,
"Purchase invoice payment generated - id: " + transaction.getErpPurchasePaymentRef());
}catch (Exception e) {