forked from apache/incubator-kie-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KOGITO-7856] Fixes to export a Kogito compliant JSON workflow defini…
…tion (apache#25) Signed-off-by: Davide Salerno <[email protected]>
- Loading branch information
1 parent
d18bbc4
commit c5c8b34
Showing
7 changed files
with
114 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package v08 | ||
|
||
import "fmt" | ||
|
||
func (e StateType) String() string { | ||
switch e { | ||
case EventStateType: | ||
return "event" | ||
case OperationStateType: | ||
return "operation" | ||
case SwitchStateType: | ||
return "switch" | ||
case SleepStateType: | ||
return "sleep" | ||
case ParallelStateType: | ||
return "parallel" | ||
case InjectStateType: | ||
return "inject" | ||
case ForEachStateType: | ||
return "foreach" | ||
default: | ||
return fmt.Sprintf("%s", string(e)) | ||
} | ||
} |
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
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
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
47 changes: 47 additions & 0 deletions
47
config/samples/sw.kogito.kie.org__v08_kogitoserverlessworkflow_withITA.yaml
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,47 @@ | ||
apiVersion: sw.kogito.kie.org/v08 | ||
kind: KogitoServerlessWorkflow | ||
metadata: | ||
name: greeting | ||
annotations: | ||
sw.kogito.kie.org/description: Greeting example on k8s! | ||
spec: | ||
start: ChooseOnLanguage | ||
functions: | ||
- name: greetFunction | ||
type: custom | ||
operation: sysout | ||
states: | ||
- name: ChooseOnLanguage | ||
type: switch | ||
dataConditions: | ||
- condition: "${ .language == \"English\" }" | ||
transition: GreetInEnglish | ||
- condition: "${ .language == \"Spanish\" }" | ||
transition: GreetInSpanish | ||
- condition: "${ .language == \"Italian\" }" | ||
transition: GreetInItalian | ||
defaultCondition: GreetInEnglish | ||
- name: GreetInEnglish | ||
type: inject | ||
data: | ||
greeting: "Hello from JSON Workflow, " | ||
transition: GreetPerson | ||
- name: GreetInSpanish | ||
type: inject | ||
data: | ||
greeting: "Saludos desde JSON Workflow, " | ||
transition: GreetPerson | ||
- name: GreetInItalian | ||
type: inject | ||
data: | ||
greeting: "Saluti dal JSON Workflow, " | ||
transition: GreetPerson | ||
- name: GreetPerson | ||
type: operation | ||
actions: | ||
- name: greetAction | ||
functionRef: | ||
refName: greetFunction | ||
arguments: | ||
message: ".greeting+.name" | ||
end: true |
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
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