<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot complete a task using REST API (Activiti 5.14) in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167349#M120877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Be aware that the Explorer and REST applications each have their own classpath. Did you make the service task class available on the REST application classpath as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Mar 2014 07:05:38 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2014-03-01T07:05:38Z</dc:date>
    <item>
      <title>Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167345#M120873</link>
      <description>I have created a process definition in Activiti (5.14) which is made up of a mixture of user and service tasks.&amp;nbsp; I have created two versions, in one version the user tasks have forms so they can be run in Activiti Explorer.&amp;nbsp; In the second version the user tasks do not have forms so everything needs</description>
      <pubDate>Thu, 27 Feb 2014 13:26:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167345#M120873</guid>
      <dc:creator>obdurate</dc:creator>
      <dc:date>2014-02-27T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167346#M120874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't recognise the REST URL you are using to complete a task. The user guide describes a POST to the task with a payload containing the action here: &lt;/SPAN&gt;&lt;A href="http://activiti.org/userguide/index.html#N1444D" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#N1444D&lt;/A&gt;&lt;SPAN&gt;. Furthermore the PUT semantic is supposed to create / change a resource so it would be a bit unusual to use that to take away (complete) a task IMHO. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 08:41:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167346#M120874</guid>
      <dc:creator>tstephen</dc:creator>
      <dc:date>2014-02-28T08:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167347#M120875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp; I found the put example here: &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/content/rest-api-complete-task-variable" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/rest-api-complete-task-variable&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; I suspect it was part of the old REST api but I could be wrong.&amp;nbsp; I also tried to submit the call per the current documentation.&amp;nbsp; Here is another example (using variables this time):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Request:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Post to: &lt;/SPAN&gt;&lt;A href="http://kermit:kermit@localhost:8080/activiti-rest/service/runtime/tasks/1183" rel="nofollow noopener noreferrer"&gt;http://kermit:kermit@localhost:8080/activiti-rest/service/runtime/tasks/1183&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Payload:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "action":"complete",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "variables": [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name":"numbertosquare",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "value":"4"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Response:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;errorMessage: "Not Found"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;statusCode: 404&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the variable name to something else (say the form field name) it gives me a 500 error so I know something is happening with the correct variable specified.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know the task is there because a get call to &lt;/SPAN&gt;&lt;A href="http://kermit:kermit@localhost:8080/activiti-rest/service/runtime/tasks/1183" rel="nofollow noopener noreferrer"&gt;http://kermit:kermit@localhost:8080/activiti-rest/service/runtime/tasks/1183&lt;/A&gt;&lt;SPAN&gt; returns data:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;id: "1183"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;url: "&lt;/SPAN&gt;&lt;A href="http://localhost:8080/activiti-rest/service/runtime/tasks/1183" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/activiti-rest/service/runtime/tasks/1183&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;owner: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;assignee: "kermit"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delegationState: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;name: "Enter First Number"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;description: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A co worker has gotten this call to work with a much simpler workflow so my next step is to create a very simple workflow with one user task and try to use the REST API to complete it.&amp;nbsp; If that works I will start adding tasks back in until it breaks (or doesn't).&amp;nbsp; I will post my results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 14:17:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167347#M120875</guid>
      <dc:creator>obdurate</dc:creator>
      <dc:date>2014-02-28T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167348#M120876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK.&amp;nbsp; We found the issue.&amp;nbsp; Our process has a user task which calls a service task.&amp;nbsp; The user task asks for a number.&amp;nbsp; That number is then squared by the service task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our service task then calls a REST Service to square the number.&amp;nbsp; This all works fine in Activiti Explorer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If we use the Activiti REST API to call our process and our process itself makes a REST call this error occurs when invoking the Activiti REST API to complete the user task than then calls the service task.&amp;nbsp; When I remove the rest call from the class that the service task calls and simply square the number using the Math library in JAVA it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is as far as I've gotten.&amp;nbsp; I will write a proper unit test and post it to these forums at a later date to see if I can narrow down the problem further.&amp;nbsp; For now I will make a note that I am unable to use the REST API to complete a user task that calls a service task that itself makes a REST call.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this doesn't make sense please let me know. Thanks. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 16:05:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167348#M120876</guid>
      <dc:creator>obdurate</dc:creator>
      <dc:date>2014-02-28T16:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167349#M120877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Be aware that the Explorer and REST applications each have their own classpath. Did you make the service task class available on the REST application classpath as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Mar 2014 07:05:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167349#M120877</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-03-01T07:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167350#M120878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp; The classpath isn't the issue.&amp;nbsp; After some testing we determined that it was the rest library that the java service task was using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So our application looks like this (simplified) User Task with From (Enter a number) - Service Task (Square the Number) - …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The service task that squares the number makes its own REST call to a page that does the work of squaring the number.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using the org.restlet libraries in the Java Service Task we received the error detailed in my previous posts if we called the process instance using the Activiti REST APIS (via JavaScript). We did not see an issue using our unit tests in eclipse or when using Activiti Explorer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When we switched to the org.apache.http.client libraries to make our rest call from the Java Service task it works fine whether we call the process-instance from a unit test, from Activiti explorer, or from Activiti Rest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it appears that if we design a java service process that uses the org.restlet libraries to make a rest call, and then call the Activiti REST API to invoke the process instance that uses the java service process we get that error.&amp;nbsp; If we use the org.apache.http.client.fluent libraries in our Java Service Task we do not have the same problem and everything works fine using Activiti Explorer, Activiti Rest via whatever (Html/Javascript in our case), Unit Tests in Eclipse, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for taking the time to offer suggestions.&amp;nbsp; It is appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 14:19:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167350#M120878</guid>
      <dc:creator>obdurate</dc:creator>
      <dc:date>2014-03-03T14:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167351#M120879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for posting this back, this is good information (and a bit frightening that restlet doesn't do a good job there!)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 10:21:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167351#M120879</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-03-10T10:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167352#M120880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi jbarrez,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to support passing nest variables in restlet client ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried lots of way to test it, but no one can successful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String fullUri = "&lt;/SPAN&gt;&lt;A href="http://localhost:8080/activitirestservice/service/runtime/tasks/2520" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/activitirestservice/service/runtime/tasks/2520&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//the first way&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String jsonString ="{\"action\":\"complete\", \"variables\": {\"name\":\"hrPass\",\"value\": true}}";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;getClientResource(fullUri).post(jsonString, MediaType.APPLICATION_JSON);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//This way will throw an exception like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unprocessable Entity (422) - Unprocessable Entity&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//The second way&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.codehaus.jackson.map.ObjectMapper objectMapper = new ObjectMapper();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.codehaus.jackson.node.ObjectNode requestNode = objectMapper.createObjectNode();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;requestNode.put("action", "complete");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ObjectNode node2 = objectMapper.createObjectNode();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node2.put("name", "hrPass");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node2.put("value", true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;requestNode.put("variables", node2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//This way will throw an exception like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.codehaus.jackson.JsonParseException: Unexpected end-of-String when base64 content&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at [Source: N/A; line: -1, column: -1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you help me and show a demo for this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;protected static ClientResource getClientResource(String uri) throws IOException{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ClientResource clientResource = new ClientResource(uri);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; clientResource.setReference(uri);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return clientResource;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 12:58:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167352#M120880</guid>
      <dc:creator>youtianhong</dc:creator>
      <dc:date>2015-07-13T12:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167353#M120881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@youtianhong , &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you need a JSON string which should be unmarshalled as an TaskActionRequest java object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so you could use it like that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; TaskActionRequest actionRequest = new TaskActionRequest();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;….&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String jsonString&amp;nbsp; = objectMapper.writeValueAsString(actionRequest)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;….&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// post this jsonString&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now compare your string with the one generated by the "writeValueAsString" method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 13:36:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167353#M120881</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-07-13T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167354#M120882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot&amp;nbsp; vasile for your response !&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did it like your mentioned, but still has a new exception threw:&amp;nbsp; ResourceException -&amp;gt; Unsupported Media Type (415) - Unsupported Media Type&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Was there any missed for me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TaskActionRequest actionRequest = new TaskActionRequest();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;RestVariable&amp;gt; variables = new ArrayList&amp;lt;RestVariable&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RestVariable variable = new RestVariable();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; variable.setName("hrPass");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; variable.setValue(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; variables.add(variable);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; actionRequest.setVariables(variables);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; actionRequest.setAction("complete");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String jsonString = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; jsonString = objectMapper.writeValueAsString(actionRequest);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I can see jsonString&amp;nbsp; was be generated successfully&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; System.out.println("jsonString="+jsonString);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; } catch (JsonGenerationException e1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; e1.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; } catch (JsonMappingException e1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; e1.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; } catch (IOException e1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; e1.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String fullUri = "&lt;/SPAN&gt;&lt;A href="http://localhost:8080/activitirestservice/service/runtime/tasks/2520" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/activitirestservice/service/runtime/tasks/2520&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; getClientResource(fullUri).post(jsonString, MediaType.APPLICATION_JSON);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; System.out.println("yes…");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; } catch (ResourceException e) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; System.out.println(e.getMessage());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //here threw an exception : Unsupported Media Type (415) - Unsupported Media Type&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; } catch (IOException e) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; System.out.println(e.getMessage());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The jsonString was generated successfully like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{"action":"complete","assignee":null,"variables":[{"name":"hrPass","type":null,"variableScope":null,"value":true,"valueUrl":null,"scope":null}]}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 02:04:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167354#M120882</guid>
      <dc:creator>youtianhong</dc:creator>
      <dc:date>2015-07-14T02:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167355#M120883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;415 =&amp;gt; Unsupported Media Type&amp;nbsp;&amp;nbsp; ( server doesn’t support that content type)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you send 'Accept' and 'Content-Type' headers with your request? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Accept': 'application/json'&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Content-Type': 'application/json'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:22:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167355#M120883</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-07-14T07:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot complete a task using REST API (Activiti 5.14)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167356#M120884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Much Thanks vasile!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did it successfully when I passed the object TaskActionRequest directlly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;post request object directlly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;No need to&amp;nbsp; "objectMapper.writeValueAsString".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 14:01:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-complete-a-task-using-rest-api-activiti-5-14/m-p/167356#M120884</guid>
      <dc:creator>youtianhong</dc:creator>
      <dc:date>2015-07-14T14:01:09Z</dc:date>
    </item>
  </channel>
</rss>

