当前位置: 首页>>代码示例>>Java>>正文


Java ActivitiListener.setImplementation方法代码示例

本文整理汇总了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());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:21,代码来源:ActivitiListenerParser.java

示例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));
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:12,代码来源:ProxyUserTaskBpmnParseHandler.java

示例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);
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:11,代码来源:TaskAutoRedirectParseHandler.java

示例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());
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:38,代码来源:EventJavaTest.java


注:本文中的org.activiti.bpmn.model.ActivitiListener.setImplementation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。