Venture within a form builder for building out processes? #62
Replies: 2 comments
-
|
I enabled discussions for this repository and converted this issue since it's more of a general Q&A. To answer your question: Venture doesn't really deal with "dynamic" workflows very well, meaning workflows where you want to change the structure of a workflow at runtime. There's a way to configure conditional jobs for a workflow, but those get resolved when you start the workflow. Once the workflow is running, there's no way to change it anymore. You could probably implement your use case by using multiple workflows. So once the first workflow finishes, you could use the I think @stevebauman had a similar use case to yours, so maybe he can pitch in on how he went about solving this. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the ping @ksassnowski. I do have a similar case to @tonypartridger. @tonypartridger -- as mentioned by @ksassnowski, you'll have to dispatch new child workflows, associating them to their parent. At my work, we've introduced a Schema::create(config('venture.workflow_table'), function (Blueprint $table) {
// ...
$table->foreignId('parent_id')->nullable()->index()->constrained('workflows')->cascadeOnDelete();
});Then, we use the staudenmeir/laravel-adjacency-list package to help us query these chained workflows. We've extended the built in There's quite a bit of custom code in our implementation, but here's a snippet so you can see how we're associating the parent (if one is present in the workflow) and then dynamically generating a job via a given document. Ex: class WorkflowChain extends AbstractWorkflow
{
// ...
public function definition(): WorkflowDefinition
{
return $this->define($this->name)->addJob(
$this->toQueuable($this->document)
);
}
public function beforeCreate($workflow): void
{
if ($this->parent) {
$workflow->parent()->associate($this->parent);
}
$workflow->workflowable()->associate($this->document);
}
}I hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So I am looking at building out a workflow/process manager, and wondering if Venture would be ideal for this.
The idea would be to build out several forms in our custom form builder, and tie them together with a workflow/process. Say for example:
Form submitted -> ( Mark for Review -> Send form admin email for reviewing) ->
If Approved -> change state -> Request additional Form to be filled -> Submitted -> Finished
if Declined -> change state -> notify submission author
there can be a lot of conditions and values within the forms to dictate the form/ workflow process.
Do you foresee any issues with this method or have any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions