本文整理汇总了Java中org.activiti.bpmn.model.ActivitiListener.setImplementation方法的典型用法代码示例。如果您正苦于以下问题:Java ActivitiListener.setImplementation方法的具体用法?Java ActivitiListener.setImplementation怎么用?Java ActivitiListener.setImplementation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.bpmn.model.ActivitiListener
的用法示例。
在下文中一共展示了ActivitiListener.setImplementation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseChildElement
import org.activiti.bpmn.model.ActivitiListener; //导入方法依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
listener = new ActivitiListener();
BpmnXMLUtil.addXMLLocation(listener, xtr);
if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_CLASS))) {
listener.setImplementation(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_CLASS));
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
} else if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_EXPRESSION))) {
listener.setImplementation(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_EXPRESSION));
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
} else if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_DELEGATEEXPRESSION))) {
listener.setImplementation(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_DELEGATEEXPRESSION));
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION);
} else {
model.addProblem("Element 'class' or 'expression' is mandatory on executionListener", xtr);
}
listener.setEvent(xtr.getAttributeValue(null, ATTRIBUTE_LISTENER_EVENT));
parseChildElements(xtr, listener, model, new FieldExtensionParser());
}
示例2: configEvent
import org.activiti.bpmn.model.ActivitiListener; //导入方法依赖的package包/类
public void configEvent(TaskDefinition taskDefinition, BpmnParse bpmnParse,
String eventName) {
ActivitiListener activitiListener = new ActivitiListener();
activitiListener.setEvent(eventName);
activitiListener
.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION);
activitiListener.setImplementation("#{" + taskListenerId + "}");
taskDefinition
.addTaskListener(eventName, bpmnParse.getListenerFactory()
.createDelegateExpressionTaskListener(activitiListener));
}
示例3: executeParse
import org.activiti.bpmn.model.ActivitiListener; //导入方法依赖的package包/类
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
super.executeParse(bpmnParse, userTask);
// 实验后不能添加
ActivitiListener listener = new ActivitiListener();
listener.setEvent("create");
listener.setImplementationType("class");
listener.setImplementation("me.kafeitu.activiti.chapter21.listeners.TaskAutoRedirectListener");
userTask.getTaskListeners().add(listener);
}
示例4: testStartEventWithExecutionListener
import org.activiti.bpmn.model.ActivitiListener; //导入方法依赖的package包/类
public void testStartEventWithExecutionListener() throws Exception {
BpmnModel bpmnModel = new BpmnModel();
Process process = new Process();
process.setId("simpleProcess");
process.setName("Very simple process");
bpmnModel.getProcesses().add(process);
StartEvent startEvent = new StartEvent();
startEvent.setId("startEvent1");
TimerEventDefinition timerDef = new TimerEventDefinition();
timerDef.setTimeDuration("PT5M");
startEvent.getEventDefinitions().add(timerDef);
ActivitiListener listener = new ActivitiListener();
listener.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION);
listener.setImplementation("${test}");
listener.setEvent("end");
startEvent.getExecutionListeners().add(listener);
process.addFlowElement(startEvent);
UserTask task = new UserTask();
task.setId("reviewTask");
task.setAssignee("kermit");
process.addFlowElement(task);
SequenceFlow flow1 = new SequenceFlow();
flow1.setId("flow1");
flow1.setSourceRef("startEvent1");
flow1.setTargetRef("reviewTask");
process.addFlowElement(flow1);
EndEvent endEvent = new EndEvent();
endEvent.setId("endEvent1");
process.addFlowElement(endEvent);
byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
new BpmnXMLConverter().validateModel(new InputStreamSource(new ByteArrayInputStream(xml)));
Deployment deployment = repositoryService.createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
repositoryService.deleteDeployment(deployment.getId());
}