【问题标题】:Springboot REST endpoints with Alfresco Process Services (Activiti)带有 Alfresco Process Services (Activiti) 的 Springboot REST 端点
【发布时间】:2019-10-21 02:22:25
【问题描述】:

我已经在我的本地机器上安装了 Alfresco Process Services。我还创建了一个 springboot 项目来编写自定义侦听器,例如任务侦听器或执行侦听器。这些听众工作正常。 我创建一个 jar 文件并将其放入 webapp\activiti-app\WEB-INF\lib 文件夹中。

现在我想在我的应用程序中添加 REST 端点,以便外部用户可以直接对任务执行操作。

我在具有 main 方法的主应用程序类旁边添加了以下类。

@RestController
@RequestMapping("/api2")
public class WorkflowController {

@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", defaultValue="World") String name) {
    return  "Hello from " +name;
 }
}

问题是当我尝试通过以下任何 URL 访问端点时,它给了我 404 错误。

http://localhost:8081/activiti-app/api2/greeting 
OR
http://localhost:8081/api2/greeting

请帮忙

【问题讨论】:

    标签: spring-boot activiti spring-restcontroller spring-rest


    【解决方案1】:

    要公开访问 URL,您需要使用 /enterprise 开始映射。 APS 要求它来区分公共和私有 rest API,因此您的 @RequestMapping("/api2") 应该是 @RequestMapping("/enterprise/api2"),然后应该可以使用 http://localhost:8081/activiti-app/api/enterprise/api2/greeting 访问。请参阅developer series 了解详细示例。

    【讨论】:

    • 有什么方法可以在不登录的情况下完成任务?我的意思是点击电子邮件中的按钮?
    • 否,但您可以将用户重定向到他的任务,登录后他将能够完成它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-14
    相关资源
    最近更新 更多