Skip to content

Commit

Permalink
Increased DB id size + added REST API create process instance respons…
Browse files Browse the repository at this point in the history
…e test
  • Loading branch information
tijsrademakers committed Apr 7, 2014
1 parent 36f4457 commit 47bac4f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public abstract class ProcessEngineConfiguration implements EngineServices {
public static final String NO_TENANT_ID = "";

protected String processEngineName = ProcessEngines.NAME_DEFAULT;
protected int idBlockSize = 100;
protected int idBlockSize = 2500;
protected String history = HistoryLevel.AUDIT.getKey();
protected boolean jobExecutorActivate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
import org.activiti.rest.service.api.engine.variable.LongRestVariableConverter;
import org.activiti.rest.service.api.engine.variable.QueryVariable;
import org.activiti.rest.service.api.engine.variable.RestVariable;
import org.activiti.rest.service.api.engine.variable.RestVariable.RestVariableScope;
import org.activiti.rest.service.api.engine.variable.RestVariableConverter;
import org.activiti.rest.service.api.engine.variable.ShortRestVariableConverter;
import org.activiti.rest.service.api.engine.variable.StringRestVariableConverter;
import org.activiti.rest.service.api.engine.variable.RestVariable.RestVariableScope;
import org.activiti.rest.service.api.form.FormDataResponse;
import org.activiti.rest.service.api.form.RestEnumFormProperty;
import org.activiti.rest.service.api.form.RestFormProperty;
Expand All @@ -79,10 +79,10 @@
import org.activiti.rest.service.api.management.JobResponse;
import org.activiti.rest.service.api.management.TableResponse;
import org.activiti.rest.service.api.repository.DeploymentResourceResponse;
import org.activiti.rest.service.api.repository.DeploymentResourceResponse.DeploymentResourceType;
import org.activiti.rest.service.api.repository.DeploymentResponse;
import org.activiti.rest.service.api.repository.ModelResponse;
import org.activiti.rest.service.api.repository.ProcessDefinitionResponse;
import org.activiti.rest.service.api.repository.DeploymentResourceResponse.DeploymentResourceType;
import org.activiti.rest.service.api.runtime.process.ExecutionResponse;
import org.activiti.rest.service.api.runtime.process.ProcessInstanceResponse;
import org.activiti.rest.service.api.runtime.task.TaskResponse;
Expand Down Expand Up @@ -430,6 +430,7 @@ public ProcessInstanceResponse createProcessInstanceResponse(SecuredResource sec
result.setId(processInstance.getId());
result.setProcessDefinitionId(processInstance.getProcessDefinitionId());
result.setProcessDefinitionUrl(securedResource.createFullResourceUrl(RestUrls.URL_PROCESS_DEFINITION, processInstance.getProcessDefinitionId()));
result.setEnded(processInstance.isEnded());
result.setSuspended(processInstance.isSuspended());
result.setUrl(securedResource.createFullResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId()));
result.setTenantId(processInstance.getTenantId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected ProcessInstanceResponse suspendProcessInstance(ProcessInstance process
}
ActivitiUtil.getRuntimeService().suspendProcessInstanceById(processInstance.getId());

ProcessInstanceResponse response = getApplication(ActivitiRestServicesApplication.class).getRestResponseFactory()
ProcessInstanceResponse response = getApplication(ActivitiRestServicesApplication.class).getRestResponseFactory()
.createProcessInstanceResponse(this, processInstance);

// No need to re-fetch the instance, just alter the suspended state of the result-object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ProcessInstanceResponse {
protected String url;
protected String businessKey;
protected boolean suspended;
protected boolean ended;
protected String processDefinitionId;
protected String processDefinitionUrl;
protected String activityId;
Expand Down Expand Up @@ -64,6 +65,14 @@ public void setSuspended(boolean suspended) {
this.suspended = suspended;
}

public boolean isEnded() {
return ended;
}

public void setEnded(boolean ended) {
this.ended = ended;
}

public String getProcessDefinitionId() {
return processDefinitionId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ public void testStartProcessWithVariables() throws Exception {

client.post(requestNode);
assertEquals(Status.SUCCESS_CREATED, client.getResponse().getStatus());

JsonNode responseNode = objectMapper.readTree(client.getResponseEntity().getStream());
assertEquals("processTask", responseNode.get("activityId").asText());
assertEquals(false, responseNode.get("ended").asBoolean());

ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
assertNotNull(processInstance);

Expand Down

0 comments on commit 47bac4f

Please sign in to comment.