-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOGITO-9412: Create the serverless-workflow-timeouts-showcase for the…
… Operator Dev Mode (#1696) * KOGITO-9412: Create the serverless-workflow-timeouts-showcase for the Operator Dev Mode - Initial version * move the workflow resources to SonataFlow * increase memory settings and code review fixes * readme updates * Adjust to naming to SonataWorkflow * Readme updates and restore the workflow-timouets.sw.json name changed by mistake
- Loading branch information
Showing
34 changed files
with
2,183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ples/serverless-workflow-timeouts-showcase-embedded/as-yml/callback-state-timeouts.sw.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
id: callback_state_timeouts | ||
version: '1.0' | ||
name: Callback State Timeouts Example | ||
description: Simple process to show the callback state timeout working | ||
start: PrintStartMessage | ||
events: | ||
- name: callbackEvent | ||
source: '' | ||
type: callback_event_type | ||
functions: | ||
- name: systemOut | ||
type: custom | ||
operation: sysout | ||
states: | ||
- name: PrintStartMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has started.\"}" | ||
transition: CallbackState | ||
- name: CallbackState | ||
type: callback | ||
action: | ||
name: callbackAction | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has executed the callbackFunction.\"}" | ||
eventRef: callbackEvent | ||
transition: CheckEventArrival | ||
timeouts: | ||
eventTimeout: PT30S | ||
- name: CheckEventArrival | ||
type: switch | ||
dataConditions: | ||
- condition: "${ .eventData != null }" | ||
transition: EventArrived | ||
defaultCondition: | ||
transition: EventNotArrived | ||
- name: EventArrived | ||
type: inject | ||
data: | ||
exitMessage: "The callback event has arrived." | ||
transition: PrintExitMessage | ||
- name: EventNotArrived | ||
type: inject | ||
data: | ||
exitMessage: "The callback event has not arrived, and the timeout has overdue." | ||
transition: PrintExitMessage | ||
- name: PrintExitMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has finalized. \" + .exitMessage + \" eventData: \" + .eventData}" | ||
end: true |
61 changes: 61 additions & 0 deletions
61
...xamples/serverless-workflow-timeouts-showcase-embedded/as-yml/event-state-timeouts.sw.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
id: event_state_timeouts | ||
version: "1.0" | ||
name: Event State Timeouts Example | ||
description: Simple process to show the event state timeout working | ||
start: PrintStartMessage | ||
events: | ||
- name: event1 | ||
source: '' | ||
type: event1_event_type | ||
- name: event2 | ||
source: '' | ||
type: event2_event_type | ||
functions: | ||
- name: systemOut | ||
type: custom | ||
operation: sysout | ||
states: | ||
- name: PrintStartMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"event-state-timeouts: \" + $WORKFLOW.instanceId + \" has started.\"}" | ||
transition: WaitForEvent | ||
- name: WaitForEvent | ||
type: event | ||
onEvents: | ||
- eventRefs: [ event1 ] | ||
eventDataFilter: | ||
data: "${ \"The event1 was received.\" }" | ||
toStateData: "${ .exitMessage }" | ||
actions: | ||
- name: printAfterEvent1 | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"event-state-timeouts: \" + $WORKFLOW.instanceId + \" executing actions for event1.\"}" | ||
- eventRefs: [ event2 ] | ||
eventDataFilter: | ||
data: "${ \"The event2 was received.\" }" | ||
toStateData: "${ .exitMessage }" | ||
actions: | ||
- name: printAfterEvent2 | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"event-state-timeouts: \" + $WORKFLOW.instanceId + \" executing actions for event2.\"}" | ||
timeouts: | ||
eventTimeout: PT30S | ||
transition: PrintExitMessage | ||
- name: PrintExitMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"event-state-timeouts: \" + $WORKFLOW.instanceId + \" has finalized. \" + if .exitMessage != null then .exitMessage else \"The event state did not receive any event, and the timeout has overdue\" end }" | ||
end: true |
61 changes: 61 additions & 0 deletions
61
...amples/serverless-workflow-timeouts-showcase-embedded/as-yml/switch-state-timeouts.sw.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
id: switch_state_timeouts | ||
version: "1.0" | ||
name: Switch State Timeouts Example | ||
description: Simple process to show the switch state timeout working | ||
start: PrintStartMessage | ||
events: | ||
- name: visaApprovedEvent | ||
source: '' | ||
type: visa_approved_event_type | ||
- name: visaDeniedEvent | ||
source: '' | ||
type: visa_denied_event_type | ||
functions: | ||
- name: systemOut | ||
type: custom | ||
operation: sysout | ||
states: | ||
- name: PrintStartMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"switch-state-timeouts: \" + $WORKFLOW.instanceId + \" has started.\"}" | ||
transition: ChooseOnEvent | ||
- name: ChooseOnEvent | ||
type: switch | ||
eventConditions: | ||
- eventRef: visaApprovedEvent | ||
transition: ApprovedVisa | ||
- eventRef: visaDeniedEvent | ||
transition: DeniedVisa | ||
defaultCondition: | ||
transition: HandleNoVisaDecision | ||
timeouts: | ||
eventTimeout: PT30S | ||
- name: ApprovedVisa | ||
type: inject | ||
data: | ||
exitMessage: "Your visa was approved." | ||
transition: PrintExitMessage | ||
- name: DeniedVisa | ||
type: inject | ||
data: | ||
exitMessage: "Your visa was denied." | ||
transition: PrintExitMessage | ||
- name: HandleNoVisaDecision | ||
type: inject | ||
data: | ||
exitMessage: "No decision was made. The switch state did not receive any event, and the timeout has overdue." | ||
transition: PrintExitMessage | ||
- name: PrintExitMessage | ||
type: operation | ||
actions: | ||
- name: printSystemOut | ||
functionRef: | ||
refName: systemOut | ||
arguments: | ||
message: "${\"switch-state-timeouts: \" + $WORKFLOW.instanceId + \" has finalized. \" + .exitMessage}" | ||
end: true |
Oops, something went wrong.