@@ -68,8 +68,10 @@ public static <T> T zeebeVariable(Exchange exchange, String name, Class<T> clazz
6868 }
6969
7070 public static String getCurrentDate (String requestedDate ,String dateFormat ) {
71- LocalDateTime datetime = LocalDateTime .parse (requestedDate , DateTimeFormatter .ofPattern (dateFormat ));
72- return datetime .format (DateTimeFormatter .ofPattern (dateFormat ));
71+ String dateFormatGiven ="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" ;
72+ LocalDateTime datetime = LocalDateTime .parse (requestedDate , DateTimeFormatter .ofPattern (dateFormatGiven ));
73+ String newDate = datetime .format (DateTimeFormatter .ofPattern (dateFormat ));
74+ return newDate ;
7375 }
7476
7577 public static LoanRepaymentDTO setLoanRepaymentBody (Exchange exchange ) {
@@ -78,19 +80,21 @@ public static LoanRepaymentDTO setLoanRepaymentBody(Exchange exchange) {
7880 loanRepaymentDTO .setDateFormat (dateFormat );
7981 loanRepaymentDTO .setLocale ("en" );
8082 loanRepaymentDTO .setTransactionAmount (exchange .getProperty ("amount" ).toString ());
81- String currDate = getCurrentDate (exchange .getProperty ("requestedDate" ).toString (),dateFormat );
82- loanRepaymentDTO .setTransactionDate (currDate );
83+ loanRepaymentDTO .setTransactionDate (exchange .getProperty ("requestedDate" ).toString ());
8384 return loanRepaymentDTO ;
8485 }
8586
8687 public static void setZeebeVariables (Exchange e , Map <String , Object > variables , String requestDate , String accountHoldingInstitutionId , String transactionChannelRequestDTO ) {
88+ String dateFormat = "dd MMMM yyyy" ;
89+ String currentDate =getCurrentDate (requestDate ,dateFormat );
90+
8791 variables .put (ACCOUNT_IDENTIFIER ,e .getProperty (ACCOUNT_IDENTIFIER ));
8892 variables .put (ACCOUNT_NUMBER ,e .getProperty (ACCOUNT_NUMBER ));
8993 variables .put (TRANSACTION_ID , UUID .randomUUID ().toString ());
9094 variables .put (TENANT_ID ,accountHoldingInstitutionId );
9195 variables .put (TRANSFER_ACTION ,CREATE .name ());
9296 variables .put (CHANNEL_REQUEST ,transactionChannelRequestDTO );
93- variables .put (REQUESTED_DATE ,requestDate );
97+ variables .put (REQUESTED_DATE ,currentDate );
9498 variables .put (EXTERNAL_ACCOUNT_ID ,e .getProperty (ACCOUNT_NUMBER ));
9599 variables .put ("payeeTenantId" , accountHoldingInstitutionId );
96100 }
0 commit comments