-
Notifications
You must be signed in to change notification settings - Fork 30
[vrotsc,vrotsc-annotations] (#869) Add Workflow Canvas Item for Switch Component #910
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
base: main
Are you sure you want to change the base?
Changes from all commits
2c4ba42
5694343
6cc122f
c387fa1
cf2c0cd
5e9fac1
a7a028b
89929f0
3c075c4
babb10c
d05e9ae
baa8d9a
7eb9455
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import { Workflow, SwitchItem } from "vrotsc-annotations"; | ||
|
|
||
| @Workflow({ | ||
| name: "switch all", | ||
| path: "VMware/PSCoE", | ||
| description: "Comprehensive switch test with all comparator types", | ||
| attributes: { | ||
| var_str: { | ||
| type: "string" | ||
| }, | ||
| var_num: { | ||
| type: "number" | ||
| }, | ||
| var_bool: { | ||
| type: "boolean" | ||
| }, | ||
| } | ||
| }) | ||
| export class SwitchAll { | ||
|
|
||
| @SwitchItem({ | ||
| cases: [ | ||
| // String comparisons | ||
| { condition: "", target: "handleEmpty", variable: "var_str", type: "string", comparator: "equals" }, | ||
| { condition: "test", target: "handleStringOp", variable: "var_str", type: "string", comparator: "contains" }, | ||
| { condition: "pattern", target: "handleStringOp", variable: "var_str", type: "string", comparator: "match" }, | ||
| { condition: "value", target: "handleStringOp", variable: "var_str", type: "string", comparator: "different" }, | ||
|
|
||
| // Number comparisons | ||
| { condition: 1, target: "handleNumeric", variable: "var_num", type: "number", comparator: "different" }, | ||
| { condition: 5, target: "handleNumeric", variable: "var_num", type: "number", comparator: "greater" }, | ||
| { condition: 10, target: "handleNumeric", variable: "var_num", type: "number", comparator: "smaller" }, | ||
| { condition: 0, target: "handleNumeric", variable: "var_num", type: "number", comparator: "greater or equals" }, | ||
| { condition: 100, target: "handleNumeric", variable: "var_num", type: "number", comparator: "smaller or equals" }, | ||
|
|
||
| // Boolean comparisons | ||
| { condition: true, target: "handleBoolean", variable: "var_bool", type: "boolean", comparator: "equals" }, | ||
| { condition: false, target: "handleBoolean", variable: "var_bool", type: "boolean", comparator: "different" } | ||
| ], | ||
| target: "handleDefault" | ||
| }) | ||
| public switchElement() { | ||
| // Switch logic will be generated automatically | ||
| } | ||
|
|
||
| public handleEmpty() { | ||
| System.log("Handling empty string"); | ||
| } | ||
|
|
||
| public handleStringOp() { | ||
| System.log("Handling string operation"); | ||
| } | ||
|
|
||
| public handleNumeric() { | ||
| System.log("Handling numeric operation"); | ||
| } | ||
|
|
||
| public handleBoolean() { | ||
| System.log("Handling boolean operation"); | ||
| } | ||
|
|
||
| public handleDefault() { | ||
| System.log("Handling default case"); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.