How to generate .bpel programmatically ??

222 views
Skip to first unread message

Farida Sabry

unread,
Mar 4, 2013, 4:08:48 AM3/4/13
to bpelunde...@googlegroups.com
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??

Areeg Samir

unread,
May 8, 2013, 11:07:09 PM5/8/13
to bpelunde...@googlegroups.com
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.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Touhami Ben Aissa

unread,
Apr 8, 2014, 1:42:29 PM4/8/14
to bpelunde...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages