简体   繁体   中英

How create a WorkQueue Guidewire?

I need create a workqueue in guidewire, but not find guidewire documentation about this. Someone can help me please?

Regards, Douglas Rezende

You need several things:

  1. Make a new Typecode in BatchProcessType typekey (For example MyNewCode). Additionally you need add categories: Schedulable, UIRunnable or APIRunnable according to your need.
  2. Make a new class that extends WorkQueueBase like this
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. You can search in the documentation additional parameters like retryLimit, retryInterval, server, env, maxpollinterval, etc.
<work-queue workQueueClass="example.MyWorkQueue" progressinterval="600000">
        <worker instances="1" batchsize="5" />
</work-queue>
  1. Register the new BatchProcessType in scheduler-config.xml (Optional). For it works correctly the typecode needs the Schedulable category (first step)
<ProcessSchedule process="MyNewCode">
    <CronSchedule minutes="*/10" />
</ProcessSchedule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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