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

            historyServiceMock = mock(typeof(HistoryService));
            when(processEngine.HistoryService).thenReturn(historyServiceMock);

            builderMock = mock(typeof(RestartProcessInstanceBuilder));
            when(builderMock.startAfterActivity(anyString())).thenReturn(builderMock);
            when(builderMock.startBeforeActivity(anyString())).thenReturn(builderMock);
            when(builderMock.startTransition(anyString())).thenReturn(builderMock);
            when(builderMock.processInstanceIds(anyListOf(typeof(string)))).thenReturn(builderMock);
            when(builderMock.historicProcessInstanceQuery(any(typeof(HistoricProcessInstanceQuery)))).thenReturn(builderMock);
            when(builderMock.skipCustomListeners()).thenReturn(builderMock);
            when(builderMock.skipIoMappings()).thenReturn(builderMock);
            when(builderMock.initialSetOfVariables()).thenReturn(builderMock);
            when(builderMock.withoutBusinessKey()).thenReturn(builderMock);

            Batch batchMock = createMockBatch();

            when(builderMock.executeAsync()).thenReturn(batchMock);

            when(runtimeServiceMock.restartProcessInstances(anyString())).thenReturn(builderMock);
        }
Ejemplo n.º 2
0
        private RestartProcessInstanceBuilder createRestartProcessInstanceBuilder(RestartProcessInstanceDto restartProcessInstanceDto)
        {
            RuntimeService runtimeService         = engine.RuntimeService;
            RestartProcessInstanceBuilder builder = runtimeService.restartProcessInstances(processDefinitionId);

            if (restartProcessInstanceDto.ProcessInstanceIds != null)
            {
                builder.processInstanceIds(restartProcessInstanceDto.ProcessInstanceIds);
            }

            if (restartProcessInstanceDto.HistoricProcessInstanceQuery != null)
            {
                builder.historicProcessInstanceQuery(restartProcessInstanceDto.HistoricProcessInstanceQuery.toQuery(engine));
            }

            if (restartProcessInstanceDto.InitialVariables)
            {
                builder.initialSetOfVariables();
            }

            if (restartProcessInstanceDto.WithoutBusinessKey)
            {
                builder.withoutBusinessKey();
            }

            if (restartProcessInstanceDto.SkipCustomListeners)
            {
                builder.skipCustomListeners();
            }

            if (restartProcessInstanceDto.SkipIoMappings)
            {
                builder.skipIoMappings();
            }
            restartProcessInstanceDto.applyTo(builder, engine, objectMapper);
            return(builder);
        }