Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » BPEL Designer » Create BPEL Process
Create BPEL Process [message #559781] Sat, 18 September 2010 06:55 Go to next message
lamine  is currently offline lamine
Messages: 4
Registered: September 2010
Junior Member
I want to create bpel process using eclipse BPEL API,
I use this code :


BPELPackageImpl.init();
BPELPackage.eINSTANCE.eClass();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("bpel", new BPELResourceFactoryImpl());

URI uri1 = URI.createURI("examples/test_commonBaseEventLogger.bpel");
Factory f = reg.getFactory(uri1);
ResourceSet resSet = new ResourceSetImpl();
Resource resource = resSet.createResource(uri1) ;

BPELResourceImpl bpelResImp = (BPELResourceImpl) resource;

BPELFactory factory = BPELFactory.eINSTANCE;
process = factory.createProcess();
process.setName("xxxxx");
Sequence mySeq = BPELFactory.eINSTANCE.createSequence();
mySeq.setName("mainSequence");
Invoke myInv = BPELFactory.eINSTANCE.createInvoke();
Variable var = BPELFactory.eINSTANCE.createVariable();
myInv.setInputVariable(var);
process.setActivity(mySeq);
bpelResImp.getContents().add(process);
bpelResImp.save(null);

this exception occured :

java.lang.IllegalStateException: INamespaceMap cannot be attached to an eObject
at org.eclipse.bpel.model.util.BPELUtils.getNamespaceMap(BPELUt ils.java:260)
at org.eclipse.bpel.model.resource.BPELResourceImpl.doSave(BPEL ResourceImpl.java:88)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:993)
at ws.gen.BPELGenerator.createProc(BPELGenerator.java:245)
at ws.gen.BPELGenerator.main(BPELGenerator.java:268)



any help please ?
Re: Create BPEL Process [message #559980 is a reply to message #559781] Mon, 20 September 2010 11:34 Go to previous messageGo to next message
Robert Brodt is currently offline Robert Brodt
Messages: 592
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi lamine,

I'll need to do some digging to figure this out myself, unfortunately we are currently under a time crunch to finish up before code freeze this Wednesday. I'll be happy to take a look after that if you still need help with this.

Meanwhile, I'd suggest looking at the deployment editor:

org.eclipse.bpel.apache.ode.deploy.ui.editors.ODEDeployMulti PageEditor.java

have a look at populateModel() which initializes an empty BPEL process for cases where the original BPEL resource no longer exists. This may get you started.

Bob
Re: Create BPEL Process [message #590005 is a reply to message #559980] Tue, 21 September 2010 14:05 Go to previous messageGo to next message
lamine  is currently offline lamine
Messages: 4
Registered: September 2010
Junior Member
Hi Bob,
Thanks for your answer,
I will try with org.eclipse.bpel.apache.ode.deploy.ui.editors.ODEDeployMulti PageEditor.java until you will finish your work

my regards
Lamine
Re: Create BPEL Process [message #628979 is a reply to message #559980] Sat, 25 September 2010 05:44 Go to previous messageGo to next message
lamine  is currently offline lamine
Messages: 4
Registered: September 2010
Junior Member
Hi Bob

Can you give me the code that help me to create a bpel process file using
org.eclipse.bpel.apache.ode.deploy.ui.editors.ODEDeployMulti PageEditor and populateModel();

best regards
Re: Create BPEL Process [message #629259 is a reply to message #628979] Mon, 27 September 2010 11:42 Go to previous message
Robert Brodt is currently offline Robert Brodt
Messages: 592
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

You can check out the code from CVS here:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.bpel/pl ugins/?root=Technology_Project

Bob
Previous Topic:Develop new plugins from the BPEL designer source code
Next Topic:Implementing BPEL in LAN / workgroup
Goto Forum:
  


Current Time: Mon Sep 01 09:57:40 EDT 2014

Powered by FUDForum. Page generated in 0.01710 seconds