gpt4 book ai didi

java - 以编程方式生成 BPEL 文件?

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:15:53 26 4
gpt4 key购买 nike

有没有办法在 Java 中以编程方式生成 BPEL?

我尝试使用 BPEL Eclipse Designer 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 可以提供帮助吗?

最佳答案

你可能想给 JAXB一试。它可以帮助您将官方 BPEL XSD 转换为 Java 类。您可以使用这些类来构建您的 BPEL 文档并输出它。

关于java - 以编程方式生成 BPEL 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15353097/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com