Tag Archives: Human Task Engines

Java Human Task Engines

Advertisements

How to Suspend a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.suspend(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Stop a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.stop(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Skip a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.skip(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Resume a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.resume(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Release a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.release(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Register a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.register(1, "userId", handler);

      client.disconnect();
    }

  }

}

How to Nominate a Task with the jBPM Human Task API

import java.util.ArrayList;

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.OrganizationalEntity;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.nominate(1, "userId", new ArrayList<OrganizationalEntity>(), handler);

      client.disconnect();
    }

  }

}

How to Forward a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.forward(1, "userId", "newUserId", handler);

      client.disconnect();
    }

  }

}

How to Delegate a Task with the jBPM Human Task API

import org.drools.SystemEventListenerFactory;
import org.jbpm.task.service.TaskClient;
import org.jbpm.task.service.TaskClientHandler.TaskOperationResponseHandler;
import org.jbpm.task.service.mina.MinaTaskClientConnector;
import org.jbpm.task.service.mina.MinaTaskClientHandler;
import org.jbpm.task.service.responsehandlers.BlockingTaskOperationResponseHandler;

public final class JbpmSample {

  public static void main(final String[] args) throws Exception {
    final TaskClient client = new TaskClient(new MinaTaskClientConnector("SampleClient", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

    if (client.connect("localhost", 9123)) {
      final TaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();

      client.delegate(1, "userId", "newUserId", handler);

      client.disconnect();
    }

  }

}