0

REST API 获取/发布请求问题我正在尝试使用带有 tomcat 的 activiti API 并使用邮递员来测试我的获取/发布请求,但我无法获取请求数据,例如显示所有任务、完成任务和其他。

这是我所做的

1. Put version 5.13 acitiviti-explorer.war and activiti-rest.war inside webapp in tomcat 7.0.42 
2. Startup tomcat 
3. go to http://localhost:8080/acitiviti-explorer
4. log in as username: kermit, pw: kermit
5. Tasks -> create a couple Tasks like 
    1. Task1
    2. Task2 
    3. Task3

6. Use chrome Postman - REST Client
7. setup postman 
    - Basic Auth: username: kermit, pw: kermit 
    - Header: Content-Type, Value: application/json

8. Input 
    URL: http://localhost:8080/activiti-rest/service/tasks
    select: GET

result: 
{
"errorMessage": "Tasks must be filtered with 'assignee', 'owner', 'involved', 'candidate'        or 'candidate-group'",
"statusCode": 400
}

From the User guild under REST API
List of tasks: GET runtime/tasks
URL: http://localhost:8080/activiti-rest/service/runtime/tasks
select: GET

result: 
{
    "data": [
{
"id": "101",
"url": "http://localhost:8080/activiti-rest/service/runtime/tasks/101",
"owner": null,
"assignee": "gonzo",
"delegationState": null,
"name": "enim Ut ut fugiat adipisicing in",
"description": "Duis do Ut anim do cupidatat aute dolore nisi et reprehenderit laborum ad      Excepteur dolore",
"createTime": "2013-10-15T19:42:17.352+0000",
"dueDate": null,
"priority": 50,
"suspended": false,
"taskDefinitionKey": null,
"parentTaskId": null,
"parentTaskUrl": null,
"executionId": null,
"executionUrl": null,
"processInstanceId": null,
"processInstanceUrl": null,
"processDefinitionId": null,
"processDefinitionUrl": null,
"variables": []
},
{
"id": "103",
"url": "http://localhost:8080/activiti-rest/service/runtime/tasks/103",
"owner": null,
"assignee": null,
"delegationState": null,
"name": "irure do adipisicing eiusmod veniam amet",
"description": "Ut minim Lorem elit officia laborum dolore consequat pariatur enim     adipisicing adipisicing quis amet aliquip",
"createTime": "2013-10-15T19:42:17.358+0000",
"dueDate": null,
"priority": 50,
"suspended": false,
"taskDefinitionKey": null,
"parentTaskId": null,
"parentTaskUrl": null,
"executionId": null,
"executionUrl": null,
"processInstanceId": null,
"processInstanceUrl": null,
"processDefinitionId": null,
"processDefinitionUrl": null,
"variables": []
},
..................
],
"total": 100,
"start": 0,
"sort": "id",
"order": "asc",
"size": 10
}

I have also tried a couple others as well but it's too long to post it all up
but ideally I would like get back all the information about 
Task1, Task2 and Task3 using the API. Also I notice that there are total of 100 Tasks 
from  Get URL: http://localhost:8080/activiti-rest/service/runtime/tasks in Postman 
where as only total of 3 tasks that we created, from 
http://localhost:8080/activiti-explorer/#database/ACT_RU_TASK or under tasks in the browser

我们还尝试启动假期请求流程并声明任务,但无法从其余 API 获取这些信息

我想知道我们是否使用了错误的 URL 或我们错过的其他进程

最后我们想使用 Ruby on rail 作为 activiti 的前端

如果需要更多信息,请告诉我非常感谢

4

2 回答 2

0

您正在尝试调用错误的 URL:

称呼

URL: http://localhost:8080/activiti-rest/service/runtime/tasks
select: GET

我已经对其进行了测试,并且效果很好。我得到所有任务的列表。

Activiti 5.13 还提供了一个单元测试,它在没有参数的情况下调用该 URL ( TaskCollectionResourceTest.testGetTasks:155)

于 2013-10-17T09:26:14.763 回答
0

我也一直在为类似的问题而苦苦挣扎,最后一个答案对我能够使用其余的 API 帮助很大,因为我同样使用了错误的查询 URL。我还安装了邮递员,虽然我可以在我的 activiti-explorer 收件箱中看到各种任务,但以下查询...

来自 REST API 下的用户公会任务列表:GET runtime/tasks

URL: http://myserver:8088/activiti-rest/service/runtime/tasks

选择:获取

结果是:

{
    "data": [],
    "total": 0,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 0
}

...好像那里没有任务。也许我弄错了,但是据我从手册中收集到的,没有必要在后台运行某些进程来使我能够使用其余查询来收集它们(我使用端口号 8088 而不是 8080 )。

于 2014-11-13T13:24:47.353 回答