- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.kie.api.runtime.process.WorkItemHandler.abortWorkItem()
方法的一些代码示例,展示了WorkItemHandler.abortWorkItem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkItemHandler.abortWorkItem()
方法的具体详情如下:
包路径:org.kie.api.runtime.process.WorkItemHandler
类名称:WorkItemHandler
方法名:abortWorkItem
[英]The given work item should be aborted.
[中]
代码示例来源:origin: kiegroup/jbpm
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
try {
originalTaskHandler.abortWorkItem(workItem, manager);
} catch( RuntimeException re ) {
handleAbortException(re, workItem, manager);
}
}
代码示例来源:origin: kiegroup/jbpm
@Test
public void testTaskAbortSkippable() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
getHandler().abortWorkItem(workItem, manager);
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
@Test
代码示例来源:origin: kiegroup/jbpm
@Test
public void testTaskAbortNotSkippable() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setParameter("Skippable", "false");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(1, tasks.size());
getHandler().abortWorkItem(workItem, manager);
// aborting work item will exit task and not skip it
tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
@Test
代码示例来源:origin: kiegroup/jbpm
@Test
public void testTaskExitByCustomBusinessAdmin() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setParameter("BusinessAdministratorId", "Luke Cage");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
Task task = taskService.getTaskByWorkItemId(workItem.getId());
assertNotNull(task);
getHandler().abortWorkItem(workItem, manager);
task = taskService.getTaskByWorkItemId(workItem.getId());
assertEquals("TaskName", task.getNames().get(0).getText());
assertEquals(10, task.getPriority().intValue());
assertEquals("Comment", task.getDescriptions().get(0).getText());
assertEquals(Status.Exited, task.getTaskData().getStatus());
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
代码示例来源:origin: org.jbpm/jbpm-bpmn2
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
try {
originalTaskHandler.abortWorkItem(workItem, manager);
} catch( RuntimeException re ) {
handleAbortException(re, workItem, manager);
}
}
代码示例来源:origin: org.drools/knowledge-api
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
delegate.abortWorkItem(new WorkItemKieAdapter(workItem), new WorkItemManagerKieAdapter(manager));
}
代码示例来源:origin: org.drools/drools-persistence-jpa
public void internalAbortWorkItem( long id ) {
PersistenceContext context = getPersistenceContext();
WorkItemInfo workItemInfo = (WorkItemInfo) context.findWorkItem( id );
// work item may have been aborted
if ( workItemInfo != null ) {
WorkItemImpl workItem = (WorkItemImpl) internalGetWorkItem( workItemInfo );
WorkItemHandler handler = (WorkItemHandler) this.workItemHandlers.get( workItem.getName() );
if ( handler != null ) {
handler.abortWorkItem( workItem, this );
} else {
if ( workItems != null ) {
workItems.remove( id );
throwWorkItemNotFoundException( workItem );
}
}
if ( workItems != null ) {
workItems.remove( id );
}
context.remove( workItemInfo );
}
}
代码示例来源:origin: org.kie/drools-infinispan-persistence
@Override
public void internalAbortWorkItem(long id) {
Environment env = this.kruntime.getEnvironment();
//EntityManager em = (EntityManager) env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER);
PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext();
PersistentWorkItem workItemInfo = context.findWorkItem( id );
// work item may have been aborted
if (workItemInfo != null) {
WorkItemImpl workItem = (WorkItemImpl) internalGetWorkItem(workItemInfo);
WorkItemHandler handler = (WorkItemHandler) this.workItemHandlers.get(workItem.getName());
if (handler != null) {
handler.abortWorkItem(workItem, this);
} else {
throwWorkItemNotFoundException( workItem );
}
context.remove(workItemInfo);
}
}
代码示例来源:origin: org.jbpm/jbpm-human-task-workitems
@Test
public void testTaskAbortSkippable() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
getHandler().abortWorkItem(workItem, manager);
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
@Test
代码示例来源:origin: org.jbpm/jbpm-human-task-workitems
@Test
public void testTaskAbortNotSkippable() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setParameter("Skippable", "false");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(1, tasks.size());
getHandler().abortWorkItem(workItem, manager);
// aborting work item will exit task and not skip it
tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
@Test
代码示例来源:origin: org.jbpm/jbpm-human-task-workitems
@Test
public void testTaskExitByCustomBusinessAdmin() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
ksession.setWorkItemManager(manager);
WorkItemImpl workItem = new WorkItemImpl();
workItem.setName("Human Task");
workItem.setParameter("NodeName", "TaskName");
workItem.setParameter("Comment", "Comment");
workItem.setParameter("Priority", "10");
workItem.setParameter("ActorId", "Darth Vader");
workItem.setParameter("BusinessAdministratorId", "Luke Cage");
workItem.setProcessInstanceId(10);
getHandler().executeWorkItem(workItem, manager);
Task task = taskService.getTaskByWorkItemId(workItem.getId());
assertNotNull(task);
getHandler().abortWorkItem(workItem, manager);
task = taskService.getTaskByWorkItemId(workItem.getId());
assertEquals("TaskName", task.getNames().get(0).getText());
assertEquals(10, task.getPriority().intValue());
assertEquals("Comment", task.getDescriptions().get(0).getText());
assertEquals(Status.Exited, task.getTaskData().getStatus());
List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK");
assertEquals(0, tasks.size());
}
我正在使用带有自定义工作项处理程序的 jbpm-console (6.0.0.Final)。我在我的 jbpm-console WAR 中嵌入了一个自定义工作项处理程序 JAR,如此处的第 7 篇文章
下面是当前我们必须在 JBPM 7.32 中发送电子邮件的工作项处理程序。 但是我们收到错误 java.lang.RuntimeException: Unable to send email ”。 n
本文整理了Java中org.kie.api.runtime.process.WorkItemHandler.abortWorkItem()方法的一些代码示例,展示了WorkItemHandler.ab
本文整理了Java中org.kie.api.runtime.process.WorkItemHandler.executeWorkItem()方法的一些代码示例,展示了WorkItemHandler.
我是一名优秀的程序员,十分优秀!