cancel
Showing results for 
Search instead for 
Did you mean: 

[REST API] Add url to a task

luca_trioschi
Champ in-the-making
Champ in-the-making
Hello everybody,
maybe i'm asking a stupid question, but i cannot find the solution to my problem…

I have to attach an URL to a task of mine (taskId = 13780).
I followed http://activiti.org/userguide/#N12BF1 and i made the request:

url :
http://my_server_ip/activiti-rest/service/task/13780/url
method:
PUT
content:
{"name":"Google","description":"Good search site","url":"http://www.google.com','type':'url"}

The result code was 200 with content
{"name":"Google","id":"13862","type":"url","description":"Good search site","url":"http://www.google.com"}

but when i go to see my task's attachments i can see nothing!
I'm sure about the task's ID and tomcat's log reports no errors.

Where am I wrong?

Thanks in advance.
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
Can't see anything wrong with that. Did you check the database contents?

luca_trioschi
Champ in-the-making
Champ in-the-making
Hi jbarrez, thank you for your answer.

Sure I did…all attachments are there. In the table "ACT_HI_ATTACHMENT" the tuple is correctly stored but in my task I still see nothing.
There also one more question i'd like to ask…is possible to attach a document/url to a process instance (not to a task as i was doing) via REST API?
Is also there an API to get the attachment stream from its ID (i added a a PDF file as content to the process instance via activiti-explorer…is there a way to get the file via REST API having the attachment ID) ?

jbarrez
Star Contributor
Star Contributor
Sure I did…all attachments are there. In the table "ACT_HI_ATTACHMENT" the tuple is correctly stored but in my task I still see nothing.

How do you try to retrieve the attachment? Did you already try the Java api?

There also one more question i'd like to ask…is possible to attach a document/url to a process instance (not to a task as i was doing) via REST API?
Is also there an API to get the attachment stream from its ID (i added a a PDF file as content to the process instance via activiti-explorer…is there a way to get the file via REST API having the attachment ID) ?

I'm afraid the REST API is not yet in sync with the Java API. Therefore, I created http://jira.codehaus.org/browse/ACT-1396.

luca_trioschi
Champ in-the-making
Champ in-the-making
Thank you again, jbarrez.

How do you try to retrieve the attachment? Did you already try the Java api?
I tryed to retrieve the attachments list with the REST API (http://activiti.org/userguide/#N12B3B) but "attachmentList" is empty. Also looking for them in the activiti-explorer I can see no one of them.
I have not used the Java API because activiti stands on a virtual machine and I have to handle the workflow from a web application standing on a different virtual machine, so the REST API are the best way to archieve this (I think). I Know i can make my own APIs and call them for my purpose, but I prefer to have this as "plan B" (or even better "plan C" Smiley Wink ).

I'm afraid the REST API is not yet in sync with the Java API. Therefore, I created http://jira.codehaus.org/browse/ACT-1396.
Thank you for creating this thread.

jbarrez
Star Contributor
Star Contributor
Okay, that does sound like a bug then .. could you create a jira issue for it describing exactly how you test it?