use of org.ow2.petals.components.flowable.generic._1.SuspendProcessInstancesResponse.ProcessInstanceIdentifier in project petals-se-flowable by petalslink.
the class SuspendProcessInstancesOperation method doExecute.
@Override
public SuspendProcessInstancesResponse doExecute(final SuspendProcessInstances incomingObject) throws Exception {
final SuspendProcessInstancesResponse response = new SuspendProcessInstancesResponse();
final List<ProcessInstanceIdentifier> results = response.getProcessInstanceIdentifier();
for (final String processInstanceId : incomingObject.getProcessInstanceIdentifier()) {
this.log.fine(String.format("Suspends process instance #%s.", processInstanceId));
final ProcessInstanceIdentifier result = new ProcessInstanceIdentifier();
result.setValue(processInstanceId);
results.add(result);
try {
this.runtimeService.suspendProcessInstanceById(processInstanceId);
result.setResult(AdjournmentResult.SUSPENDED);
} catch (@SuppressWarnings("squid:S1166") final FlowableObjectNotFoundException e) {
result.setResult(AdjournmentResult.NOT_FOUND);
} catch (@SuppressWarnings("squid:S1166") final FlowableException e) {
result.setResult(AdjournmentResult.ALREADY_SUSPENDED);
}
}
return response;
}
use of org.ow2.petals.components.flowable.generic._1.SuspendProcessInstancesResponse.ProcessInstanceIdentifier in project petals-se-flowable by petalslink.
the class ActivateProcessInstancesOperation method doExecute.
@Override
public ActivateProcessInstancesResponse doExecute(final ActivateProcessInstances incomingObject) throws Exception {
final ActivateProcessInstancesResponse response = new ActivateProcessInstancesResponse();
final List<ProcessInstanceIdentifier> results = response.getProcessInstanceIdentifier();
for (final String processInstanceId : incomingObject.getProcessInstanceIdentifier()) {
this.log.fine(String.format("Activates process instance #%s.", processInstanceId));
final ProcessInstanceIdentifier result = new ProcessInstanceIdentifier();
result.setValue(processInstanceId);
results.add(result);
try {
this.runtimeService.activateProcessInstanceById(processInstanceId);
result.setResult(ActivationResult.ACTIVATED);
} catch (@SuppressWarnings("squid:S1166") final FlowableObjectNotFoundException e) {
result.setResult(ActivationResult.NOT_FOUND);
} catch (@SuppressWarnings("squid:S1166") final FlowableException e) {
result.setResult(ActivationResult.ALREADY_ACTIVATED);
}
}
return response;
}
Aggregations