本文整理汇总了Java中org.eclipse.bpmn2.util.Bpmn2Resource类的典型用法代码示例。如果您正苦于以下问题:Java Bpmn2Resource类的具体用法?Java Bpmn2Resource怎么用?Java Bpmn2Resource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bpmn2Resource类属于org.eclipse.bpmn2.util包,在下文中一共展示了Bpmn2Resource类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBpmnDiagram
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
private Resource createBpmnDiagram(URI diagramUri) throws CoreException {
final Bpmn2Resource resource = Bpmn2DiagramCreator.createBpmn2Resource(diagramUri);
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
resource.save(null);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to save file", e));
}
}
}, new NullProgressMonitor());
return resource;
}
示例2: getIncomingConversationLinks
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* Virtual opposite of {@link ConversationLink#getTargetRef()}.
* For general information about virtual opposites see {@link CategoryValueImpl#getCategorizedFlowElements()}
* <!-- end-user-doc -->
* @generated NOT
*/
public List<ConversationLink> getIncomingConversationLinks() {
if (eResource() instanceof Bpmn2Resource) {
return ((Bpmn2Resource) eResource()).getOppositeReferenceAdapter().getOppositeList(
ConversationLink.class, this,
Bpmn2Package.Literals.CONVERSATION_LINK__TARGET_REF);
}
throw new UnsupportedOperationException();
}
示例3: getOutgoingConversationLinks
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* Virtual opposite of {@link ConversationLink#getSourceRef()}.
* For general information about virtual opposites see {@link CategoryValueImpl#getCategorizedFlowElements()}
* <!-- end-user-doc -->
* @generated NOT
*/
public List<ConversationLink> getOutgoingConversationLinks() {
if (eResource() instanceof Bpmn2Resource) {
return ((Bpmn2Resource) eResource()).getOppositeReferenceAdapter().getOppositeList(
ConversationLink.class, this,
Bpmn2Package.Literals.CONVERSATION_LINK__SOURCE_REF);
}
throw new UnsupportedOperationException();
}
示例4: save
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
/**
* 测试方法 不可用
* @param defintion
*/
public void save(Definitions defintion){
ResourceSet resourceSet = getResourceSet();
Bpmn2Resource resource = (Bpmn2Resource) resourceSet.getResource(URI.createFileURI("d:\\node_template.bpmn"), true);
DocumentRoot documentRoot = (DocumentRoot) resource.getContents().get(0);
documentRoot.setDefinitions(defintion);
try {
resource.save(null);
} catch (IOException e) {
e.printStackTrace();
}
}
示例5: unmarshall
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
public Bpmn2Resource unmarshall(String json,
String preProcessingData) throws JsonParseException, IOException {
return unmarshall(new JsonFactory().createJsonParser(json),
preProcessingData);
}
示例6: getCategorizedFlowElements
import org.eclipse.bpmn2.util.Bpmn2Resource; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* Returns a computed list of flow elements where {@link FlowElement#getCategoryValueRef()}
* contains this CategoryValue.
*
* This object has to be contained in a BPMN2 resource. The resource needs to have attached a
* {@linkplain Bpmn2Resource#getOppositeReferenceAdapter() OppositeReferenceAdapter} that
* observes (probably among others) the reference {@link FlowElement#getCategoryValueRef()},
* which is the default state.
*
* The result only includes those FlowElements that are contained in the same resource or
* resource set.
* <!-- end-user-doc -->
* @generated NOT
*/
public List<FlowElement> getCategorizedFlowElements() {
if (eResource() instanceof Bpmn2Resource) {
return ((Bpmn2Resource) eResource()).getOppositeReferenceAdapter()
.getOppositeList(FlowElement.class, this,
Bpmn2Package.Literals.FLOW_ELEMENT__CATEGORY_VALUE_REF);
}
throw new UnsupportedOperationException();
}