I have defined ticket Statuses, and linked to them are allowed Status Transitions (so for example, a ticket 'In Progress' can go to 'On Hold' or 'Resolved', but not back to 'New' status). I'm trying to find a way to restrict the next status selection to these allowed status transitions. I have tried using a button/microflow to open a dialog form of the current status, with a datagrid showing the allowed transitions. This displays the correct allowed statuses to change to. However, I can find no way of passing the selected value back to the ticket form so I can update the ticket status to the value selected. I guess I'm approaching this the wrong way - can anyone suggest a method I can use to display and capture the next Status selected? Follow-up after Response:--------------------------------- I need to pass the Status to the pop-up - I don't see how I can also pass the Incident ticket See this image: Image of Microflows Follow-up again----------------------------------------------- I set up a new form with Incident data view, embedded Status data view, and embedded data grid for allowed transitions as shown. See image: New popup form I still can't seem to reference the Incident to update from the microflow on the data grid of transition values. Is this the sort of object you were suggesting? The only way that I can think of progressing is to write the identifier of the Incident to be updated to a temp form using a guid, then try to retrieve that information from my microflow on the Select button so I can update the correct Incident - but again I have the problem that I cannot pass the guid to the select transition datagrid. I really think I need functionality to be able to return a result value from a modal popup form to the calling microflow. For example - how can I ask a user for confirmation of an action? Or say I have a Configuration Item template, and I want to allow the user to input how many new CIs to create based on this template - how do I get that user input number returned to my microflow? I do not want to store that value anywhere - it is just a variable that I need to get from the user and return to the microflow.
Hi David, Andrew,
We are working on a generic Workflow (i.e. state machine) solution that allows a StateObject to undergo a Transition from one State to another. The Workflow including the associated States and Transitions are defined at runtime. For each Transition, you can specify the user roles that are allowed to execute it, as well as 1 or more validating Microflows. Included is a generic TransactionLog object and form that records the State Transition (for auditing purposes). This form only lets you select allowed and validated Transitions and optionally displays a message explaining the reason why you don't see all possible Transitions.
We're planning on making this solution available in the Mendix AppStore soon. Please let me know if you're interested.
follow up response:
My solution would be to create a form with a dataview of of the Incidentent, with an inner dataview in which you select the status. So you pass the incident to the form, in stead of the status.
I have an application with a similar requirement. The approach I have used is not to allow the statuses to be updated on the form, but to use a custom button to call a microflow to update the status. The status attribute is only ever displayed as read-only in a data view form.
So, for instance I have a datagrid to display all tickets. In the control bar I have added custom buttons to update the status ... the relevant microwflow can then check on the current status of the selected record before it updates it, and display an error message if it is not a valid status ...
You might pass the ticket to the status selector, and then update the ticket status when closing the form. If the status is defined as domain object in your domain model (e.g, not an enum) than it is possible to return the selected status as well. Returning primitive values is not possible.