Created
September 26, 2018 16:45
-
-
Save bbalakriz/562a51bcd1d3ed4b67cf00bf0d00f59f to your computer and use it in GitHub Desktop.
Custom Work Item Handler Impl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bala.custom.wih; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.kie.api.runtime.process.WorkItem; | |
import org.kie.api.runtime.process.WorkItemHandler; | |
import org.kie.api.runtime.process.WorkItemManager; | |
public class CustomWIH implements WorkItemHandler { | |
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) { | |
manager.abortWorkItem(workItem.getId()); | |
} | |
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) { | |
Object param1 = workItem.getParameter("Message"); | |
System.out.println("Do your custom logic here with your param - " + param1); | |
Map<String, Object> resultMap = new HashMap<String, Object>(); | |
resultMap.put("Result", "Executed CustomWIH successfully"); | |
manager.completeWorkItem(workItem.getId(), resultMap); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment