调用了异步接口的启动服务和发起任务

执行本任务的原因和时间

调用了异步接口的发起任务包括微流程中的直接插入发起任务、微流程中的独立发起任务以及启动了单个 Java 类的发起任务。

本方案创建任务模板的实例并传递一些客户数据。

本任务的步骤

  1. 可选: 列示任务模板以查找所要运行的发起任务的名称。

    如果您已知道该任务的名称,则此步骤是可选的。

    TaskTemplate[] taskTemplates = task.queryTaskTemplates
      ("TASK_TEMPL.KIND=TASK_TEMPL.KIND.KIND_ORIGINATING",
       "TASK_TEMPL.NAME",
        new Integer(50),
        null);

    结果将按名称排序。此查询返回一个数组,该数组包含前 50 个发起模板(已排序)。

  2. 创建适当类型的输入消息。
    TaskTemplate template = taskTemplates[0];
    
    // create a message for the selected task
    ClientObjectWrapper input = task.createInputMessage( template.getID());                       
    DataObject myMessage = null ;
    if ( input.getObject()!= null && input.getObject() instanceof DataObject )
    {
      myMessage = (DataObject)input.getObject();
      //set the parts in the message, for example, a customer name
      myMessage.setString("CustomerName", "Smith");
    }
  3. 创建该任务并以异步方式运行它。

    本示例使用 createAndStartTask 方法来创建和运行任务。

    task.createAndStartTask( template.getName(),
                             template.getNamespace(),
                             input,
                             null);
相关概念
对业务流程以及与任务相关的对象执行的查询

使用条款 |


(c) Copyright IBM Corporation 2005, 2006.
本信息中心基于 Eclipse 技术(http://www.eclipse.org)。