[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [bpel-dev] Bpel process generation... help needed
|
First of all, all of the issues that you mention are pure EMF things ... so
you might want to read up on EMF and FileUris vsa. PlatformResource URIs a
little bit.
Second, I tried this code on my machine:
protected Process createBPEL(){
Process process = null;
try {
//create resource
URI uri = URI.createPlatformResourceURI(
"/myProject/myBPEL.bpel", false);
ResourceSet rSet = new ResourceSetImpl();
bpelResource = rSet.createResource(uri);
process = BPELFactory.eINSTANCE.createProcess();
process.setName("myBPEL");
Sequence mySeq = BPELFactory.eINSTANCE.createSequence();
mySeq.setName("mainSequence");
process.setActivity(mySeq);
bpelResource.getContents().add(process);
bpelResource.save(null);
}
catch (Exception e) {
e.printStackTrace();
}
return process;
}
And it worked like a charme. Note that you have to have a project called
"myProject" in your workspace in order to make this run.
Is it possible that you run outside of an eclipse workspace ? What version
of the BPELDesigner and what version of Eclipse are u using ?
Mit freundlichen Grüßen / Kind regards
Simon Moser
WebSphere BPM Architecture - Team Lead BPEL, BSM & Selector Editors
IBM Software Group, Application and Integration Middleware Software
Business Process Solutions Development 1
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-4304
Fax: +49-7031-16-4890
E-Mail: smoser@xxxxxxxxxx
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH / Vorsitzender des
Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht
Stuttgart, HRB 243294
From: Adnan <adnust@xxxxxxxxx>
To: "BPEL Designer project developer discussions." <bpel-dev@xxxxxxxxxxx>
Date: 04.05.2010 17:25
Subject: Re: [bpel-dev] Bpel process generation... help needed
Sent by: bpel-dev-bounces@xxxxxxxxxxx
sorry could not complete the last message.
and that gave me this exception (commented code)
java.lang.IllegalStateException: INamespaceMap cannot be attached to an
eObject
at org.eclipse.bpel.model.util.BPELUtils.getNamespaceMap(BPELUtils.java:261
)
at org.eclipse.bpel.model.resource.BPELWriter.createBPELElement(
BPELWriter.java:2383)
at org.eclipse.bpel.model.resource.BPELWriter.process2XML(
BPELWriter.java:493)
at org.eclipse.bpel.model.resource.BPELWriter.resource2XML(
BPELWriter.java:485)
at org.eclipse.bpel.model.resource.BPELWriter.write(BPELWriter.java:318)
at com.al.soco.mbt.bpel.BpelGenerator.genbb(BpelGenerator.java:73)
at com.al.soco.mbt.bpel.BpelGenerator.main(BpelGenerator.java:259)
regards,
----
AL
From: Simon D Moser <SMOSER@xxxxxxxxxx>
To: BPEL Designer project developer discussions. <bpel-dev@xxxxxxxxxxx>
Cc: bpel-dev@xxxxxxxxxxx; bpel-dev-bounces@xxxxxxxxxxx
Sent: Tue, 4 May, 2010 16:17:23
Subject: Re: [bpel-dev] Bpel process generation... help needed
Some sample code that should help you ...
protected Process createBPEL(){
Process process = null;
try {
//create resource
URI uri = URI.createPlatformResourceURI(
"/myProject/myBPEL.bpel", false);
bpelResource = getResourceSet().createResource(uri);
process = BPELFactory.eINSTANCE.createProcess();
process.setName("myBPEL");
Sequence mySeq = BPELFactory.eINSTANCE.createSequence();
mySeq.setName("mainSequence");
process.setActivity(mySeq);
bpelResource.getContents().add(process);
bpelResource.save(null);
}
catch (Exception e) {
e.printStackTrace();
}
return process;
}
You dont have to call the writer explicitly ... calling bpelResource.save()
should do the trick
Mit freundlichen Grüßen / Kind regards
Simon Moser
WebSphere BPM Architecture - Team Lead BPEL, BSM & Selector Editors
IBM Software Group, Application and Integration Middleware Software
Business Process Solutions Development 1
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-4304
Fax: +49-7031-16-4890
E-Mail: smoser@xxxxxxxxxx
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH / Vorsitzender des
Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht
Stuttgart, HRB 243294
|------------>
| From: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Adnan <adnust@xxxxxxxxx>
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|bpel-dev@xxxxxxxxxxx
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|04.05.2010 13:19
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|[bpel-dev] Bpel process generation... help needed
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|bpel-dev-bounces@xxxxxxxxxxx
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
Hi,
I want to generate the bpel process (xml), I tried to roam around the
classes like BPELWriter, BPELFactoryImpl, BPELResourceImpl etc...
What I am trying to do is that creating Process and its children form
BPELFactoryImpl and then want to use write(BPELResource, OutputStream)
method.
first am i assuming it right and second how can i add Process to
BPELResource
regards,
----
AL
_______________________________________________
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
_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev