Package org.activiti.engine.delegate

Examples of org.activiti.engine.delegate.JavaDelegate


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

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

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

        return runtimeService;
    }
View Full Code Here


            .setJobExecutorActivate(true).buildProcessEngine();
        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

            .thenReturn(Machine.builder().localhost().createMachine());

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

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

        assertThat((Boolean) collector.getVariable(RESULT)).isFalse();
    }
View Full Code Here

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "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();
    }
View Full Code Here

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "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

        collector.install(execution);

        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

    private final Map<String, ExecutionListener> executionListeners = new ConcurrentHashMap<String, ExecutionListener>();

    @Override
    public void registerDelegate(@Nonnull String id, @Nonnull JavaDelegate delegate) {
        final JavaDelegate existing = delegates.put(id, delegate);
        if (existing != null) {
            throw new IllegalStateException(String.format("overwrite of existing delegate using id <%s>", id));
        }
    }
View Full Code Here

*/
public class DelegateTask extends AbstractDelegate implements JavaDelegate {
    @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

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

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

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

        return runtimeService;
    }
View Full Code Here

TOP

Related Classes of org.activiti.engine.delegate.JavaDelegate

Copyright © 2018 www.massapicom. 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.