use of org.activiti.api.runtime.model.impl.BPMNErrorImpl in project Activiti by Activiti.
the class ToErrorReceivedConverterTest method fromShouldReturnConvertedEventAndSetProcessInstanceIdAndProcessDefinitionId.
@Test
public void fromShouldReturnConvertedEventAndSetProcessInstanceIdAndProcessDefinitionId() {
// given
ActivitiErrorEvent internalEvent = mock(ActivitiErrorEvent.class);
given(internalEvent.getProcessDefinitionId()).willReturn("procDefId");
given(internalEvent.getProcessInstanceId()).willReturn("procInstId");
BPMNErrorImpl bpmnError = new BPMNErrorImpl("myError");
given(bpmnErrorConverter.convertToBPMNError(internalEvent)).willReturn(bpmnError);
// when
BPMNErrorReceivedEvent errorEvent = toErrorReceivedConverter.from(internalEvent).orElse(null);
// then
assertThat(errorEvent).isNotNull();
assertThat(errorEvent.getProcessInstanceId()).isEqualTo("procInstId");
assertThat(errorEvent.getProcessDefinitionId()).isEqualTo("procDefId");
assertThat(errorEvent.getEntity()).isEqualTo(bpmnError);
}
use of org.activiti.api.runtime.model.impl.BPMNErrorImpl in project Activiti by Activiti.
the class BPMNErrorConverter method convertToBPMNError.
public BPMNErrorImpl convertToBPMNError(ActivitiErrorEvent internalEvent) {
BPMNErrorImpl bpmnError = new BPMNErrorImpl(internalEvent.getActivityId(), internalEvent.getActivityName(), internalEvent.getActivityType());
bpmnError.setProcessDefinitionId(internalEvent.getProcessDefinitionId());
bpmnError.setProcessInstanceId(internalEvent.getProcessInstanceId());
bpmnError.setExecutionId(internalEvent.getExecutionId());
bpmnError.setErrorId(internalEvent.getErrorId());
bpmnError.setErrorCode(internalEvent.getErrorCode());
return bpmnError;
}
use of org.activiti.api.runtime.model.impl.BPMNErrorImpl in project Activiti by Activiti.
the class BPMNErrorConverterTest method convertShouldReturnBPMNError.
@Test
public void convertShouldReturnBPMNError() {
ActivitiErrorEvent internalEvent = mock(ActivitiErrorEvent.class);
given(internalEvent.getErrorId()).willReturn("errorId");
given(internalEvent.getErrorCode()).willReturn("errorCode");
given(internalEvent.getActivityName()).willReturn("activityName");
given(internalEvent.getActivityType()).willReturn("activityType");
given(internalEvent.getProcessDefinitionId()).willReturn("procDefId");
given(internalEvent.getProcessInstanceId()).willReturn("procInstId");
BPMNErrorImpl bpmnError = bpmnErrorConverter.convertToBPMNError(internalEvent);
// then
assertThat(bpmnError).isNotNull();
assertThat(bpmnError.getProcessInstanceId()).isEqualTo("procInstId");
assertThat(bpmnError.getProcessDefinitionId()).isEqualTo("procDefId");
assertThat(bpmnError.getErrorId()).isEqualTo("errorId");
assertThat(bpmnError.getErrorCode()).isEqualTo("errorCode");
assertThat(bpmnError.getActivityName()).isEqualTo("activityName");
assertThat(bpmnError.getActivityType()).isEqualTo("activityType");
}
Aggregations