-
Notifications
You must be signed in to change notification settings - Fork 22
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
[vrotsc,vrotsc-annotations] (#324) Add Workflow canvas Error Handling #371
Conversation
They point to the item to call in case of exception Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
1 << 2 is the same as 2 << 1... first is better as we want powers of 2 Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Otherwise we won't be able to use the actual `Error` object as they will overlap and overwrite :) Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Alexander Kantchev <akantchev@vmware.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
…re-aria into feature/324-canvas-item-error-handling Signed-off-by: Stefan Genov <stefan.genov@broadcom.com>
Hi @Michaelpalacce, I did some tests with a real environment, however when I try to build a package an push it to an environment the following error occurs:
It appears that somewhere when you generate the XML there is a missing white-space, hence the XML is incorrect, could you please check. I used the a typescript project with single workflow using the following code: /*-
* #%L
* vro.ts.workflows
* %%
* Copyright (C) 2024 TODO: Enter Organization name
* %%
* TODO: Define header text
* #L%
*/
import { Workflow, Out, In, Err, Item, RootItem, DecisionItem, WaitingTimerItem, WorkflowEndItem, DefaultErrorHandler } from "vrotsc-annotations";
@Workflow({
name: "Complex Workflow",
path: "VMware/PSCoE",
attributes: {
waitingTimer: {
type: "Date"
},
counter: {
type: "number"
}
}
})
export class Complex {
@DecisionItem({
target: "waitForEvent",
else: "end"
})
public decisionElement(waitingTimer: Date) {
return waitingTimer !== null;
}
@Item({
target: "decisionElement",
exception: ""
})
public execute(
@Out @In waitingTimer: Date,
@Out @In counter: number
): void {
if (!counter) {
counter = 0;
}
counter++;
if (counter < 2) {
const tt = Date.now() + 5 * 1000;
waitingTimer = new Date(tt);
} else {
waitingTimer = null;
}
System.log("Counter: " + counter);
System.log("Waiting Timer: " + waitingTimer);
}
@Item({
target: "execute",
exception: ""
})
@RootItem()
public start() {
System.log("Starting workflow");
}
@WaitingTimerItem({
target: "execute"
})
public waitForEvent(@In waitingTimer: Date) {
// NOOP
}
@DefaultErrorHandler({
target: "workflowEnd"
})
public defaultErrorHandler(@Out errorMessage: string) {
// NOOP
}
@WorkflowEndItem({
endMode: 1,
businessStatus: "Bad"
})
public workflowEnd(@Err errorMessage: string) {
// NOOP
}
} |
Co-authored-by: Venelin Bakalov <bakalovv@vmware.com> Signed-off-by: Stefan Genov <sgenov@vmware.com>
@Michaelpalacce, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@Michaelpalacce, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@akantchev I think you need to define: attributes: { |
@akantchev please check whenever you can and if everything is ok, let's resolve the previous comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merge conflict resolution left
Description
TBD
Checklist
Fixed #XXX -
orClosed #XXX -
prefix to auto-close the issueTesting
e2e test added
Related issue:
#324