}
public boolean isWorkflowInstanceExists(String instanceId, boolean createIfNotPresent) {
webResource = getProvenanceRegistryBaseResource().path(
ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CREATE);
MultivaluedMap formParams = new MultivaluedMapImpl();
formParams.add("instanceId", instanceId);
formParams.add("createIfNotPresent", String.valueOf(createIfNotPresent));
builder = BasicAuthHeaderUtil.getBuilder(
webResource, null, userName, null, cookie, gateway);
ClientResponse response = builder.accept(
MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);