Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setupMocks()
        public virtual void setupMocks()
        {
            runtimeServiceMock = mock(typeof(RuntimeService));
            when(processEngine.RuntimeService).thenReturn(runtimeServiceMock);

            signalBuilderMock = mock(typeof(SignalEventReceivedBuilderImpl));
            when(runtimeServiceMock.createSignalEvent(anyString())).thenReturn(signalBuilderMock);
            when(signalBuilderMock.setVariables(Matchers.any <IDictionary <string, object> >())).thenReturn(signalBuilderMock);
            when(signalBuilderMock.executionId(anyString())).thenReturn(signalBuilderMock);
            when(signalBuilderMock.tenantId(anyString())).thenReturn(signalBuilderMock);
            when(signalBuilderMock.withoutTenantId()).thenReturn(signalBuilderMock);
        }
Esempio n. 2
0
        protected internal virtual SignalEventReceivedBuilder createSignalEventReceivedBuilder(SignalDto dto)
        {
            RuntimeService             runtimeService = processEngine.RuntimeService;
            string                     name           = dto.Name;
            SignalEventReceivedBuilder signalEvent    = runtimeService.createSignalEvent(name);

            string executionId = dto.ExecutionId;

            if (!string.ReferenceEquals(executionId, null))
            {
                signalEvent.executionId(executionId);
            }

            IDictionary <string, VariableValueDto> variablesDto = dto.Variables;

            if (variablesDto != null)
            {
                IDictionary <string, object> variables = VariableValueDto.toMap(variablesDto, processEngine, objectMapper);
                signalEvent.Variables = variables;
            }

            string tenantId = dto.TenantId;

            if (!string.ReferenceEquals(tenantId, null))
            {
                signalEvent.tenantId(tenantId);
            }

            bool isWithoutTenantId = dto.WithoutTenantId;

            if (isWithoutTenantId)
            {
                signalEvent.withoutTenantId();
            }

            return(signalEvent);
        }