Examples of DelegateExecution


Examples of org.activiti.engine.delegate.DelegateExecution

    private static final String RESULT = "result";

    @Test
    public void testWithAListOfEndedProcesses() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "2"));

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

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
View Full Code Here

Examples of org.activiti.engine.delegate.DelegateExecution

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

    @Test
    public void testWithOneEndedAndOneStillRunning() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "2"));

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

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
View Full Code Here

Examples of org.activiti.engine.delegate.DelegateExecution

    /**
     * We consider an invalid process instance ID as ended by default
     */
    @Test
    public void testWithOneInvalidProcessId() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "invalid"));

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

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
View Full Code Here

Examples of org.activiti.engine.delegate.DelegateExecution

            .username("admin")
            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();

        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getAdminAccess()).thenReturn(adminAccess);

        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);

        activity.execute(execution);
        assertKeyPairWasImportedAsExpected();

        /* the second call should just re-import the key */
 
View Full Code Here

Examples of org.activiti.engine.delegate.DelegateExecution

        super.tearDown();
    }

    @Test
    public void testDeleteSecurityGroup() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        client.createSecurityGroup(new CreateSecurityGroupRequest()
            .withGroupName(SECURITY_GROUP_NAME).withDescription("Just for test"));

        activity.execute(execution);
View Full Code Here

Examples of org.camunda.bpm.engine.delegate.DelegateExecution

  public void notify(final DelegateTask delegateTask){
    if(delegateTask.getExecution() == null) {
      LOG.log(Level.FINE, "Task {0} not related to an execution, target process application cannot be determined.", new Object[] { delegateTask });
    } else {
      final DelegateExecution execution = delegateTask.getExecution();
      Callable<Void> notification = new Callable<Void>() {
        public Void call() throws Exception {
          notifyTaskListener(delegateTask);
          return null;
        }
View Full Code Here

Examples of org.camunda.bpm.engine.delegate.DelegateExecution

public class AssigneeOverwriteFromVariable implements TaskListener {

  @SuppressWarnings("unchecked")
  public void notify(DelegateTask delegateTask) {
    // get mapping table from variable
    DelegateExecution execution = delegateTask.getExecution();
    Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable");
   
    // get assignee from process
    String assigneeFromProcessDefinition = delegateTask.getAssignee();
   
    // overwrite assignee if there is an entry in the mapping table
View Full Code Here

Examples of org.camunda.bpm.engine.delegate.DelegateExecution

  }

  @Override
  public boolean validate(final Object submittedValue, final FormFieldValidatorContext validatorContext) {

    final DelegateExecution execution = validatorContext.getExecution();

    if(shouldPerformPaContextSwitch(validatorContext.getExecution())) {
      return Context.executeWithinProcessApplication(new Callable<Boolean>() {
        public Boolean call() throws Exception {
          return doValidate(submittedValue, validatorContext);
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.