/** * Add to base {@link Contract} reference and referenced contract. * When the returned {@link Contract} is unpacking referenced contract verifies * the compliance with the conditions of reference in base contract. * <br><br> * Also reference to base contract may be added by {@link Contract#addReference(Reference)}. * <br><br> * * @param baseContract is base contract fro adding reference. * @param refContract is referenced contract (which must satisfy the conditions of the reference). * @param refName is name of reference. * @param refType is type of reference (section, may be {@link Reference#TYPE_TRANSACTIONAL}, {@link Reference#TYPE_EXISTING_DEFINITION}, or {@link Reference#TYPE_EXISTING_STATE}). * @param listConditions is list of strings with conditions of the reference. * @param isAllOfConditions is flag used if all conditions in list must be fulfilled (else - any of conditions). * @return ready {@link Contract} */ public synchronized static Contract addReferenceToContract( Contract baseContract, Contract refContract, String refName, int refType, List<String> listConditions, boolean isAllOfConditions) { Binder conditions = new Binder(); conditions.set(isAllOfConditions ? "all_of" : "any_of", listConditions); return addReferenceToContract(baseContract, refContract, refName, refType, conditions); }
listConditions.add("ref.definition.data.type == \"chief accountant assignment\""); ContractsService.addReferenceToContract(llcProperty, jobCertificate, "certification_contract", Reference.TYPE_EXISTING_DEFINITION, listConditions, true);
listConditions.add("ref.definition.data.type == \"chief accountant assignment\""); ContractsService.addReferenceToContract(llcProperty, jobCertificate, "certification_contract", Reference.TYPE_EXISTING_DEFINITION, listConditions, true);
listConditionsForDefinition.add("this.state.references.account_in_bank_certificate is_a this.definition.references.bank_certificate"); ContractsService.addReferenceToContract(llcProperty, oldAccountCertificate, "bank_certificate", Reference.TYPE_EXISTING_DEFINITION, listConditionsForDefinition, true); listConditionsForState.add("inherits this.definition.references.bank_certificate"); ContractsService.addReferenceToContract(llcProperty, oldAccountCertificate, "account_in_bank_certificate", Reference.TYPE_EXISTING_STATE, listConditionsForState, true); llcProperty2.getReferences().remove("account_in_bank_certificate"); ContractsService.addReferenceToContract(llcProperty2, newAccountCertificate, "account_in_bank_certificate", Reference.TYPE_EXISTING_STATE, newListConditions, true);
listConditions.add("ref.definition.data.type == \"chief accountant assignment\""); ContractsService.addReferenceToContract(llcProperty, jobCertificate, "certification_contract", Reference.TYPE_EXISTING_DEFINITION, listConditions, true);
listConditions.add("ref.definition.data.type == \"chief accountant assignment\""); ContractsService.addReferenceToContract(llcProperty, jobCertificate, "certification_contract", Reference.TYPE_EXISTING_DEFINITION, listConditions, true);
ContractsService.addReferenceToContract(llcProperty, oldAccountCertificate, "bank_certificate", Reference.TYPE_EXISTING_DEFINITION, listConditionsForDefinition, true);
listConditions.add("ref.definition.data.type == \"old job certificate\""); ContractsService.addReferenceToContract(llcProperty2, oldJobCertificate, "temp_certification_contract", Reference.TYPE_EXISTING_STATE, listConditions, true); llcProperty3.getReferences().remove("temp_certification_contract"); ContractsService.addReferenceToContract(llcProperty3, oldJobCertificate, "temp_certification_contract", Reference.TYPE_EXISTING_STATE, newListConditions, true);
listConditions.add("ref.definition.data.type == \"chief accountant assignment\""); ContractsService.addReferenceToContract(llcProperty, jobCertificate, "certification_contract", Reference.TYPE_EXISTING_DEFINITION, listConditions, true);
ContractsService.addReferenceToContract(llcProperty, oldAccountCertificate, "bank_certificate", Reference.TYPE_EXISTING_DEFINITION, listConditionsForDefinition, true);