Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Loss of type information?
Loss of type information? [message #1773838] Thu, 05 October 2017 11:29
Bert Brecht is currently offline Bert BrechtFriend
Messages: 7
Registered: July 2016
Junior Member

im reading in my BPMN2 model

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<definitions xmlns="">
        <startEvent id="shape_IDHM1NDZCXAS2ZEIIENLWZJN4SJBN3A0T3OCC4E0BEWRNHFG1OAON" name="">
    <timerEventDefinition id="myTimerID"/>

via the following snipplet:

        Resource resource = new Bpmn2ResourceFactoryImpl().createResource(URI.createFileURI(fileUri));
        HashMap<Object, Object> options = new HashMap<>();
        options.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
        try {
        } catch (Exception featureNotFoundException) {
        DocumentRoot documentRoot =  (DocumentRoot) resource.getContents().get(0);

        for (RootElement rootElement : documentRoot.getDefinitions().getRootElements()) {
            if (rootElement instanceof org.eclipse.bpmn2.Process) {
                org.eclipse.bpmn2.Process targetProcess = (org.eclipse.bpmn2.Process) rootElement;
                for (FlowElement flowElement : targetProcess.getFlowElements()) {
                    if (flowElement instanceof StartEvent) {
                        StartEvent startEvent = (StartEvent) flowElement;
                        if (startEvent.getEventDefinitionRefs().get(0) instanceof TimerEventDefinition) {
                            System.out.println("all good!");
                        } else {

then, my code prints "why?", from my point of view it looks like a semantic loss or (more likely) what exactly Im doing wrong? From the BPMN2 spec, it seems to be valid to define an eventDefinition as a reference in <definitions> as well as to define it by value (nested) in the StartEvent in eventDefinitions.

Previous Topic:Pop-up sub-process
Next Topic:Extend Annotation
Goto Forum:

Current Time: Tue Jun 06 19:34:46 GMT 2023

Powered by FUDForum. Page generated in 0.02429 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top