Abhitocode commented on code in PR #2036: URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2036#discussion_r1842325252
########## kogito-quarkus-examples/process-business-calendar-example/README.md: ########## @@ -0,0 +1,300 @@ +# Process Business Calendar Example + +This example demonstrates the impact of a business calendar on process execution within a Quarkus application. It showcases a business process involving credit card bill processing, which adapts to a business calendar defined in calendar.properties. This configuration modifies timer behaviors to respect working hours, holidays, and other schedule-based constraints. + +### Main Components + +**BPMN2-BusinessCalendarBankTransaction.bpmn2**: +Defines the workflow for processing credit card transactions. +Includes tasks such as processing the credit bill, verifying payment, handling timers, cancelling and bill settlement. + +**CreditCardService.java**: +Implements the logic for handling credit card payment processes. + +**calendar.properties**: +Configures business hours, holidays, and other calendar properties that affect scheduling and timer behavior. + +### BPMN Process Details + +The BPMN model (`BPMN2-BusinessCalendarBankTransaction.bpmn2`) defines a workflow that includes the following main elements: +<p align="center"><img width=75% height=50% src="docs/images/CreditCardModel.png"></p> + +### Start Event + +The initial trigger that starts the credit card bill processing workflow. + +### Process Credit Bill +* Process Credit Bill Properties (Top) + <p align="center"><img width=75% height=50% src="docs/images/ProcessCreditBillTop.png"></p> + +* Process Credit Card Bill Assignments + <p align="center"><img width=75% height=50% src="docs/images/ProcessCreditBillAssign.png"></p> + +### Verify Payment +A service task where the credit card details are validated, ensuring the payment is processed under valid terms. + +* Verify Payment + <p align="center"><img width=75% height=50% src="docs/images/VerifyPayment.png"></p> + +### Timer + +Attached to a human task to simulate waiting for manual confirmation or user action. This timer can be configured to react differently based on the presence of the business calendar. +<p align="center"><img width=75% height=50% src="docs/images/Timer.png"></p> + +### Cancel Payment +Executed if the timer expires without human action, leading to the cancellation of the payment process. + +* Cancel Payment (Top) + <p align="center"><img width=75% height=50% src="docs/images/CancelPaymentTop.png"></p> + +* Cancel Payment Assignments + <p align="center"><img width=75% height=50% src="docs/images/CancelPaymentAssign.png"></p> + +### Settle Payment + +The final step where the payment is settled successfully on manual verification. + +* Settle Payment (Top) + <p align="center"><img width=75% height=50% src="docs/images/SettlePaymentTop.png"></p> + +* Settle Payment Assignments +<p align="center"><img width=75% height=50% src="docs/images/SettlePaymentAssign.png"></p> + +## Build and run + +### Prerequisites + +You will need: +- Java 17+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.9.6+ installed + +When using native image compilation, you will also need: +- GraalVM 19.3+ installed +- Environment variable GRAALVM_HOME set accordingly +- GraalVM native image needs as well native-image extension: https://www.graalvm.org/reference-manual/native-image/ +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too, please refer to GraalVM installation documentation for more details. + +### Compile and Run in Local Dev Mode + +```sh +mvn clean compile quarkus:dev +``` + +NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules, decision tables and java code. No need to redeploy or restart your running application. + +### Package and Run in JVM mode + +```sh +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar Review Comment: enabled it in the application.properties, should work now. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
