Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.0.0.CR5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbpm.executor.impl.wih
Class AsyncWorkItemHandler

    java.lang.Object
      org.jbpm.executor.impl.wih.AsyncWorkItemHandler

All Implemented Interfaces:
  WorkItemHandler

    public class AsyncWorkItemHandler

extends Object
implements WorkItemHandler

Asynchronous work item handler that utilizes power of `ExecutorService`. it expects following parameters to be present on work item for proper execution:

- CommandClass - FQCN of the command to be executed - mandatory unless this handler is configured with default command class
- Retries - number of retires for the command execution - optional

During execution it will set contextual data that will be available inside the command:

- businessKey - generated from process instance id and work item id in following format: [processInstanceId]:[workItemId]
- workItem - actual work item instance that is being executed (including all parameters)
- processInstanceId - id of the process instance that triggered this work item execution

In case work item shall be aborted handler will attempt to cancel active requests based on business key (process instance id and work item id)

Constructor Summary
`AsyncWorkItemHandler(org.kie.internal.executor.api.ExecutorService executorService)`
`AsyncWorkItemHandler(org.kie.internal.executor.api.ExecutorService executorService, String commandClass)`

Method Summary
`void` | `abortWorkItem(WorkItem workItem, WorkItemManager manager)` The given work item should be aborted.
`protected String` | `buildBusinessKey(WorkItem workItem)`
`void` | `executeWorkItem(WorkItem workItem, WorkItemManager manager)` The given work item should be executed.
`protected long` | `getProcessInstanceId(WorkItem workItem)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AsyncWorkItemHandler

    public AsyncWorkItemHandler(org.kie.internal.executor.api.ExecutorService executorService)

### AsyncWorkItemHandler

    public AsyncWorkItemHandler(org.kie.internal.executor.api.ExecutorService executorService,
                                String commandClass)

Method Detail

### executeWorkItem

    public void executeWorkItem(WorkItem workItem,
                                WorkItemManager manager)

  Description copied from interface: `WorkItemHandler`
  The given work item should be executed.

  Specified by:
    `executeWorkItem` in interface `WorkItemHandler`
  Parameters:
    `workItem` - the work item that should be executed
    `manager` - the manager that requested the work item to be executed

### abortWorkItem

    public void abortWorkItem(WorkItem workItem,
                              WorkItemManager manager)

  Description copied from interface: `WorkItemHandler`
  The given work item should be aborted.

  Specified by:
    `abortWorkItem` in interface `WorkItemHandler`
  Parameters:
    `workItem` - the work item that should be aborted
    `manager` - the manager that requested the work item to be aborted

### buildBusinessKey

    protected String buildBusinessKey(WorkItem workItem)

### getProcessInstanceId

    protected long getProcessInstanceId(WorkItem workItem)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.0.0.CR5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.