Skip to content
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

[KOGITO-9483] - fix wflow and few formating fixes #1717

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Should return something like this ("id" will change)
"id": "b1e8ce8d-2fc5-4d39-b3b3-6f7dddbb1515",
"workflowdata": {
"shouldCompensate": true,
"compensated": "true"
"compensated": true,
"compensating_more": "Real Betis Balompie"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,95 @@
"name": "Workflow Error example",
"description": "An example of how compensation works",
"start": "printStatus",
"functions": [
{
"name": "PrintOutput",
"type": "custom",
"operation": "sysout"
}
],
"states": [
{
{
"name": "printStatus",
"type": "inject",
"data": {
"compensated": false
"compensated": false
},
"compensatedBy" : "compensating",
"transition": "branch"
},
"compensatedBy": "compensating",
"transition": "branch"
},
{
"name": "branch",
"type": "switch",
"dataConditions": [
{
"condition": ".shouldCompensate==true",
"transition": {
"nextState" : "finish_compensate",
"compensate" : true
}
},
"transition": {
"nextState": "finish_compensate",
"compensate": true
}
},
{
"condition": ".shouldCompensate==false",
"transition": {
"nextState" : "finish_not_compensate",
"compensate" : false
}
"transition": {
"nextState": "finish_not_compensate",
"compensate": false
}
}
]
],
"defaultCondition": {
"end": true
}
},
{
"name": "compensating",
"usedForCompensation" : true,
"usedForCompensation": true,
"type": "inject",
"data": {
"compensated": true
},
"transition" : "compensating_more"
},
"transition": "compensating_more"
},
{
"name": "compensating_more",
"usedForCompensation" : true,
"usedForCompensation": true,
"type": "inject",
"data": {
"compensating_more": "Real Betis Balompie"
}
},
"end": true
},
{
"name": "finish_compensate",
"type": "operation",
"actions": [],
"actions": [
{
"name": "finish_compensate_sysout",
"functionRef": {
"refName": "PrintOutput",
"arguments": {
"message": "completed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"message": "completed"
"message": "Compensate completed"

to distinguish finish_compensate and finish_not_compensate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not add the print action at all and leave the flow as it was (fixing the fomatting if we want but thats it)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, besides the readme change (removing the quotes for the boolean, which was a typo), I do not think this PR should have been opened

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you think that the action should not do nothing, it is even better to remove that, at least for me, have empty action list does not make sense.

imho what we can do is, remove the action, change to something else or keep the action with sysout.

What we can't have is one sdk accepting empty array list while the spec mentions that action can't be null, while the other sdk, requires at least one action.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To satisfy the spec and to showcase the compensation, I think this is OK.

}
}
}
],
"end": true
},
{
"name": "finish_not_compensate",
"type": "operation",
"actions": [],
"actions": [
{
"name": "finish_not_compensate_sysout",
"functionRef": {
"refName": "PrintOutput",
"arguments": {
"message": "completed"
}
}
}
],
"end": true
}
]
}
}