3 Replies Latest reply on Jan 11, 2012 1:31 AM by luhong

    two questions about bpmn2 file

    luhong

      Hi,

       

      Q1, The suffix of bpmn2 file is .bpmn2 in the jbpm-bpmn2-5.2.0.Final-test.jar. but the suffix of bpmn2 files which are created by BPMN2 visual editor is .bpmn?

       

      Q2, In the bpmn2 file of  jbpm-bpmn2-5.2.0.Final-test.jar, the process definition tags don't have any namespace and the files couldn't opened by visual editor correctly. as below:

      <process processType="Private" isExecutable="true" id="ScriptTask" name="ScriptTask Process" tns:packageName="com.sample" >

          <!-- nodes -->
          <startEvent id="_1" name="StartProcess" />
          <scriptTask id="_2" name="Hello" scriptFormat="http://www.java.com/java" >
            <script>System.out.println("Hello World");</script>
          </scriptTask>
          <endEvent id="_3" name="EndProcess" >
              <terminateEventDefinition/>
          </endEvent>

          <!-- connections -->
          <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
          <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />

        </process>

       

      But in the files created by BPMN2 visual editor, there are namespace bpmn2. as below:

      <bpmn2:process id="com.test.login" name="loginProcess" isClosed="true">

          <bpmn2:parallelGateway id="ParallelGateway_1" gatewayDirection="Diverging">

            <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>

            <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>

            <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>

          </bpmn2:parallelGateway>

          <bpmn2:sequenceFlow id="SequenceFlow_2" name="to1" sourceRef="ParallelGateway_1" targetRef="ScriptTask_1"/>

          <bpmn2:sequenceFlow id="SequenceFlow_8" name="to2" sourceRef="ParallelGateway_1" targetRef="ScriptTask_2"/>

          <bpmn2:startEvent id="StartEvent_1" name="Start">

            <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>

          </bpmn2:startEvent>

          <bpmn2:sequenceFlow id="SequenceFlow_3" name="to0" sourceRef="StartEvent_1" targetRef="ParallelGateway_1"/>

          <bpmn2:scriptTask id="ScriptTask_2" name="Script Task">

            <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>

            <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>

            <bpmn2:script>System.out.println(&quot;hello world2&quot;);</bpmn2:script>

          </bpmn2:scriptTask>

          <bpmn2:sequenceFlow id="SequenceFlow_10" name="to4" sourceRef="ScriptTask_2" targetRef="EndEvent_2"/>

          <bpmn2:scriptTask id="ScriptTask_1" name="Script Task" scriptFormat="">

            <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>

            <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>

            <bpmn2:script>System.out.println(&quot;hello world&quot;);</bpmn2:script>

          </bpmn2:scriptTask>

          <bpmn2:sequenceFlow id="SequenceFlow_6" name="to3" sourceRef="ScriptTask_1" targetRef="EndEvent_1"/>

          <bpmn2:endEvent id="EndEvent_1" name="End">

            <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>

          </bpmn2:endEvent>

          <bpmn2:endEvent id="EndEvent_2" name="End">

            <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>

          </bpmn2:endEvent>

        </bpmn2:process>

       

      Which one is right?

       

      p.s. the bpmn2 visual editor means bpmn2 eclipse plugin. Thanks very much.

        • 1. Re: two questions about bpmn2 file
          luhong

          Do I use a wrong visual editor

          • 2. Re: two questions about bpmn2 file
            tsurdilovic

            Good questions.

             

            >> Q1, The suffix of bpmn2 file is .bpmn2 in the jbpm-bpmn2-5.2.0.Final-test.jar. but the suffix of bpmn2 files which are created by BPMN2 visual editor is .bpmn? <<

             

            Both .bpmn and .bpmn2 are valid file extensions and are interchangeable. The runtime can handle one or the other or both.

             

            >> Q2, In the bpmn2 file of  jbpm-bpmn2-5.2.0.Final-test.jar, the process definition tags don't have any namespace and the files couldn't opened by visual editor correctly. as below: <<

             

            The reason for namespaces being added by the jBPM Web Designer is that it uses a different parser than the Eclipse tooling. Both generate however valid BPMN2. Designer is able to open processes created in Eclipse and vice versa. If your process for some reason does not show, the existence or non-existent of namespaces is not the issue, there is something else going on. Please check the server logs and report back..we'll be happy to try to help you resolve problems.

             

            As far as which editor to use, that is really your decision given your requirements. Eclipse editor is targeting developers using Eclipse where as Designer targets both developers and business users, is web-based and is integrated with Guvnor which brings a ton of extra features.

             

            Hope this helps.


            • 3. Re: two questions about bpmn2 file
              luhong

              Hi, Tihomir

               

              Thanks for your reply.

               

              And I found out what the cause of problem is. It looked like visual editor can't open a .bpmn2 file from an archive jar file. After unarchive the jar file, the editro worked well.

               

              The exception log:

              org.eclipse.ui.PartInitException: Unknown editor input: org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput@17d5f1e
              at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.init(DiagramEditorInternal.java:1085)
              at org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor.init(BPMN2Editor.java:106)
              at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:828)
              at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
              at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
              at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
              at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
              at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
              at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
              at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
              at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
              at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
              at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
              at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
              at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
              at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:368)
              at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:174)
              at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
              at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
              at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
              at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
              at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50)
              at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
              at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)
              at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
              at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
              at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
              at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
              at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
              at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
              at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
              at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
              at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
              at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
              at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
              at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
              at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
              at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
              at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
              at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
              at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
              at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
              at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
              at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
              at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
              at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
              at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
              at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
              at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
              at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
              at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
              at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
              at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
              at org.eclipse.equinox.launcher.Main.run(Main.java:1410)