有没有一种方法在Java中以编程方式生成BPEL?以编程方式生成BPEL文件?
我尝试使用BPEL的Eclipse设计的API来编写代码:
Process process = null;
try {
Resource.Factory.Registry reg =Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("bpel", new BPELResourceFactoryImpl());//it works with XMLResourceFactoryImpl()
//create resource
URI uri =URI.createFileURI("myBPEL2.bpel");
ResourceSet rSet = new ResourceSetImpl();
Resource bpelResource = rSet.createResource(uri);
//create/populate process
process = BPELFactory.eINSTANCE.createProcess();
process.setName("myBPEL");
Sequence mySeq = BPELFactory.eINSTANCE.createSequence();
mySeq.setName("mainSequence");
process.setActivity(mySeq);
//save resource
bpelResource.getContents().add(process);
Map<String,String> map= new HashMap<String, String>();
map.put("bpel", "http://docs.oasis-open.org/wsbpel/2.0/process/executable");
map.put("tns", "http://matrix.bpelprocess");
map.put("xsd", "http://www.w3.org/2001/XMLSchema");
bpelResource.save(map);
}
catch (Exception e) {
e.printStackTrace();
}
}
但是我收到一个错误:
INamespaceMap cannot be attached to an eObject
...
我西蒙读this message:
I understand that using the BPEL model outside of eclipse might be desirable, but it was never intended by us. Thus, this isn't supported
有没有其他API可以帮助?
http://www.eclipse.org/forums/index.php/m/1015906/与你所看到的差不多。你已经遇到过吗?也许你应该坚持在日食论坛上寻找像你这样的问题。在其他人能够帮助你的概率比在这里stackoverflow。 – SpaceTrucker 2013-03-13 08:41:36