Answer the question
In order to leave comments, you need to log in
How to model a step-by-step business process in an application?
There is a project that is conditionally similar to any taxi application. Mobile app, the client orders something for a certain date and address, the order is accepted by one of the “cars”, went to the client, will be in 5 minutes, arrived, the trip began, we stopped at point N on the way, ended, paid. Some characteristic steps in business logic.
The logic can branch: if state A is now, then after it there can be states either B or D, and no other. After B can be C, after C - D. It looks like a graph.
Question: what is the best way to store and process such logic in the backend and mobile application? What is the best practice for such a scenario?
Will the business logic need to be duplicated in backend + mobile, or can it be kept in one place?
Now in the prototype, right in the code, text labels are written for each possible state, and the conditions from which state are the next possible ones. In the database table we write the next state of the object with the date-time. To find out the current state of an object, select the most recent one.
The mobile client requests a "matrix" of states and possible transitions between them from the backend.
To change the logic, for example, to insert a new step into the process, you need to rewrite the code. And ideally, probably, all this should be driven only by data in the database?
Maybe you have encountered a similar scenario in your projects - tell us how you solved it.
Answer the question
In order to leave comments, you need to log in
In a good way, you need an engine for modeling and controlling business processes. Considering their versioning. In Java, I once used Alfresco Activity ( https://www.alfresco.com/products/business-process... ). There is a community edition. .NET has WWF ( https://msdn.microsoft.com/en-us/library/jj684582.aspx ) but I haven't used it myself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question