public OActivity newInstance(Activity src) {
return new OInvoke(_context.getOProcess(), _context.getCurrent());
}
public void compile(OActivity output, Activity srcx) {
InvokeActivity src = (InvokeActivity) srcx;
final OInvoke oinvoke = (OInvoke) output;
oinvoke.partnerLink = _context.resolvePartnerLink(src.getPartnerLink());
oinvoke.operation = _context.resolvePartnerRoleOperation(oinvoke.partnerLink, src.getOperation());
assert oinvoke.operation.getInput() != null; // ensured by
// resolvePartnerRoleOperation
assert oinvoke.operation.getInput().getMessage() != null; // ensured
// by
// resolvePartnerRoleOperation
// TODO: Add portType checking if specified by user
// if (portType != null &&
// !portType.equals(onMessage.partnerLink.myRolePortType.getQName()))
// throw new CompilationException(CMSGSG.errPortTypeMismatch(portType,
// onMessage.partnerLink.myRolePortType.getQName()));
if (oinvoke.operation.getInput() != null && oinvoke.operation.getInput().getMessage() != null) {
// Input var can be omitted if input message has no part
if (oinvoke.operation.getInput().getMessage().getParts().size() > 0) {
if (src.getInputVar() == null)
throw new CompilationException(__imsgs.errInvokeNoInputMessageForInputOp(oinvoke.operation.getName()));
oinvoke.inputVar = _context.resolveMessageVariable(src.getInputVar(), oinvoke.operation.getInput()
.getMessage().getQName());
}
}
if (oinvoke.operation.getOutput() != null && oinvoke.operation.getOutput().getMessage() != null) {
if (src.getOutputVar() == null)
throw new CompilationException(__imsgs.errInvokeNoOutputMessageForOutputOp(oinvoke.operation.getName()));
oinvoke.outputVar = _context.resolveMessageVariable(src.getOutputVar(), oinvoke.operation.getOutput()
.getMessage().getQName());
}
List<Correlation> correlations = src.getCorrelations();
List<Correlation> incorrelations = CollectionsX.filter(new ArrayList<Correlation>(), correlations,
new MemberOfFunction<Correlation>() {
@Override
public boolean isMember(Correlation o) {
return o.getPattern() == Correlation.CorrelationPattern.IN;