use of org.kie.kogito.process.ProcessInstanceDuplicatedException in project kogito-runtimes by kiegroup.
the class FileSystemProcessInstances method create.
@SuppressWarnings("unchecked")
@Override
public void create(String id, ProcessInstance instance) {
if (isActive(instance)) {
Path processInstanceStorage = Paths.get(storage.toString(), id);
if (Files.exists(processInstanceStorage)) {
throw new ProcessInstanceDuplicatedException(id);
}
storeProcessInstance(processInstanceStorage, instance);
}
}
use of org.kie.kogito.process.ProcessInstanceDuplicatedException in project kogito-runtimes by kiegroup.
the class BaseExceptionHandlerTest method testMapProcessInstanceDuplicatedException.
@Test
void testMapProcessInstanceDuplicatedException() {
Object response = tested.mapException(new ProcessInstanceDuplicatedException("processInstanceId"));
assertThat(response).isEqualTo(conflictResponse);
}
Aggregations