I'm building a web application which has some processing of user requests involved. A user submits request for something, it goes through few steps and channels and its status changes through some predefined statuses, in the organization before being approved or rejected. During processing the ball may roll back to the user's court for some changes or to update some information.
我正在构建一个Web应用程序,它涉及一些用户请求处理。用户提交某项请求,在批准或拒绝之前,它会在组织中通过一些预定义的状态进行一些步骤和渠道更改。在处理过程中,球可以回滚到用户的场地进行一些更改或更新一些信息。
The client wants to user workflow to control the processing. Please let help me decide how I can integrate it with the application. Should I start new workflow instance whenever a new request comes, return the next state and possible actions that processing person can take and close the workflow?
客户希望用户工作流程来控制处理。请帮我决定如何将其与应用程序集成。我是否应该在新请求到来时启动新的工作流实例,返回下一个状态以及处理人员可以采取的可能操作并关闭工作流程?
Or some other approach will be better?
或者其他一些方法会更好?
2 个解决方案
#1
You definitely want to start a new workflow instance for every user request. It is this workflow that controls the life of your users requests.
您肯定希望为每个用户请求启动一个新的工作流实例。正是此工作流程控制着用户请求的生命周期。
Have a look at K. Scott Allen's Orders Workflow on Ode To Code for a full working example of a website that handles "orders" through a state machine workflow. The workflow code is nicely separated from the web layer.
请查看K. Scott Allen在Ode To Code上的订单工作流程,以获取通过状态机工作流程处理“订单”的网站的完整工作示例。工作流代码与Web层很好地分离。
#1
You definitely want to start a new workflow instance for every user request. It is this workflow that controls the life of your users requests.
您肯定希望为每个用户请求启动一个新的工作流实例。正是此工作流程控制着用户请求的生命周期。
Have a look at K. Scott Allen's Orders Workflow on Ode To Code for a full working example of a website that handles "orders" through a state machine workflow. The workflow code is nicely separated from the web layer.
请查看K. Scott Allen在Ode To Code上的订单工作流程,以获取通过状态机工作流程处理“订单”的网站的完整工作示例。工作流代码与Web层很好地分离。
#2
You could maybe look at the Web Workflow examples?
您可以查看Web Workflow示例吗?