简体   繁体   English

如何创建工作队列导丝?

[英]How create a WorkQueue Guidewire?

I need create a workqueue in guidewire, but not find guidewire documentation about this.我需要在 guidewire 中创建一个工作队列,但找不到关于此的 guidewire 文档。 Someone can help me please?有人可以帮助我吗?

Regards, Douglas Rezende问候,道格拉斯·雷岑德

You need several things:你需要几件事:

  1. Make a new Typecode in BatchProcessType typekey (For example MyNewCode).在 BatchProcessType typekey 中创建一个新的 Typecode(例如 MyNewCode)。 Additionally you need add categories: Schedulable, UIRunnable or APIRunnable according to your need.此外,您需要根据需要添加类别:Schedulable、UIRunnable 或 APIRunnable。
  2. Make a new class that extends WorkQueueBase like this创建一个像这样扩展 WorkQueueBase 的新类
class MyWorkQueue extends WorkQueueBase<Message, StandardWorkItem> {
  private final static var _batchProcessType = BatchProcessType.TC_MYNEWCODE
  construct() {
    super(_batchProcessType, StandardWorkItem, Message)
  }

  override function findTargets(): Iterator<Message> {
    return Query.make(Message).select().iterator()
  }

  override function processWorkItem(p0: StandardWorkItem) {
    var bean = extractTarget(p0)
    // My process
  }
}

  1. Register the new class in work-queue.xml.在 work-queue.xml 中注册新类。 You can search in the documentation additional parameters like retryLimit, retryInterval, server, env, maxpollinterval, etc.您可以在文档中搜索其他参数,如 retryLimit、retryInterval、server、env、maxpollinterval 等。
<work-queue workQueueClass="example.MyWorkQueue" progressinterval="600000">
        <worker instances="1" batchsize="5" />
</work-queue>
  1. Register the new BatchProcessType in scheduler-config.xml (Optional).在 scheduler-config.xml 中注册新的 BatchProcessType(可选)。 For it works correctly the typecode needs the Schedulable category (first step)因为它工作正常,类型代码需要 Scheduable 类别(第一步)
<ProcessSchedule process="MyNewCode">
    <CronSchedule minutes="*/10" />
</ProcessSchedule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM