Package org.activiti.engine.delegate

Examples of org.activiti.engine.delegate.JavaDelegate.execute()


        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(processMap, "invalid");

        JavaDelegate delegate = new KillMachineSetUpProcesses(runtimeService, PROCESS_IDS);
        delegate.execute(execution);

        return runtimeService;
    }
}
View Full Code Here


        processEngine.getRepositoryService().createDeployment()
            .addClasspathResource("diagrams/empty.bpmn20.xml").deploy();

        try {
            JavaDelegate delegate = new SpawnProcessForEachMachine(processEngine, EMPTY_PROCESS_KEY, "test", RESULT);
            delegate.execute(execution);

            @SuppressWarnings("unchecked")
            List<String> processInstanceIds = (List<String>) collector.getVariable(RESULT);

            assertThat(processInstanceIds).hasSize(2);
View Full Code Here

        ServerSocket socket = null;
        try {
            socket = new ServerSocket(0);

            JavaDelegate delegate = new IsMachinePortOpen(RESULT, socket.getLocalPort());
            delegate.execute(execution);

            assertThat((Boolean) collector.getVariable(RESULT)).isTrue();

        } finally {
            if (socket != null) {
View Full Code Here

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        JavaDelegate delegate = new IsMachinePortOpen(RESULT, findRandomNotUsedPort());
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isFalse();
    }

    private int findRandomNotUsedPort() throws IOException {
View Full Code Here

            "1", mockProcessInstance(/* ended= */ true),
            "2", mockProcessInstance(/* ended= */ true)
        ));

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isTrue();
    }

    @Test
View Full Code Here

            "1", mockProcessInstance(/* ended= */ true),
            "2", mockProcessInstance(/* ended= */ false)
        ));

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isFalse();
    }

    /**
 
View Full Code Here

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "1", mockProcessInstance(/* ended= */ true)), "invalid");

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isTrue();
    }

}
View Full Code Here

    @Override
    public void execute(DelegateExecution execution) throws Exception {
        final String componentId = getComponentId(execution);
        final JavaDelegate delegate = getWorkflowTaskRegistry().findDelegate(componentId);
        Assert.notNull(delegate, String.format("No JavaDelegate found for componentId %s.", componentId));
        delegate.execute(execution);
    }
}
View Full Code Here

        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(processMap, "invalid");

        JavaDelegate delegate = new KillMachineSetUpProcesses(runtimeService, PROCESS_IDS);
        delegate.execute(execution);

        return runtimeService;
    }
}
View Full Code Here

        processEngine.getRepositoryService().createDeployment()
            .addClasspathResource("diagrams/empty.bpmn20.xml").deploy();

        try {
            JavaDelegate delegate = new SpawnProcessForEachMachine(processEngine, EMPTY_PROCESS_KEY, "test", RESULT);
            delegate.execute(execution);

            @SuppressWarnings("unchecked")
            List<String> processInstanceIds = (List<String>) collector.getVariable(RESULT);

            assertThat(processInstanceIds).hasSize(2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.