Hi Michele,
Here is a sample snippet. uriBPELFile is the URI to the BPEL file
ResourceFinder bpelResourceFinder = new DefaultResourceFinder();
// build the input stream
InputStream bpelFileIS = bpelResourceFinder
.openResource(uriBPELFile);
m_bpelFile = new File(uriBPELFile);
// parse the document
Document bpelDocument =
DOMUtils.parse(bpelFileIS);
// get the process node
NodeList processNodes = bpelDocument
.getElementsByTagName("process");
// Assuming only one process element
Node processElement = processNodes.item(0);
// create the Process Object
m_bpelProcessBOM = new Process((Element)
processElement);
m_bpelProcessBOM.setURI(uriBPELFile);
// create the Compiler
BpelCompiler20 bpelCompiler = new
BpelCompiler20();
// compile the process and create a OProcess
object
m_bpelCompiledProcess =
bpelCompiler.compile(m_bpelProcessBOM,
bpelResourceFinder);
HTH,
Thanks
Dhanush
-----Original Message-----
From: Michele [mailto:[email protected]]
Sent: Wednesday, January 20, 2010 7:42 PM
To: [email protected]
Subject: How create a BpelCompiler20
Hello, I have problem with BPELCompiler20()
I have the following error:
ERROR [main] (BpelCompiler.java:605) - null:57: error:
[UndeclaredVariable]
Attempt to reference undeclared variable "Search".
The instruction that give the error is the following
vref.variable = _context.resolveVariable(vv.getVariable());
in the context:
private OAssign.RValue compileFrom(From from) {
assert from != null;
try {
if (from.isVariableVal()) {
VariableVal vv = from.getAsVariableVal();
OAssign.VariableRef vref = new
OAssign.VariableRef(_context.getOProcess());
vref.variable =
_context.resolveVariable(vv.getVariable());
.....
Th problem is that I don't know how instante a BpelCompiler20() on my
specific BPEL process
BpelCompiler20 _context = new BpelCompiler20();
How Can I compile the BPEL file with the BPELCompiler20?