Java 使用 Spring 实现工作流
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24775592/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Implementing workflow using Spring
提问by Pramod Karandikar
We are working on a Spring based web based application where we need to implement workflow. This is how a sample scenario looks like:
我们正在开发基于 Spring 的基于 Web 的应用程序,我们需要在其中实现工作流。这是示例场景的样子:
- User fills in the registration form. This request is stored in the database and an admin will be notified.
- Admin will approve this request and only then this request will actually be processed and can be taken further.
- There can be one or more than one admins who need to approve the requests based on the type of the activity.
- There will be hierarchies assigned to different roles.
- Only the admin can view the options to approve or reject requests. Not everyone. In general, there will be user-type specific activities.
- 用户填写注册表。此请求存储在数据库中,管理员将收到通知。
- 管理员将批准此请求,然后才会实际处理此请求并可以进一步处理。
- 根据活动的类型,可能有一名或多名管理员需要批准请求。
- 将有分配给不同角色的层次结构。
- 只有管理员可以查看批准或拒绝请求的选项。不是每个人。一般来说,会有用户类型的特定活动。
One way is to design the workflow based on database entries. Each user may be assigned one/more roles and workflow will involve these users.
Is there anything Spring offers that will suite my requirement? I have gone through thisand thisSpring documentation but could not understand fully.
一种方法是根据数据库条目设计工作流。每个用户可能被分配一个/多个角色,工作流程将涉及这些用户。
Spring 提供的任何东西都可以满足我的要求吗?我已经阅读了这个和这个Spring 文档,但无法完全理解。
采纳答案by Kuntal-G
Please go through the below tutorial.If you still required more help,i will share my code piece.As i have worked on Spring workflow project couple of months ago.My Project was similar to your requirement.
请阅读下面的教程。如果您仍然需要更多帮助,我将分享我的代码片段。因为我几个月前在 Spring 工作流项目中工作过。我的项目与您的要求相似。
http://www.studytrails.com/frameworks/spring/spring-web-flow.jsp
http://www.studytrails.com/frameworks/spring/spring-web-flow.jsp
回答by Marco Luly
Spring announced a new project: Spring Statemachine
Spring 宣布了一个新项目:Spring Statemachine
回答by Ajey Dudhe
https://github.com/ajeydudhe/workflow-liteimplements workflow using spring beans and spring expression language. This implementation is light weight and avoid the need to pass the data to activities through context object. You can directly inject the required data using spring expression language.
https://github.com/ajeydudhe/workflow-lite使用 spring bean 和 spring 表达式语言实现工作流。这种实现是轻量级的,并且不需要通过上下文对象将数据传递给活动。您可以使用 spring 表达式语言直接注入所需的数据。