-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[incubator-kie-issues#1596] Adding Business Calendar Example #2036
Conversation
Reopened from #2031 |
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-examples -u #2036 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-examples-pr/job/PR-2036/2/display/redirect Test results:
Those are the test failures: org.kie.kogito.calendar.CreditCardProcessIT.testCardPaymentInWorkingDay1 expectation failed.Response body doesn't match expectation. Expected: "[]" Actual: [{"id":"34985152-e934-422d-befe-0f6ab4333bfd","creditCardNumber":null,"creditCardDetails":{"cardNumber":"434354343","status":"Bill Due"}}] |
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-examples -u #2036 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-examples-pr/job/PR-2036/3/display/redirect Test results:
Those are the test failures: org.kie.kogito.calendar.CreditCardProcessIT.testCardPaymentInWorkingDay1 expectation failed.Response body doesn't match expectation. Expected: "[]" Actual: [{"id":"4267f444-8674-4514-9f79-186ed782bc0f","creditCardNumber":null,"creditCardDetails":{"cardNumber":"434354343","status":"Bill Due"}}] |
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-examples -u #2036 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-examples-pr/job/PR-2036/4/display/redirect Test results:
Those are the test failures: org.kie.kogito.examples.quarkus.GrafanaDockerComposeIT.testGrafanaDashboards1 expectation failed.JSON path title doesn't match. Expected: a collection containing "dmn-drools-quarkus-metrics_999-SNAPSHOT - hello - Operational Dashboard" Actual: <[dmn-drools-quarkus-metrics_999-SNAPSHOT - Custom - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - Custom - Operational Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - Hello - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - LoanEligibility - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - LoanEligibility - Operational Dashboard]> |
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
Hi @Abhitocode, if this is Ready for review, please move its status from Draft to "Ready for review". Thanks |
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-examples -u #2036 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-examples-pr/job/PR-2036/11/display/redirect Test results:
Those are the test failures: org.kie.kogito.examples.quarkus.GrafanaDockerComposeIT.testGrafanaDashboards1 expectation failed.JSON path title doesn't match. Expected: a collection containing "dmn-drools-quarkus-metrics_999-SNAPSHOT - Custom - Operational Dashboard" Actual: <[dmn-drools-quarkus-metrics_999-SNAPSHOT - Custom - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - Hello - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - hello - Operational Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - LoanEligibility - Domain Dashboard, dmn-drools-quarkus-metrics_999-SNAPSHOT - LoanEligibility - Operational Dashboard]> |
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The section on running without calendar.properties file needs to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reporting a couple of minor points
...to-quarkus-examples/process-business-calendar-example/src/main/resources/calendar.properties
Outdated
Show resolved
Hide resolved
...to-quarkus-examples/process-business-calendar-example/src/main/resources/calendar.properties
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. It seems very good feature. I have done some tests locally. I agree with others that maybe we could enhance the documentation a little bit.
...-business-calendar-example/src/main/java/org/kie/kogito/calendar/bill/CreditCardService.java
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
|
||
```sh | ||
mvn clean package | ||
java -jar target/quarkus-app/quarkus-run.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled it in the application.properties, should work now.
Note that this requires GRAALVM_HOME to point to a valid GraalVM installation | ||
|
||
```sh | ||
mvn clean package -Pnative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to finish this build:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:16 min
[INFO] Finished at: 2024-11-13T11:09:29+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:3.8.6:build (default) on project process-business-calendar-example: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:468)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:258)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:840)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
business.hours.per.day=24 # Defines the number of hours per working day (e.g., business.hours.per.day=24 for a 24-hour workday) | ||
business.days.per.week =7 # Defines how many days are considered working days (e.g.,7 means all days are working days) | ||
business.holiday.date.format=yyyy-MM-dd # specifies holiday date format used | ||
business.holidays=2024-11-07 # Add custom holidays that are non-working days, specified in the format defined by business.holiday.date.format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to define multiple days or periods, is that possible? asking because there are usually more holidays during the year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple holidays: 2024-11-13, 2024-11-14
In a range 2024-11-14:2024-11-14
Thank you for the pointing it, just remebered to add the same in the readme too.
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
<bpmn2:collaboration id="_DCDB6E8C-F47A-4DBC-B34A-046A81E24F95" name="Default Collaboration"> | ||
<bpmn2:participant id="_D18AFD4D-A5A8-4C66-8259-5D9CF9B946FA" name="Pool Participant" processRef="BusinessCalendarCreditBill"/> | ||
</bpmn2:collaboration> | ||
<bpmn2:process id="BusinessCalendarCreditBill" drools:packageName="org.kie.calendar.bill" drools:version="1.0" drools:adHoc="false" name="BusinessCalendar-CreditBill" isExecutable="true" processType="Public"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could unify the packages, in src/main/java we have org.kie.kogito.calendar.bill
while in src/main/resources we have org.kie.calendar.bill
...to-quarkus-examples/process-business-calendar-example/src/main/resources/calendar.properties
Outdated
Show resolved
Hide resolved
...to-quarkus-examples/process-business-calendar-example/src/main/resources/calendar.properties
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
kogito-quarkus-examples/process-business-calendar-example/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Abhitocode
Many thanks for the example. And, mostly, for the documentation ❤️
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abhitocode Thank you, well done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @Abhitocode
Thanks for your diligence incorporating all the feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updates @Abhitocode
…2036) * business-calendar-example * business-calendar-example * business-calendar-example * business-calendar-example * business-calendar-example * business-calendar-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example * incubator-kie-issues-1596-bc-example
Closes: apache/incubator-kie-issues#1596
Added an example ensuring business calendar functionality to kogito-quarkus-examples.
The example includes a simple process that uses a business calendar. The example contains a README with clear step by step instructions, and incorporates all supporting resources required. The priority would be having this example for Quarkus.