How to generate .bpel programmatically ??

Showing 1-3 of 3 messages
How to generate .bpel programmatically ?? Farida Sabry 3/4/13 1:08 AM
Have anyone managed to do this task .. I am trying to do the same to dynamically create a bpel process and deploy based on some inputs.. I tried the code mentioned
here (after importing a lot of jar files from eclipse plugins folder) but
with :
rSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
.put("bpel", new BPELResourceFactoryImpl());
instead of "xml" .....
and I am receiving the following exception:
java.lang.IllegalStateException: INamespaceMap cannot be attached to an eObject
at org.eclipse.bpel.model.util.BPELUtils.getNamespaceMap(BPELUtils.java:271)
at org.eclipse.bpel.model.resource.BPELResourceImpl.doSave(BPELResourceImpl.java:101)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1417)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:986)
at BPELCreator.createBPEL(BPELCreator.java:34)

Do you know how to solve this problem?? And if in the first sense, the org.eclipse.bpel.model API can be used programmatically to generate .bpel files??
Re: How to generate .bpel programmatically ?? Areeg Samir 5/8/13 8:07 PM
Check this answers may it help you:
http://www.oracle.com/technetwork/testcontent/orabpel-tutorial7-invokingbpelproce-131933.pdf
http://stackoverflow.com/questions/15353097/generating-bpel-files-programmatically
http://stackoverflow.com/questions/5166287/framework-for-generating-bpel-in-runtime

Also you can try this code by Rajesh :
                 File bpelFile = new File("C:/temp_videos/echo_1.bpel");
                 URI bpelURI = new URI("file:///C:/temp_videos/echo_1.bpel");
                 FileInputStream fis = new FileInputStream(bpelFile);
                 javax.swing.text.Document myDocument=myloadSwingDocument(fis);
                 Lookup lookup = Lookups.fixed(new Object[]{bpelFile, myDocument,
                                 myCatalogModel.getDefault(),});
                 ModelSource source = new ModelSource(lookup,true);

                BpelModelFactory factory =
                Lookup.getDefault().lookup(BpelModelFactory.class);
                BpelModel model = factory.getModel (source);
                Process myProcess = model.getProcess();
               
                 myProcess.setName("NewProcess") ;
Please tell me if this help you.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: How to generate .bpel programmatically ?? Touhami Ben Aissa 4/8/14 10:42 AM
Hi,
I'm looking for a solution to generate Java class from a BPEL process and I read that I can use BPEL2JAVA but I don't know how to use it , so if any one can help me I'll be gratefull.