本文整理汇总了Java中org.activiti.bpmn.model.Event类的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于org.activiti.bpmn.model包,在下文中一共展示了Event类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
SignalEventDefinition eventDefinition = new SignalEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
eventDefinition.setSignalRef(xtr.getAttributeValue(null, ATTRIBUTE_SIGNAL_REF));
if (StringUtils.isNotEmpty(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_ASYNCHRONOUS))) {
eventDefinition.setAsync(Boolean.parseBoolean(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_ASYNCHRONOUS)));
}
if (StringUtils.isEmpty(eventDefinition.getSignalRef())) {
model.addProblem("signalEventDefinition does not have required property 'signalRef'", xtr);
}
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例2: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
MessageEventDefinition eventDefinition = new MessageEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
eventDefinition.setMessageRef(xtr.getAttributeValue(null, ATTRIBUTE_MESSAGE_REF));
if(StringUtils.isEmpty(eventDefinition.getMessageRef())) {
model.addProblem("attribute 'messageRef' is required", xtr);
} else {
int indexOfP = eventDefinition.getMessageRef().indexOf(':');
if (indexOfP != -1) {
String prefix = eventDefinition.getMessageRef().substring(0, indexOfP);
String resolvedNamespace = model.getNamespace(prefix);
eventDefinition.setMessageRef(resolvedNamespace + ":" + eventDefinition.getMessageRef().substring(indexOfP + 1));
} else {
eventDefinition.setMessageRef(model.getTargetNamespace() + ":" + eventDefinition.getMessageRef());
}
if(model.containsMessageId(eventDefinition.getMessageRef()) == false) {
model.addProblem("Invalid 'messageRef': no message with id '" + eventDefinition.getMessageRef() + "' found.", xtr);
}
}
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例3: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
CompensateEventDefinition eventDefinition = new CompensateEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
eventDefinition.setActivityRef(xtr.getAttributeValue(null, ATTRIBUTE_COMPENSATE_ACTIVITYREF));
if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_COMPENSATE_WAITFORCOMPLETION))) {
eventDefinition.setWaitForCompletion(Boolean.parseBoolean(xtr.getAttributeValue(null, ATTRIBUTE_COMPENSATE_WAITFORCOMPLETION)));
}
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例4: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof EndEvent == false) return;
TerminateEventDefinition eventDefinition = new TerminateEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例5: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
CancelEventDefinition eventDefinition = new CancelEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例6: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
ErrorEventDefinition eventDefinition = new ErrorEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
eventDefinition.setErrorCode(xtr.getAttributeValue(null, "errorRef"));
if (parentElement instanceof EndEvent && StringUtils.isEmpty(eventDefinition.getErrorCode())) {
model.addProblem("errorRef is required for an error event", xtr);
}
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}
示例7: parseChildElement
import org.activiti.bpmn.model.Event; //导入依赖的package包/类
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (parentElement instanceof Event == false) return;
TimerEventDefinition eventDefinition = new TimerEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
try {
while (xtr.hasNext()) {
xtr.next();
if (xtr.isStartElement() && ATTRIBUTE_TIMER_DURATION.equalsIgnoreCase(xtr.getLocalName())) {
eventDefinition.setTimeDuration(xtr.getElementText());
break;
} else if (xtr.isStartElement() && ATTRIBUTE_TIMER_DATE.equalsIgnoreCase(xtr.getLocalName())) {
eventDefinition.setTimeDate(xtr.getElementText());
break;
} else if (xtr.isStartElement() && ATTRIBUTE_TIMER_CYCLE.equalsIgnoreCase(xtr.getLocalName())) {
eventDefinition.setTimeCycle(xtr.getElementText());
break;
} else if (xtr.isEndElement() && ELEMENT_EVENT_TIMERDEFINITION.equalsIgnoreCase(xtr.getLocalName())) {
break;
}
}
} catch (Exception e) {
LOGGER.warn("Error parsing timer event definition", e);
}
((Event) parentElement).getEventDefinitions().add(eventDefinition);
}