Search in sources :

Example 1 with BPMNSignalReceivedEventImpl

use of org.activiti.api.runtime.event.impl.BPMNSignalReceivedEventImpl in project Activiti by Activiti.

the class ToSignalReceivedConverter method from.

@Override
public Optional<BPMNSignalReceivedEvent> from(ActivitiSignalEvent internalEvent) {
    BPMNSignalReceivedEventImpl event = new BPMNSignalReceivedEventImpl(toSignalConverter.from(internalEvent));
    event.setProcessInstanceId(internalEvent.getProcessInstanceId());
    event.setProcessDefinitionId(internalEvent.getProcessDefinitionId());
    return Optional.of(event);
}
Also used : BPMNSignalReceivedEventImpl(org.activiti.api.runtime.event.impl.BPMNSignalReceivedEventImpl)

Example 2 with BPMNSignalReceivedEventImpl

use of org.activiti.api.runtime.event.impl.BPMNSignalReceivedEventImpl in project Activiti by Activiti.

the class SignalReceivedListenerDelegateTest method onEventShouldCallOnAvailableListenersWhenIsASignalEvent.

@Test
public void onEventShouldCallOnAvailableListenersWhenIsASignalEvent() {
    // given
    ActivitiSignalEventImpl internalEvent = new ActivitiSignalEventImpl(ActivitiEventType.ACTIVITY_SIGNALED);
    BPMNSignalReceivedEventImpl signalReceivedEvent = new BPMNSignalReceivedEventImpl();
    given(converter.from(internalEvent)).willReturn(Optional.of(signalReceivedEvent));
    // when
    listenerDelegate.onEvent(internalEvent);
    // then
    verify(firstListener).onEvent(signalReceivedEvent);
    verify(secondListener).onEvent(signalReceivedEvent);
}
Also used : ActivitiSignalEventImpl(org.activiti.engine.delegate.event.impl.ActivitiSignalEventImpl) BPMNSignalReceivedEventImpl(org.activiti.api.runtime.event.impl.BPMNSignalReceivedEventImpl) Test(org.junit.jupiter.api.Test)

Aggregations

BPMNSignalReceivedEventImpl (org.activiti.api.runtime.event.impl.BPMNSignalReceivedEventImpl)2 ActivitiSignalEventImpl (org.activiti.engine.delegate.event.impl.ActivitiSignalEventImpl)1 Test (org.junit.jupiter.api.Test)1