wmedvede commented on PR #350:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/350#issuecomment-1903768560

   Hi @RichardW98 , let me add some last comments regarding some missing tweaks 
that we need, and which is totally fine since you are not yet familiar with all 
the nitpicks we need to complete the configuration.
   
   At the workflow side, you are already doing some iteration 
[](https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/df36511f9a5344611eff714d9d510200813d4784/controllers/profiles/common/object_creators.go#L220)
 to determine if the workflow produces events, etc., and thus, to create the 
**SinkBinding**, which is good.
   
   However, there are more situations where the workflow might need to send 
cloud events, even in cases where we don't have any cncfmodel.EventKindProduced 
at all. That is the case of workflows that use **timeouts** (might produce 
other events or not), since the implementation of these **timeouts** involves 
sending cloud events to the Job service.
   
   **Events production detection:**
   
   So, additionally to this cncfmodel.EventKindProduced you are doing, we must 
check if the workflow has timeouts. And right now, with the current SW timeouts 
support we have, I think we must focus on inspecting the following situations:
   
   1. At the top-level workflow definition, we must check if the workflow has 
configured any of the following timeouts: **workflowExecTimeout** or 
**eventTimeout**
   
   
https://github.com/serverlessworkflow/specification/blob/main/specification.md#workflow-timeouts
   
   **example here:**  
https://github.com/apache/incubator-kie-kogito-examples/blob/a60d2f0b1ecfdab0758da74bc799adf53a83f5d5/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/resources/workflow-timeouts.sw.json#L8
   
   
   2. If the workflow has any a **sleep** state as part of its definition
   
   
https://github.com/serverlessworkflow/specification/blob/main/specification.md#sleep-state
   
   3. If the workflow has any **callback** state with a configured 
**eventTimeout** as part of its definition
   
   
https://github.com/serverlessworkflow/specification/blob/main/specification.md#callback-state
   
   **example here:**  
https://github.com/apache/incubator-kie-kogito-examples/blob/2a28c6ae545622c95dfa3ca31b9df525b4c56e87/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/resources/callback-state-timeouts.sw.json#L53
   
   4. If the workflow has any **event** state with a configured 
**eventTimeout** as part of its definition
   
   
https://github.com/serverlessworkflow/specification/blob/main/specification.md#event-state
   
   **example here:**  
https://github.com/apache/incubator-kie-kogito-examples/blob/2a28c6ae545622c95dfa3ca31b9df525b4c56e87/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/resources/event-state-timeouts.sw.json#L89
   
   5) If the workflow has any **switch** state with a configured 
**eventTimeout** as part of its definition
   
   
https://github.com/serverlessworkflow/specification/blob/main/specification.md#switch-state
   
   **example here:**  
https://github.com/apache/incubator-kie-kogito-examples/blob/2a28c6ae545622c95dfa3ca31b9df525b4c56e87/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/resources/switch-state-timeouts.sw.json#L60
   
   
   **K_SINK health check:**
   
   When we have knative enabled, and we move to use the knative eventing, etc., 
we use the K_SINK env var, etc.
   In that cases, at the workflows runtime side, we incorporate a heath check 
on that variable, to ensure we have value there. This is good, because the 
runtime will rely on the K_SINK value to deliver the events.
   
   Right now, we are intentionally disabling that check, because we are not 
using knative eventing, so we don't want the workflow health check to fail 
because of this.
   
   Now, as part of this PR, if the user decides to use knative eventing, and we 
determine that the SinkBinding must be created, we must enable it.
   
   To manage that health check we use the following property 
org.kie.kogito.addons.knative.eventing.health-enabled, which is right now 
defaulted to false as an immutable property.
   
   see here:   
https://github.com/apache/incubator-kie-kogito-serverless-operator/blob/df36511f9a5344611eff714d9d510200813d4784/controllers/profiles/common/properties/application.go#L45
   
   
   
   
   
   


-- 
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]

Reply via email to