через данный код не кидается event LinkAddedEvent
Код:
#
# Создание и привязка договора при переходе в статус "В работе"
#
onProcessEvent.{@inc:cnt}.events=statusChanged:{@STATUS_IN_WORK}
onProcessEvent.{@cnt}.doExpression=<<END
curdate = new("java.util.Date");
contractDao = new("ru.bgcrm.plugin.bgbilling.proto.dao.ContractDAO", ctxUser, "{@BILLING_ID}");
docDao = new("ru.bgcrm.plugin.document.dao.DocumentDAO", conSet.getConnection());
linkDao = new("ru.bgcrm.dao.process.ProcessLinkDAO", conSet.getConnection());
contractLink = u.getFirst(linkDao.getObjectLinksWithType(process.getId(), "contract%"));
if (contractLink == null) {
contract = contractDao.createContract({@CONTRACT_PATTERN}, tu.format(curdate, "ymd"), null, null);
link = new("ru.bgcrm.model.CommonObjectLink", "process", process.getId(),
"contract:" + contract.getBillingId(), contract.getId(), contract.getTitle());
linkDao.addLink(link);
} else {
contract = new("ru.bgcrm.plugin.bgbilling.proto.model.Contract", "{@BILLING_ID}", contractLink.getLinkedObjectId());
}
END