AnsweredAssumed Answered

Unable to deploy the bpmn file using activiti rest api post

Question asked by jaikrishna on Oct 3, 2015
Latest reply on May 10, 2016 by paravena
Hi ,

I have been trying to deploy the file through activiti rest api post ..
But I am not able to do it ..
Please help me ..
I have attached the code ..

public class repo
{   
private static String REST_URI = "http://localhost:8080/activiti-rest/service/repository";

private static ClientResource getClientResource(String uri)
{
ClientResource resource = new ClientResource(uri);
resource.setChallengeResponse(ChallengeScheme.HTTP_BASIC,"kermit", "kermit");
return resource;
}

public static void postDeployments() throws JSONException,IOException {   



String postdeploymnet = REST_URI+"/deployments";






Path path = Paths.get(".\\src\\main\\resources\\diagrams\\SimpleLeaveProcess.bpmn");
String name = "SimpleLeaveProcess.bpmn";
String originalFileName = "SimpleLeaveProcess.bpmn";
String contentType = "";
byte[] content = null;
try {
content = Files.readAllBytes(path);
} catch (final IOException e) {
}
MultipartFile result = new MockMultipartFile(name,originalFileName, contentType, content);


Representation response1 = getClientResource(postdeploymnet).post(result, MediaType.MULTIPART_FORM_DATA);
}
}

Attachments

Outcomes