Examples of TaskService


Examples of ca.eandb.jdcp.remote.TaskService

  private interface ServiceOperation<T> {
    T run(TaskService service) throws Exception;
  };

  private <T> T run(ServiceOperation<T> operation) throws DelegationException {
    TaskService service = this.service;
    try {
      if (logger.isInfoEnabled()) {
        logger.info(String.format("Running operation: %s", operation));
      }
      return operation.run(service);
View Full Code Here

Examples of com.founder.fix.fixflow.core.TaskService

  public Map<String, Object> getRollbackNode(Map<String,Object> params) throws SQLException{
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    String taskId = StringUtil.getString(params.get("taskId"));
    ProcessEngine processEngine = getProcessEngine(userId);
    TaskService taskService = processEngine.getTaskService();
    List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
    try{
      List<UserTaskBehavior> userTaskBehaviors = taskService.getRollBackNode(taskId);
      for(UserTaskBehavior node :userTaskBehaviors){
        Map<String,Object> nodeMap = new HashMap<String,Object>();
        nodeMap.put("nodeId", node.getId());
        nodeMap.put("nodeName", node.getName());
        resultList.add(nodeMap);
View Full Code Here

Examples of com.sun.sgs.service.TaskService

    return;
      }

      WatchdogService watchdogService =
    ChannelServiceImpl.getWatchdogService();
      TaskService taskService = ChannelServiceImpl.getTaskService();
      BigInteger channelRefId = new BigInteger(channelIter.next());
      channelIter.remove();
      ChannelImpl channel = (ChannelImpl) getObjectForId(channelRefId);
      if (channel != null) {
    channel.reassignCoordinator(failedNodeId);
   
    /*
     * If other channel servers have failed, remove their sessions
     * from the channel too.  This covers the case where a channel
     * coordinator (informed of a node failure) fails before it has
     * a chance to schedule a task to remove member sessions for
     * another failed node (cascading failure during recovery).
     */
    for (long serverNodeId : channel.getMemberNodeIds()) {
        Node serverNode = watchdogService.getNode(serverNodeId);
        if (serverNode == null || !serverNode.isAlive()) {
      channel.removeSessionSet(serverNodeId);
        }
    }
      }

      /*
       * Schedule a task to reassign the next channel coordinator, or
       * if done with coordinator reassignment, remove the recovered
       * node's  mapping from the node-to-event-queues map.
       */
      if (channelIter.hasNext()) {
    taskService.scheduleTask(this);
      }
  }
View Full Code Here

Examples of com.sun.sgs.service.TaskService

      if (iter == null || !iter.hasNext()) {
    return;
      }
     
      BigInteger channelRefId = new BigInteger(iter.next());
      TaskService taskService = ChannelServiceImpl.getTaskService();
      taskService.scheduleTask(
    new RemoveFailedSessionsFromChannelTask(
        failedNodeId, channelRefId));
       
      // Schedule a task to remove failed sessions from next
      // locally coordinated channel.
      if (iter.hasNext()) {
    taskService.scheduleTask(this);
      }
  }
View Full Code Here

Examples of com.sun.sgs.service.TaskService

  public void run() {
      DataService dataService =
    ClientSessionServiceImpl.getDataService();
      String key = dataService.nextServiceBoundName(lastKey);
      if (key != null && key.startsWith(nodePrefix)) {
    TaskService taskService =
        ClientSessionServiceImpl.getTaskService();
    taskService.scheduleTask(
        new CleanupDisconnectedSessionTask(key));
    lastKey = key;
    taskService.scheduleTask(this);
      }
  }
View Full Code Here

Examples of com.sun.sgs.service.TaskService

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(final Node node, RecoveryCompleteFuture future) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
     
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * For each session on the failed node, notify
           * the session's ClientSessionListener and
           * clean up the session's persistent data and
           * bindings.
           */
          taskService.scheduleTask(
        new HandleNextDisconnectedSessionTask(nodeId));
       
          /*
           * Remove client session server proxy and
           * associated binding for failed node, as
           * well as protocol descriptors for the
           * failed node.
           */
          taskService.scheduleTask(
        new RemoveNodeSpecificDataTask(nodeId));
      } },
        taskOwner);
              
    future.done();
View Full Code Here

Examples of com.sun.sgs.service.TaskService

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(Node node, RecoveryCompleteFuture future) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * Reassign each failed coordinator to a new node.
           */
          taskService.scheduleTask(
        new ChannelImpl.ReassignCoordinatorsTask(
            nodeId));
          /*
           * Remove binding to channel server proxy for
           * failed node, and remove proxy's wrapper.
           */
          taskService.scheduleTask(
        new RemoveChannelServerProxyTask(nodeId));
      }
        },
        taskOwner);
   
View Full Code Here

Examples of com.sun.sgs.service.TaskService

  /** {@inheritDoc} */
  public void nodeFailed(Node node) {
      final long nodeId = node.getId();
      channelServerCache.remove(nodeId);
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO,
             "Node:{0} handling nodeFailed:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent task to remove the failed sessions of
     * locally coordinated channels.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable(
      "ScheduleRemoveFailedSessionsFromLocalChannelsTask")
        {
      public void run() {
          taskService.scheduleTask(
        new ChannelImpl.
            RemoveFailedSessionsFromLocalChannelsTask(
          localNodeId, nodeId));
      }
        }, taskOwner);
View Full Code Here

Examples of org.activiti.engine.TaskService

  public static void main(String[] args) {
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    RepositoryService repositoryService = processEngine.getRepositoryService();

    TaskService taskService = processEngine.getTaskService();
    ManagementService managementService = processEngine.getManagementService();
    IdentityService identityService = processEngine.getIdentityService();
    HistoryService historyService = processEngine.getHistoryService();
    FormService formService = processEngine.getFormService();
View Full Code Here

Examples of org.activiti.engine.TaskService

            .getVariable(processInstance.getProcessInstanceId(),
                DESCRIPTION_KEY),
        endsWith("I hate your xxxing shop!"));

    // get a handle on the task service
    TaskService taskService = activitiRule.getTaskService();

    // seach for a task for candidate-group 'itsupport-critical'
    Task approveCriticalIssueTask = taskService.createTaskQuery()
        .processInstanceId(processInstance.getProcessInstanceId())
        .taskCandidateGroup(itSupportGroup.getId()).singleResult();
    assertThat(approveCriticalIssueTask.getName(),
        equalTo("Approve Critical Issue"));

    // claim the task for the user 'itguy'
    taskService.claim(approveCriticalIssueTask.getId(), itguy.getId());

    // approve the request and complete the task
    Map<String, Object> taskParams = new HashMap<String, Object>();
    taskParams.put("requestApproved", "true");
    taskService.complete(approveCriticalIssueTask.getId(), taskParams);

    // now we should have received an email..
    smtpServer.waitForIncomingEmail(5000L, 1);
    MimeMessage[] messages = smtpServer.getReceivedMessages();
    assertThat(messages.length, equalTo(1));
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.