本文整理汇总了Java中org.eclipse.bpmn2.InclusiveGateway类的典型用法代码示例。如果您正苦于以下问题:Java InclusiveGateway类的具体用法?Java InclusiveGateway怎么用?Java InclusiveGateway使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InclusiveGateway类属于org.eclipse.bpmn2包,在下文中一共展示了InclusiveGateway类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUnsupportedElementTypes
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
/**
* Returns a list with the names of the BPMN 2.0 elements that are currently
* not supported by the analysis.
*
* @return A List with the names of the unsupported elements as Strings.
*/
private List<String> getUnsupportedElementTypes() {
List<String> res = new ArrayList<String>();
for (EObject object : getDiagram().eResource().getContents()) {
if (object instanceof SubProcess || object instanceof CallActivity
|| object instanceof InclusiveGateway
|| object instanceof BoundaryEvent) {
res.add(object.getClass().getSimpleName());
}
}
// remove duplicates
HashSet<String> h = new HashSet<String>(res);
res.clear();
res.addAll(h);
return res;
}
示例2: createDefaultFlow
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
public static void createDefaultFlow(EObject object, XMLStreamWriter xtw) throws Exception {
SequenceFlow defaultFlow = null;
if(object instanceof Activity) {
defaultFlow = ((Activity) object).getDefault();
} else if(object instanceof ExclusiveGateway) {
defaultFlow = ((ExclusiveGateway) object).getDefault();
} else if(object instanceof InclusiveGateway) {
defaultFlow = ((InclusiveGateway) object).getDefault();
}
else {
throw new Exception("Invalid default flow chosen. Expected 'Activity', " +
"'ExclusiveGateway', 'InclusiveGateway', but got: '" + defaultFlow);
}
if(defaultFlow != null) {
xtw.writeAttribute("default", defaultFlow.getId());
}
}
示例3: gatewayToSVG
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
private String gatewayToSVG(BPMNShape bpmnShape) {
if (getBaseElement(bpmnShape.getBpmnElement()) instanceof ParallelGateway) {
return CommonNodeToSVG(bpmnShape, new SvgParallelGatewayTo());
}
if (getBaseElement(bpmnShape.getBpmnElement()) instanceof ComplexGateway) {
return CommonNodeToSVG(bpmnShape, new SvgComplexGatewayTo());
}
if (getBaseElement(bpmnShape.getBpmnElement()) instanceof ExclusiveGateway) {
return CommonNodeToSVG(bpmnShape, new SvgExclusiveGatewayTo());
}
if (getBaseElement(bpmnShape.getBpmnElement()) instanceof InclusiveGateway) {
return CommonNodeToSVG(bpmnShape, new SvgInclusiveGatewayTo());
}
return "";
}
示例4: applyGatewayProperties
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
protected void applyGatewayProperties(Gateway gateway,
Map<String, String> properties) {
if (properties.get("name") != null && properties.get("name").length() > 0) {
gateway.setName(StringEscapeUtils.escapeXml(properties.get("name")).replaceAll("\\r\\n|\\r|\\n",
" "));
// add unescaped and untouched name value as extension element as well
Utils.setMetaDataExtensionValue(gateway,
"elementname",
wrapInCDATABlock(properties.get("name").replaceAll("\\\\n",
"\n")));
} else {
gateway.setName("");
}
if (properties.get("defaultgate") != null && (gateway instanceof InclusiveGateway || gateway instanceof ExclusiveGateway)) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools",
"dg",
false,
false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
properties.get("defaultgate"));
gateway.getAnyAttribute().add(extensionEntry);
}
}
示例5: marshallInclusiveGateway
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
protected void marshallInclusiveGateway(InclusiveGateway gateway,
BPMNPlane plane,
JsonGenerator generator,
float xOffset,
float yOffset,
Map<String, Object> flowElementProperties) throws JsonGenerationException, IOException {
if (gateway.getDefault() != null) {
SequenceFlow defsf = gateway.getDefault();
String defGatewayStr = "";
if (defsf.getName() != null && defsf.getName().length() > 0) {
defGatewayStr = defsf.getName() + " : " + defsf.getId();
} else {
defGatewayStr = defsf.getId();
}
flowElementProperties.put("defaultgate",
defGatewayStr);
}
marshallNode(gateway,
flowElementProperties,
"InclusiveGateway",
plane,
generator,
xOffset,
yOffset);
}
示例6: parseInclusiveGateway
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
private InclusiveGateway parseInclusiveGateway(XMLStreamReader xtr) {
InclusiveGateway inclusiveGateway = Bpmn2Factory.eINSTANCE
.createInclusiveGateway();
String name = xtr.getAttributeValue(null, "name");
if (name != null) {
inclusiveGateway.setName(name);
} else {
inclusiveGateway.setName(xtr.getAttributeValue(null, "id"));
}
if (xtr.getAttributeValue(null, "default") != null) {
defaultFlowMap.put(inclusiveGateway,
xtr.getAttributeValue(null, "default"));
}
return inclusiveGateway;
}
示例7: create
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
public Object[] create(ICreateContext context) {
InclusiveGateway inclusiveGateway = Bpmn2Factory.eINSTANCE.createInclusiveGateway();
inclusiveGateway.setId(getNextId());
inclusiveGateway.setName("Inclusive Gateway");
Object parentObject = getBusinessObjectForPictogramElement(context.getTargetContainer());
if (parentObject instanceof SubProcess) {
((SubProcess) parentObject).getFlowElements().add(inclusiveGateway);
} else {
getDiagram().eResource().getContents().add(inclusiveGateway);
}
addGraphicalContent(inclusiveGateway, context);
return new Object[] { inclusiveGateway };
}
示例8: clone
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
public static FlowElement clone(final FlowElement element, final Diagram diagram) {
if (element instanceof StartEvent) {
return clone((StartEvent) element, diagram);
} else if (element instanceof ServiceTask) {
return clone((ServiceTask) element, diagram);
} else if (element instanceof EndEvent) {
return clone((EndEvent) element, diagram);
} else if (element instanceof ExclusiveGateway) {
return clone((ExclusiveGateway) element, diagram);
} else if (element instanceof InclusiveGateway) {
return clone((InclusiveGateway) element, diagram);
} else if (element instanceof MailTask) {
return clone((MailTask) element, diagram);
} else if (element instanceof ManualTask) {
return clone((ManualTask) element, diagram);
} else if (element instanceof ParallelGateway) {
return clone((ParallelGateway) element, diagram);
} else if (element instanceof ScriptTask) {
return clone((ScriptTask) element, diagram);
} else if (element instanceof UserTask) {
return clone((UserTask) element, diagram);
}
return null;
}
示例9: addGatewayButtons
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
private void addGatewayButtons(ContextButtonEntry otherElementButton, Gateway notGateway, CustomContext customContext) {
if(notGateway == null || !(notGateway instanceof ExclusiveGateway)) {
addContextButton(otherElementButton, new ChangeElementTypeFeature(getFeatureProvider(), "exclusivegateway"), customContext,
"Change to exclusive gateway", "Change to an exclusive gateway", ActivitiImageProvider.IMG_GATEWAY_EXCLUSIVE);
}
if(notGateway == null || !(notGateway instanceof InclusiveGateway)) {
addContextButton(otherElementButton, new ChangeElementTypeFeature(getFeatureProvider(), "inclusivegateway"), customContext,
"Change to inclusive gateway", "Change to an inclusive gateway", ActivitiImageProvider.IMG_GATEWAY_INCLUSIVE);
}
if(notGateway == null || !(notGateway instanceof ParallelGateway)) {
addContextButton(otherElementButton, new ChangeElementTypeFeature(getFeatureProvider(), "parallelgateway"), customContext,
"Change to parallel gateway", "Change to a parallel gateway", ActivitiImageProvider.IMG_GATEWAY_PARALLEL);
}
}
示例10: getText
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((InclusiveGateway) object).getName();
return label == null || label.length() == 0 ? getString("_UI_InclusiveGateway_type")
: getString("_UI_InclusiveGateway_type") + " " + label;
}
示例11: basicSetInclusiveGateway
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInclusiveGateway(
InclusiveGateway newInclusiveGateway, NotificationChain msgs) {
return ((FeatureMap.Internal) getMixed()).basicAdd(
Bpmn2Package.Literals.DOCUMENT_ROOT__INCLUSIVE_GATEWAY,
newInclusiveGateway, msgs);
}
示例12: setDefaultGateway
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
private void setDefaultGateway(FlowElement fe,
List<SequenceFlow> sqList) {
Iterator<FeatureMap.Entry> iter = fe.getAnyAttribute().iterator();
while (iter.hasNext()) {
FeatureMap.Entry entry = iter.next();
if (entry.getEStructuralFeature().getName().equals("dg")) {
for (SequenceFlow newFlow : sqList) {
String entryValue = (String) entry.getValue();
String entryValueId = "";
String[] entryValueParts = entryValue.split(" : ");
if (entryValueParts.length == 1) {
entryValueId = entryValueParts[0];
} else if (entryValueParts.length > 1) {
entryValueId = entryValueParts[1];
}
if (newFlow.getId().equals(entryValueId)) {
if (fe instanceof ExclusiveGateway) {
((ExclusiveGateway) fe).setDefault(newFlow);
} else if (fe instanceof InclusiveGateway) {
((InclusiveGateway) fe).setDefault(newFlow);
}
if (newFlow.getConditionExpression() == null) {
FormalExpression expr = Bpmn2Factory.eINSTANCE.createFormalExpression();
expr.setBody("");
newFlow.setConditionExpression(expr);
}
}
}
}
}
}
示例13: setFriendlyIds
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
private void setFriendlyIds() {
Map<String, Integer> idMap = new HashMap<String, Integer>();
for (FlowElement flowElement : bpmnParser.bpmnList) {
if(StringUtils.isEmpty(flowElement.getId()) == false &&
flowElement.getId().matches("sid-\\w{4,12}-\\w{4,12}-\\w{4,12}-\\w{4,12}-\\w{4,12}") == false) {
continue;
}
if(flowElement instanceof StartEvent) {
flowElement.setId(getNextId("startevent", idMap));
} else if(flowElement instanceof EndEvent) {
if(((EndEvent) flowElement).getEventDefinitions().size() > 0) {
flowElement.setId(getNextId("errorendevent", idMap));
} else {
flowElement.setId(getNextId("endevent", idMap));
}
} else if(flowElement instanceof ExclusiveGateway) {
flowElement.setId(getNextId("exclusivegateway", idMap));
} else if(flowElement instanceof InclusiveGateway) {
flowElement.setId(getNextId("inclusivegateway", idMap));
} else if(flowElement instanceof ParallelGateway) {
flowElement.setId(getNextId("parallelgateway", idMap));
} else if(flowElement instanceof UserTask) {
flowElement.setId(getNextId("usertask", idMap));
} else if(flowElement instanceof ScriptTask) {
flowElement.setId(getNextId("scripttask", idMap));
} else if(flowElement instanceof ServiceTask) {
flowElement.setId(getNextId("servicetask", idMap));
} else if(flowElement instanceof ManualTask) {
flowElement.setId(getNextId("manualtask", idMap));
} else if(flowElement instanceof ReceiveTask) {
flowElement.setId(getNextId("receivetask", idMap));
} else if(flowElement instanceof BusinessRuleTask) {
flowElement.setId(getNextId("businessruletask", idMap));
} else if(flowElement instanceof MailTask) {
flowElement.setId(getNextId("mailtask", idMap));
} else if(flowElement instanceof BoundaryEvent) {
if(((BoundaryEvent) flowElement).getEventDefinitions().size() > 0) {
EventDefinition definition = ((BoundaryEvent) flowElement).getEventDefinitions().get(0);
if(definition instanceof ErrorEventDefinition) {
flowElement.setId(getNextId("boundaryerror", idMap));
} else {
flowElement.setId(getNextId("boundarytimer", idMap));
}
}
} else if(flowElement instanceof CallActivity) {
flowElement.setId(getNextId("callactivity", idMap));
} else if(flowElement instanceof SubProcess) {
flowElement.setId(getNextId("subprocess", idMap));
}
}
}
示例14: getAddFeature
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
@Override
public IAddFeature getAddFeature(IAddContext context) {
// is object for add request a EClass?
if (context.getNewObject() instanceof StartEvent) {
if(context.getNewObject() instanceof AlfrescoStartEvent) {
return new AddAlfrescoStartEventFeature(this);
} else {
if(((StartEvent) context.getNewObject()).getEventDefinitions().size() > 0) {
return new AddTimerStartEventFeature(this);
} else {
return new AddStartEventFeature(this);
}
}
// <SecureBPMN>
} else if (context.getNewObject() instanceof BindingOfDuty) {
return new AddSecurityBodFeature(this);
} else if (context.getNewObject() instanceof SeparationOfDuty) {
return new AddSecuritySodFeature(this);
// </SecureBPMN>
} else if (context.getNewObject() instanceof EndEvent) {
if(((EndEvent) context.getNewObject()).getEventDefinitions().size() > 0) {
return new AddErrorEndEventFeature(this);
} else {
return new AddEndEventFeature(this);
}
} else if (context.getNewObject() instanceof SequenceFlow) {
return new AddSequenceFlowFeature(this);
// <SecureBPMN>
} else if (context.getNewObject() instanceof SecurityFlow) {
return new AddSecurityFlowFeature(this);
// </SecureBPMN>
} else if (context.getNewObject() instanceof UserTask) {
if(context.getNewObject() instanceof AlfrescoUserTask) {
return new AddAlfrescoUserTaskFeature(this);
} else {
return new AddUserTaskFeature(this);
}
} else if (context.getNewObject() instanceof ScriptTask) {
return new AddScriptTaskFeature(this);
} else if (context.getNewObject() instanceof ServiceTask) {
return new AddServiceTaskFeature(this);
} else if (context.getNewObject() instanceof MailTask) {
if(context.getNewObject() instanceof AlfrescoMailTask) {
return new AddAlfrescoMailTaskFeature(this);
} else {
return new AddMailTaskFeature(this);
}
} else if (context.getNewObject() instanceof ManualTask) {
return new AddManualTaskFeature(this);
} else if (context.getNewObject() instanceof ReceiveTask) {
return new AddReceiveTaskFeature(this);
} else if (context.getNewObject() instanceof BusinessRuleTask) {
return new AddBusinessRuleTaskFeature(this);
} else if (context.getNewObject() instanceof ExclusiveGateway) {
return new AddExclusiveGatewayFeature(this);
} else if (context.getNewObject() instanceof InclusiveGateway) {
return new AddInclusiveGatewayFeature(this);
} else if (context.getNewObject() instanceof ParallelGateway) {
return new AddParallelGatewayFeature(this);
} else if (context.getNewObject() instanceof BoundaryEvent) {
if(((BoundaryEvent) context.getNewObject()).getEventDefinitions().size() > 0) {
EventDefinition definition = ((BoundaryEvent) context.getNewObject()).getEventDefinitions().get(0);
if(definition instanceof ErrorEventDefinition) {
return new AddBoundaryErrorFeature(this);
} else {
return new AddBoundaryTimerFeature(this);
}
}
} else if (context.getNewObject() instanceof IntermediateCatchEvent) {
return new AddTimerCatchingEventFeature(this);
} else if (context.getNewObject() instanceof SubProcess) {
return new AddEmbeddedSubProcessFeature(this);
} else if (context.getNewObject() instanceof CallActivity) {
return new AddCallActivityFeature(this);
} else if (context.getNewObject() instanceof AlfrescoScriptTask) {
return new AddAlfrescoScriptTaskFeature(this);
}
return super.getAddFeature(context);
}
示例15: caseInclusiveGateway
import org.eclipse.bpmn2.InclusiveGateway; //导入依赖的package包/类
@Override
public Adapter caseInclusiveGateway(InclusiveGateway object) {
return createInclusiveGatewayAdapter();
}