As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
// Modify task instance URL url = new URL("http://alfrescoserver:8080/alfresco/service/api/task-instances/jbpm$60"); /* METHOD */ String method = "PUT"; HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod(method); // write auth header BASE64Encoder encoder = new BASE64Encoder(); String encodedCredential = encoder.encode((username + ":" + password).getBytes()); connection.setRequestProperty("Authorization", "BASIC " + encodedCredential); byte buffer[] = new byte[8192]; int read = 0; // write body if we're doing PUT String body = "{ \"bpm_description\": \"New Description\", \"bpm_priority\": 3 }"; connection.setDoOutput(true); OutputStream output = connection.getOutputStream(); output.write(body.getBytes()); connection.connect(); InputStream responseBodyStream = connection.getInputStream(); StringBuffer responseBody = new StringBuffer(); while ((read = responseBodyStream.read(buffer)) != -1) { responseBody.append(new String(buffer, 0, read)); } connection.disconnect(); System.out.print(responseBody); System.out.flush();