Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [bpel-dev] BPEL Parsing

Hi Simon,

Thank you for help.
I just tried your code and after a big dependencies problems i noticed that there are some restriction to the use of some libraries
like : org.eclipse.bpel.model.resource.BPELResourceSetImpl;
or even i find that in the bpel.ui.util there is the class BPELReader, i wanted to use it and specially use the read(..) method the samething there is restriction rule for using this class i remind that i created a new plugin project with the all necessary plugin dependencies concerning eclipse.bpel and other emf stuff also one another thing some packages won't be found with just org.eclipse.bepel.* but we have to add the bin in front to be bin.org.eclipse.bpel.*
Thank you
Iyad




Simon D Moser wrote:
Hi Iyad,

here's some sample code to do this: Write your own eclipse plugin, and
**assuming ** your file is in your eclipse runtime workspace, this can be
done as follows:

      IPath path = new Path("/pathToMyBPELFile/myFile.bpel");
      IFile bpelFile = ResourcesPlugin.:getWorkspace().getRoot().getFile
(path);
      loadBPEL(bpelFile);).


      protected Process loadBPEL(IFile bpelFile) {

            ResourceSet fResourceSet = new BPELResourceSetImpl();

            IPath fullProcessPath = bpelFile.getFullPath();
            URI uri = URI.createPlatformResourceURI
(fullProcessPath.toString(), false);
            bpelResource = fResourceSet.getResource(uri, true);

            EcorePackage instance = EcorePackage.eINSTANCE;
            instance.eAdapters();

            try {
                  bpelResource.load(Collections.EMPTY_MAP);
                  EList<EObject> contents = bpelResource.getContents();
                  if (!contents.isEmpty()) {
                        return (Process) contents.get(0);
                  }
            } catch (Exception e) {
                  e.printStackTrace();
            }

            return null;

      }


Similar code exists in the loadModel() method of the BPELEditor class in
the bpel.ui plugin. Now you have the EMF Process-root EObject, that has the
in-memory representation of this. You can now read/modify this using
standard EMF methods.
For each EMF object (such as Process) there is also a method getElement()
which returns you the DOM Element - not sure why you'd need that though.
Parsing with EMF is much more conveniant. Let me know if that answered your
question.

Mit freundlichen Grüßen / Kind regards

Simon Daniel Moser

Team Lead BPEL Editor - Websphere Integration Developer (WID)
IBM Software Group, Application and Integration Middleware Software
Business Process Solutions Development 1
Phone: +49-7031-16-4304 IBM Deutschland (Embedded image moved to file: pic14969.gif) Fax: +49-7031-16-4890 Schoenaicher Str. 220 E-Mail: smoser@xxxxxxxxxx 71032 Boeblingen Germany IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294



From: iyad alshabani <iyad.alshabani@xxxxxxxxx> To: "BPEL Designer project developer discussions." <bpel-dev@xxxxxxxxxxx> Date: 08/07/2009 12:22 PM Subject: [bpel-dev] BPEL Parsing Sent by: bpel-dev-bounces@xxxxxxxxxxx




Hello
I'm new to BPEL designer project ,
I'm working on a project wich will use the BPEL designer, what i need is
how to parse a .bpel file generated by the BPEL designer or other tool?
and where is it handled? I have seen some examples using the Process as
the main object for BPEL file using the Ecore model of  BPEL and what
about DOM representation?

Does any one have an example ?

Thank you for help.
_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev
------------------------------------------------------------------------

------------------------------------------------------------------------

_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev



Back to the top