Skip to main content

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

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

Attachment: pic14969.gif
Description: GIF image


Back to the top