本文整理汇总了Java中org.kie.api.runtime.process.WorkItemManager类的典型用法代码示例。如果您正苦于以下问题:Java WorkItemManager类的具体用法?Java WorkItemManager怎么用?Java WorkItemManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkItemManager类属于org.kie.api.runtime.process包,在下文中一共展示了WorkItemManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String implementation = getImplementation(workItem.getParameters());
if (IMPLEMENTATION_SWITCHYARD.equalsIgnoreCase(implementation)) {
super.executeWorkItem(workItem, manager);
} else {
ServiceTaskHandler sth;
ProcessRuntime runtime = getProcessRuntime();
if (runtime instanceof KieSession) {
sth = new ServiceTaskHandler((KieSession)runtime);
} else {
sth = new ServiceTaskHandler();
}
sth.setClassLoader(getClass().getClassLoader());
sth.executeWorkItem(workItem, manager);
}
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:StandardSwitchYardServiceTaskHandler.java
示例2: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String implementation = getImplementation(workItem.getParameters());
if (IMPLEMENTATION_SWITCHYARD.equalsIgnoreCase(implementation)) {
super.executeWorkItem(workItem, manager);
} else {
ServiceTaskHandler sth;
ProcessRuntime runtime = getProcessRuntime();
if (runtime instanceof KieSession) {
sth = new ServiceTaskHandler((KieSession)runtime);
} else {
sth = new ServiceTaskHandler();
}
sth.setClassLoader(getClass().getClassLoader());
sth.executeWorkItem(workItem, manager);
}
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:19,代码来源:StandardSwitchYardServiceTaskHandler.java
示例3: testSingleFileWithHeaders
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/**
* File to upload has been specified by Camel header.
*
* @throws java.io.IOException */
@Test
public void testSingleFileWithHeaders() throws IOException {
Set<String> headers = new HashSet<String>();
headers.add("CamelFileName");
CamelHandler handler = new CamelHandler(new FileURIMapper(), new RequestPayloadMapper("payload", headers));
final String testData = "test-data";
final WorkItem workItem = new WorkItemImpl();
workItem.setParameter("path", tempDir.getAbsolutePath());
workItem.setParameter("payload", testData);
workItem.setParameter("CamelFileName", testFile.getName());
WorkItemManager manager = new DefaultWorkItemManager(null);
handler.executeWorkItem(workItem, manager);
assertTrue(testFile.exists());
String resultText = FileUtils.readFileToString(testFile);
assertEquals(testData,resultText);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:25,代码来源:CamelFileTest.java
示例4: testFtp
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Test
public void testFtp() throws IOException {
CamelHandler handler = CamelHandlerFactory.ftpHandler();
final String testData = "test-data";
final WorkItem workItem = new WorkItemImpl();
workItem.setParameter("username", USER);
workItem.setParameter("password", PASSWD);
workItem.setParameter("hostname", HOST);
workItem.setParameter("port", PORT.toString());
workItem.setParameter("directoryname", testFile.getParentFile().getName());
workItem.setParameter("CamelFileName", testFile.getName());
workItem.setParameter("payload", testData);
WorkItemManager manager = new DefaultWorkItemManager(null);
handler.executeWorkItem(workItem, manager);
Assert.assertTrue("Expected file does not exist.", testFile.exists());
String resultText = FileUtils.readFileToString(testFile);
Assert.assertEquals(resultText, testData);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:24,代码来源:CamelFtpTest.java
示例5: testSingleFileWithHeaders
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/** File to upload has been specified by Camel header. */
@Test
public void testSingleFileWithHeaders() throws IOException {
Set<String> headers = new HashSet<String>();
headers.add("CamelFileName");
CamelHandler handler = new CamelHandler(new FileURIMapper(), new RequestPayloadMapper("payload", headers));
final String testData = "test-data";
final WorkItem workItem = new WorkItemImpl();
workItem.setParameter("path", tempDir.getAbsolutePath());
workItem.setParameter("payload", testData);
workItem.setParameter("CamelFileName", testFile.getName());
WorkItemManager manager = new DefaultWorkItemManager(null);
handler.executeWorkItem(workItem, manager);
Assert.assertTrue("Expected file does not exist.", testFile.exists());
String resultText = FileUtils.readFileToString(testFile);
Assert.assertEquals(resultText, testData);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:22,代码来源:CamelFileTest.java
示例6: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
long processInstanceId = workItem.getProcessInstanceId();
String nextApprover = (String) workItem.getParameter(SimpleWFService.NEXT_APPROVER);
String notificationType = (String) workItem.getParameter(NOTIFICATION_TYPE);
String approvalDenier = (String) workItem.getParameter(SimpleWFService.APPROVAL_DENIER);
SimpleApproval approval = simpleApprovalDAO.findSimpleApproval(processInstanceId);
String originator = approval.getCreatedBy();
String replyTo = getReplyTo(notificationType, originator, approvalDenier);
String subjectPrefix = getSubjectPrefix(notificationType);
String applicationUrl = propertyService.getString("mail.application.url");
String emailSubject = subjectPrefix + approval.getSubject();
Map<String, String> data = new HashMap<String, String>();
String taskUrl = getTaskUrl(applicationUrl, processInstanceId);
data.put("taskUrl", taskUrl);
data.put("taskSubject", approval.getSubject());
data.put("rejector", approvalDenier);
data.put("originator", originator);
Set<String> toSet = getToSet(nextApprover, notificationType, approval, originator);
String templateFileName = getTemplate(notificationType);
emailService.sendMessage(replyTo, emailSubject, data, toSet, templateFileName);
manager.completeWorkItem(workItem.getId(), null);
}
开发者ID:awizen,项目名称:gangehi,代码行数:33,代码来源:MySendTaskHandler.java
示例7: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
// Get local id mapping to task UUID
String taskId;
synchronized (mItemIdMap) {
taskId = mItemIdMap.remove(workItem.getId());
}
if (taskId != null) {
Afm.get(mUrl).abortTask(taskId);
}
manager.abortWorkItem(workItem.getId());
}
开发者ID:SLAMon,项目名称:SLAMon,代码行数:12,代码来源:SLAMonWorkItemHandler.java
示例8: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
public void executeWorkItem(final WorkItem workItem, final WorkItemManager manager) {
String url = mUrl;
String appId = mAppId;
String secret = mSecret;
String masterVariantId = mMasterVariantId;
String variantId = String.valueOf(workItem.getParameter("variant_id"));
String alert = String.valueOf(workItem.getParameter("alert"));
String sound = String.valueOf(workItem.getParameter("sound"));
String testId = null;
final String deploymentId = ((WorkItemImpl) workItem).getDeploymentId();
EngineHolder engine = null;
try {
engine = new EngineHolder(deploymentId);
testId = Util.processId(engine.getEngine(), workItem);
} finally {
if (engine != null) {
engine.close();
}
}
PushNotification notification;
notification = new PushNotification(masterVariantId, variantId, alert, sound);
Jups jups;
jups = new Jups(url, appId, secret);
String result = jups.send(notification, testId);
Map<String, Object> results = new HashMap<String, Object>();
results.put("result", result);
manager.completeWorkItem(workItem.getId(), results);
}
开发者ID:SLAMon,项目名称:SLAMon,代码行数:38,代码来源:SLAMonJupsHandler.java
示例9: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void executeWorkItem(org.kie.api.runtime.process.WorkItem workItem, org.kie.api.runtime.process.WorkItemManager workItemManager) {
Map<String, Object> results = null;
try {
results = this.send(workItem);
} catch (Exception e) {
handleException(e);
}
workItemManager.completeWorkItem(workItem.getId(), results);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:11,代码来源:CamelHandler.java
示例10: testClass
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Test
public void testClass() {
CamelHandler handler = CamelHandlerFactory.genericHandler("class", "FQCN");
final WorkItem workItem = new WorkItemImpl();
workItem.setParameter("FQCN", getClass().getCanonicalName());
workItem.setParameter("method", "testMethod");
WorkItemManager manager = new DefaultWorkItemManager(null);
handler.executeWorkItem(workItem, manager);
Assert.assertTrue(called);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:14,代码来源:CamelGenericTest.java
示例11: testFtps
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Test
public void testFtps() throws IOException {
CamelHandler handler = CamelHandlerFactory.ftpsHandler();
final String testData = "test-data";
final WorkItem workItem = new WorkItemImpl();
workItem.setParameter("username", USER);
workItem.setParameter("password", PASSWD);
workItem.setParameter("hostname", HOST);
workItem.setParameter("port", PORT.toString());
workItem.setParameter("directoryname", testFile.getParentFile().getName());
workItem.setParameter("CamelFileName", testFile.getName());
workItem.setParameter("payload", testData);
workItem.setParameter("isImplicit", "true");
workItem.setParameter("securityProtocol", "TLS");
// needed for SSL
workItem.setParameter("ftpClient.trustStore.file", CLIENT_SSL_KEY_TRUST_STORE.getAbsolutePath());
workItem.setParameter("ftpClient.trustStore.password", CLIENT_SSL_STORE_PASSWD);
workItem.setParameter("ftpClient.trustStore.keyPassword", CLIENT_SSL_KEY_PASSWD);
workItem.setParameter("ftpClient.keyStore.file", CLIENT_SSL_KEY_TRUST_STORE.getAbsolutePath());
workItem.setParameter("ftpClient.keyStore.password", CLIENT_SSL_STORE_PASSWD);
workItem.setParameter("ftpClient.keyStore.keyPassword", CLIENT_SSL_KEY_PASSWD);
WorkItemManager manager = new DefaultWorkItemManager(null);
handler.executeWorkItem(workItem, manager);
// assertions
Assert.assertTrue("Expected file does not exist.", testFile.exists());
String resultText = FileUtils.readFileToString(testFile);
Assert.assertEquals(resultText, testData);
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:36,代码来源:CamelFtpsTest.java
示例12: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
manager.abortWorkItem(workItem.getId());
}
开发者ID:SLAMon,项目名称:SLAMon,代码行数:4,代码来源:SLAMonJupsHandler.java
示例13: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
_holder.setValue("handler executed");
workItemManager.completeWorkItem(workItem.getId(), null);
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:ReuseHandler.java
示例14: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:3,代码来源:ReuseHandler.java
示例15: executeWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
System.out.println(workItem);
System.out.println(manager);
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:BPMModelTests.java
示例16: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
System.out.println(workItem);
System.out.println(manager);
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:BPMModelTests.java
示例17: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
// noop
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:8,代码来源:SwitchYardServiceTaskHandler.java
示例18: getWorkItemManager
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
public WorkItemManager getWorkItemManager() {
return kieSession.getWorkItemManager();
}
开发者ID:deepu105,项目名称:drools-demo,代码行数:4,代码来源:DefaultKieSessionBean.java
示例19: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:4,代码来源:ReuseHandler.java
示例20: abortWorkItem
import org.kie.api.runtime.process.WorkItemManager; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
// noop
}
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:6,代码来源:SwitchYardServiceTaskHandler.java
注:本文中的org.kie.api.runtime.process.WorkItemManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论