-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Workflows with XState #1019
base: feature/svelte
Are you sure you want to change the base?
Workflows with XState #1019
Conversation
Send task name and actions to corresponding page.svelte Handle form submission and redirect to /tasks
Based on workflow state: - Select form title - Select form instructions - Select specific fields - Conditionally return reviewers - Conditionally return productArtifacts and filter by artifact type
- Show some product information - Jump state is now a button in the menu rather than a contextmenu event
there are no records in db currently, so can't test this yet.
The frontend is not hooked into this yet.
Does not work yet. Resolving import issues.
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.
Looks pretty good; well done.
Here's a first-look review. I haven't reviewed the default-workflow.ts
stuff at all, and I haven't tested anything, but here's some comments I have looking through it rather quickly. Some questions are probably somewhat ignorant because I'm not entirely clear what your goal is, but I think they'll be helpful.
One larger thing: you're handling the state machines with a lot of functional programming. You have a lot of functions that take WorkflowMachine
or WorkflowContext
as (often the first) argument, which makes me wonder if it could be done in a more object-oriented way, making things more intuitive to write.
source/SIL.AppBuilder.Portal/src/routes/(authenticated)/tasks/[product_id]/+page.server.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: 7dev7urandom <30197373+7dev7urandom@users.noreply.github.com>
Also removed filterObject
I have created a wrapper class for |
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.
Wow, it does look a lot better and easier to use. Let me know what you think of my feedback.
d961f99
to
9047c04
Compare
- constructor is now private - create and restore are static functions that return a Workflow instance - getSnapshot is also static now - updated parameters of the modified functions
9047c04
to
3dd3423
Compare
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.
Looks good to me, let's try it out!
Uses the XState library to create FSM instances that model the desired workflow behavior.
Features:
WorkflowInstances
) that stores enough information to restore to the current state.UserTasks
table with the appropriate information.ProductTransitions
table with the appropriate information./tasks/[product_id]
and are handled by the FSM./admin/workflows
./admin/workflows/[product_id]
Future Priorities:
/admin/workflows