return new OPickReceive(_context.getOProcess(), _context.getCurrent());
}
public void compile(OActivity output, Activity src) {
OPickReceive opick = (OPickReceive) output;
PickActivity pickDef = (PickActivity) src;
opick.createInstanceFlag = pickDef.isCreateInstance();
for (OnMessage sOnMessage : pickDef.getOnMessages()) {
OPickReceive.OnMessage oOnMessage = compileOnMessage(sOnMessage.getVariable(),
sOnMessage.getPartnerLink(),
sOnMessage.getOperation(),
sOnMessage.getMessageExchangeId(),
sOnMessage.getPortType(),
pickDef.isCreateInstance(),
sOnMessage.getCorrelations());
if (sOnMessage.getActivity() == null)
throw new CompilationException(__cmsgs.errEmptyOnMessage().setSource(sOnMessage));
oOnMessage.activity = _context.compile(sOnMessage.getActivity());
opick.onMessages.add(oOnMessage);
if (oOnMessage.variable != null) opick.variableWr.add(oOnMessage.variable);
}
try {
for(OnAlarm onAlarmDef : pickDef.getOnAlarms()){
OPickReceive.OnAlarm oalarm = new OPickReceive.OnAlarm(_context.getOProcess());
oalarm.activity = _context.compile(onAlarmDef.getActivity());
if (onAlarmDef.getFor() != null && onAlarmDef.getUntil() == null) {
oalarm.forExpr = _context.compileExpr(onAlarmDef.getFor());
} else if (onAlarmDef.getFor() == null && onAlarmDef.getUntil() != null) {
oalarm.untilExpr = _context.compileExpr(onAlarmDef.getUntil());
} else {
throw new CompilationException(__cmsgs.errForOrUntilMustBeGiven().setSource(onAlarmDef));
}
if (pickDef.isCreateInstance())
throw new CompilationException(__cmsgs.errOnAlarmWithCreateInstance().setSource(onAlarmDef));
opick.onAlarms.add(oalarm);
}
} catch (CompilationException ce) {