<?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 Start a process instance using REST in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-using-rest/m-p/38808#M16329</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have Springboot app that talks to Alfresco Enterprise Activiti using REST calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to start the process instance using REST call but I am getting 400 bed request. however the same request works with postman.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #000000; background-color: #ffffff; font-size: 10.2pt;"&gt;String &lt;SPAN style="font-weight: bold;"&gt;url &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:9091/activiti-app/api/enterprise/process-instances" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:9091/activiti-app/api/enterprise/process-instances&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;BR /&gt;RestTemplate &lt;SPAN style="font-weight: bold;"&gt;restTemplate &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;RestTemplate();&lt;BR /&gt;&lt;SPAN style="font-weight: bold;"&gt;restTemplate&lt;/SPAN&gt;.getInterceptors().add(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;BasicAuthorizationInterceptor(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:admin@app.activiti.com" rel="nofollow noopener noreferrer"&gt;admin@app.activiti.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"admin"&lt;/SPAN&gt;));&lt;BR /&gt;HttpHeaders &lt;SPAN style="font-weight: bold;"&gt;headers &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;HttpHeaders();&lt;BR /&gt;headers.setContentType(org.springframework.http.MediaType.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;APPLICATION_JSON&lt;/SPAN&gt;);&lt;BR /&gt;HttpEntity&amp;lt;String&amp;gt; &lt;SPAN style="font-weight: bold;"&gt;entity &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;HttpEntity&amp;lt;String&amp;gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"parameters"&lt;/SPAN&gt;, &lt;SPAN style="font-weight: bold;"&gt;headers&lt;/SPAN&gt;);&lt;BR /&gt;&lt;PRE style="font-size: 10.2pt;"&gt;CreateProcessInstanceRepresentation &lt;SPAN style="font-weight: bold;"&gt;cpir &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;CreateProcessInstanceRepresentation ();&lt;BR /&gt;&lt;SPAN style="font-weight: bold;"&gt;cpir&lt;/SPAN&gt;.setName(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"ClientReview"&lt;/SPAN&gt;);&lt;SPAN style="color: #808080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold;"&gt;cpir&lt;/SPAN&gt;.setProcessDefinitionId(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"ClientReview:7:15103"&lt;/SPAN&gt;);&lt;BR /&gt;ObjectMapper &lt;SPAN style="font-weight: bold;"&gt;mapper &lt;/SPAN&gt;= &lt;SPAN style="font-weight: bold;"&gt;mapper &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ObjectMapper().configure(DeserializationFeature.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;FAIL_ON_UNKNOWN_PROPERTIES&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);&lt;BR /&gt;mapper.setSerializationInclusion(&lt;SPAN style="color: #808000;"&gt;JsonInclude&lt;/SPAN&gt;.Include.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;NON_NULL&lt;/SPAN&gt;);&lt;BR /&gt;json = &lt;SPAN style="font-weight: bold;"&gt;mapper&lt;/SPAN&gt;.writeValueAsString(&lt;SPAN style="font-weight: bold;"&gt;cpir&lt;/SPAN&gt;);&lt;BR /&gt;JsonNode &lt;SPAN style="font-weight: bold;"&gt;jsonNode &lt;/SPAN&gt;= &lt;SPAN style="font-weight: bold;"&gt;mapper&lt;/SPAN&gt;.readTree(&lt;SPAN style="font-weight: bold;"&gt;json&lt;/SPAN&gt;);&lt;BR /&gt;&lt;PRE style="background-color: #ffffff; font-size: 10.2pt;"&gt;&lt;BR /&gt;&lt;PRE style="font-size: 10.2pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;restTemplate&lt;/SPAN&gt;.exchange(&lt;SPAN style="font-weight: bold;"&gt;url&lt;/SPAN&gt;, HttpMethod.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;POST&lt;/SPAN&gt;, &lt;SPAN style="font-weight: bold;"&gt;entity&lt;/SPAN&gt;, Object.&lt;SPAN style="color: #000080; font-weight: bold;"&gt;class&lt;/SPAN&gt;, &lt;SPAN style="font-weight: bold;"&gt;jsonNode&lt;/SPAN&gt;); // &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Throws 400 Bad Request&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;BR /&gt;Please help..&lt;BR /&gt;Thank you in advance...&lt;/PRE&gt;&lt;PRE style="background-color: #ffffff; font-size: 10.2pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jul 2017 15:10:31 GMT</pubDate>
    <dc:creator>signjoy</dc:creator>
    <dc:date>2017-07-25T15:10:31Z</dc:date>
    <item>
      <title>Start a process instance using REST</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-using-rest/m-p/38808#M16329</link>
      <description>I have Springboot app that talks to Alfresco Enterprise Activiti using REST calls.I want to start the process instance using REST call but I am getting 400 bed request. however the same request works with postman.String url = "http://localhost:9091/activiti-app/api/enterprise/process-instances";Rest</description>
      <pubDate>Tue, 25 Jul 2017 15:10:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-using-rest/m-p/38808#M16329</guid>
      <dc:creator>signjoy</dc:creator>
      <dc:date>2017-07-25T15:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Start a process instance using REST</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-using-rest/m-p/38809#M16330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find below some working code snippet for the starting of Activiti Process instance using REST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;String urlString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:8080/activiti-app/api/enterprise/process-instances" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:8080/activiti-app/api/enterprise/process-instances&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; String propertiesJson &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//If you have any form fields to start the form&lt;/SPAN&gt;&lt;BR /&gt;PostMethod mPost &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; HttpClient client &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;HttpClient&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; mPost &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PostMethod&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;urlString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;BR /&gt; String encoding &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Base64&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getEncoder&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;encodeToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:admin@app.activiti.com" rel="nofollow noopener noreferrer"&gt;admin@app.activiti.com&lt;/A&gt;&lt;SPAN&gt;:admin"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getBytes&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; mPost&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setRequestHeader&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Authorization"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Basic "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; encoding&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; mPost&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setRequestHeader&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Content-Type"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; mPost&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setRequestEntity&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ByteArrayRequestEntity&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;propertiesJson&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getBytes&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; statusCode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; client&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;executeMethod&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mPost&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;out&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;println&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Response Code:::"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;statusCode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Imports:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;apache&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;commons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;httpclient&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;HttpClient&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; java&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;util&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Base64&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;apache&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;commons&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;httpclient&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;methods&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PostMethod&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:48:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-a-process-instance-using-rest/m-p/38809#M16330</guid>
      <dc:creator>naveenv449</dc:creator>
      <dc:date>2017-07-26T15:48:18Z</dc:date>
    </item>
  </channel>
</rss>

