-
Notifications
You must be signed in to change notification settings - Fork 147
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
Workflow hints/actions #39
Comments
Workflow branching can be done by conditional expressions using process data. Let's explain using the workflow let's say the current activity of a process instance of the workflow is When the activity <?php
// ...
// A database entity class that persists an instance of the workflow "LoanRequestProcess".
class LoanRequestProcess implements ProcessContextInterface
{
// ...
/**
* The data class for loan requests
*
* @var LoanRequest
*/
private $loanRequest;
public function getProcessData()
{
return [
'rejected' => $this->loanRequest->rejected,
];
} This time the expression |
Thanks for the comprehensive reply! That's very similar to the solution I mentioned briefly, but I ended up going a different direction. Main reason being that the workflow design process for me is user-facing, so I want to reduce complexity where possible, and having part of the input form be generated based on the diagram itself without requiring conditionals seems like it would make things simpler. You can see my solution on my fork of the workflower bundle, where I've added a parameter to the I can see how this line of thought is incompatible with the bundle, so I won't be pushing this feature upstream. |
In trying to build this kind of workflow:
I was wondering if there's any way to push the workflow to the appropriate state, depending on which button the user pushes.
At first, I thought I could use
allocateWorkItem
,startWorkItem
andcompleteWorkItem
, as they accept anActivityInterface
parameter, but they also throw an exception when the passed activity is not the current flow object (why even have the parameter if it can only ever be one thing?)The only possible solution I can think of is to set the condition on each connecting object to just be the action, and use the
processData
to set the "next" step. This seems horrifically messy though, especially when actual conditions come into place (which I would use theExclusiveGateway
for)I'm not really certain how I would change workflow direction based on user input in a way that adheres to the BPMN standard either.
Thanks again.
The text was updated successfully, but these errors were encountered: