Отвечай на вопросы, используя следующий контекст:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by IRIS.Designer.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using iRIS.Framework.Workflow.Process;
using iRIS.Framework.Workflow.Process.AuthorizationModel;
using iRIS.Framework.Workflow.Process.CustomProcessModel;
using iRIS.Framework.Workflow.Process.Data;
using iRIS.Framework.Workflow.UserData;

namespace iRIS.KaskoLink2.Generated.Processes.DiKaskoInsurance.Draft
{
    public class DiKaskoInsurance : FlowProcessModel
    {
        public const string ExitPoint_BasketInitializationProcessError = "Ошибка";
        public const string ExitPoint_ExitMainProcess = "Процесс завершен";
        public const string ExitPoint_DiKaskoSegmentationPostProcessError = "Ошибка";

        private readonly CustomProcessModel _initializeInvoices;
        private readonly CustomProcessModel _createDraftInspection;
        private readonly ProcedureModel _isAllowedToUseBSI;
        private readonly ProcedureModel _getUrlResumeProcessKaskoWithToken;
        private readonly CustomProcessModel _linkToPaymentSendEmailCustomProcess;
        private readonly FormDataModel _sendEmailLinkToPaymentFailedErrorMessage;
        private readonly FormDataModel _sendEmailLinkToPaymentSuccessMessage;
        private readonly CustomProcessModel _downloadDocumentsCustomProcess;
        private readonly CustomProcessModel _uploadDocumentsCustomProcess;
        private readonly ProcedureModel _printDocumentsErrorMessage;
        private readonly ProcedureModel _fillDeliveryDate;
        private readonly ProcedureModel _setDealDatesDueToNowId;
        private readonly ProcedureModel _getNeedPSO;
        private readonly ConditionModel _checkNeedPSO;
        private readonly VersionPublisherModel _publishBasketBeforeDiKaskoPSOThanksgivingProcess;
        private readonly VersionPublisherModel _publishBasketBeforeGenerationMessageContentLinkToPayment;
        private readonly NestedProcessModel _diKaskoPSOProcess;
        private readonly ProcedureModel _setEntityContextForPso;
        private readonly ProcedureModel _isAllowedToSkipAfterReadyForSign_;
        private readonly ConditionModel _isPaymentHoldedOrCancelled;
        private readonly CustomProcessModel _initializeVersionAutoDictionaryClientProcess;
        private readonly CustomProcessModel _checkDealsUniversalPaymentProcess;
        private readonly ProcedureModel _createPsoAdditionalFieldsForPostponedPso;
        private readonly CustomProcessModel _salesLoggingProcess;
        private readonly ConditionModel _checkIsLegal;
        private readonly ProcedureModel _getSelectedOfferIdForPostponedPso;
        private readonly ConditionModel _hasAnyOtherChecks;
        private readonly ProcedureModel _canSkipPsoForSpecialCreditAuto;
        private readonly ConditionModel _checkSkipPsoForSpecialConditions1;
        private readonly ProcedureModel _setCheckNecessityCode;
        private readonly CustomProcessModel _prePaymentDocumentsProcess;
        private readonly ProcedureModel _setOfflinePaymentTypeForLink2;
        private readonly CustomProcessModel _changeBasketStatusToSigned;
        private readonly ProcedureModel _logPaymentLink;
        private readonly ProcedureModel _getEmailSentFlag;
        private readonly ProcedureModel _createInspectionFileDescriptionModel;
        private readonly CustomProcessModel _changeBasketStatusToProcessing;
        private readonly ExpressionRunnerModel _setPaymentDueDate;
        private readonly ProcedureModel _createPsoAdditionalFields;
        private readonly ProcedureModel _setPromocodeForBasketByCompany;
        private readonly ConditionModel _skipCreatePaymentLinkCheckSecond;
        private readonly ConditionModel _isAllowedToSkipPSOAfterBSICheck;
        private readonly ConditionModel _canUseOldPsoInspectionTrue;
        private readonly CustomProcessModel _paymentMailAttachmentsCustomProcess;
        private readonly ConditionModel _checkSkipPsoForSpecialConditions2;
        private readonly ProcedureModel _createInspectionFileDescriptionModelForDraftPso;
        private readonly ProcedureModel _createPsoAdditionalFieldsForDraftPso;
        private readonly CustomProcessModel _insuranceInspectionWithFilesSavingCustomProcessForDraftPso;
        private readonly NestedProcessModel _exportBasketWithCommandEPolicyPaid;
        private readonly VersionPublisherModel _publishBasketAfterChangeToProcessing;
        private readonly CustomProcessModel _generationKaskoMessageContentCustomProcess;
        private readonly CustomProcessModel _kaskoSendEmailCustomProcess;
        private readonly NestedProcessModel _checkUniversalPaymentFormProcess;
        private readonly ConditionModel _needSendPolicyToEmail;
        private readonly VersionPublisherModel _publishBasketAfterGetOnlinePaymentUrl;
        private readonly ProcedureModel _createInspectionFileDescriptionModelForPostponedPso;
        private readonly ProcedureModel _formDocumentsForPsoPrinting;
        private readonly VersionPublisherModel _saveDraftBeforePrintingPolicyLink2Documents;
        private readonly ProcedureModel _kaskoPreviewPrintDocumentsForLink2;
        private readonly VersionPublisherModel _publishBasketAfterUrmChecks;
        private readonly ConditionModel _hasUrmApprovalsInDeal;
        private readonly ExpressionRunnerModel _setSiebelVersionIntegration;
        private readonly ConditionModel _hasPaymnetLinkAutoSendAndWebHookActionFlag2;
        private readonly CustomProcessModel _generationMessageContentLinkToPayment;
        private readonly NestedProcessModel _exportBasketWithCommandCheck;
        private readonly ConditionModel _checkIsLegal2;
        private readonly ConditionModel _isAllowedToSkipPublishForLink2_;
        private readonly ConditionModel _isBoxProposalSelected;
        private readonly NestedProcessModel _redirectToExternalSys;
        private readonly VersionPublisherModel _savePublishBasketAfterPayment;
        private readonly ConditionModel _needToSetInitialStatusToDraft;
        private readonly ConditionModel _isLink2ExportBasketWithCommandCheck;
        private readonly NestedProcessModel _paymentPartiallyPaidFormProcess;
        private readonly VersionPublisherModel _publishBasketAfterSkipPso;
        private readonly CustomProcessModel _changeBasketStatusToProcessingAtSkipPSO;
        private readonly ProcedureModel _setRedirectUrlsToBasketContext;
        private readonly FormDataModel _getOnlinePaymentUrlFailedErrorMessage;
        private readonly ProcedureModel _addUrmlToDeal;
        private readonly ExpressionRunnerModel _setPaymentDueDateBeforeMessageGeneration;
        private readonly ProcedureModel _setOfflinePaymentTypeForLink2Again;
        private readonly NestedProcessModel _diKaskoSegmentationPostProcess;
        private readonly ConditionModel _checkDirectProcessFlag;
        private readonly ConditionModel _isPostponedPSOSwitch;
        private readonly CustomProcessModel _newPaymentLinkManagement;
        private readonly ProcedureModel _sendEmailErrorMessage;
        private readonly ConditionModel _isAllowedToUseBSIForLink2;
        private readonly NestedProcessModel _otaCheckForIssueButtonLink2;
        private readonly ProcedureModel _isPostponedPSO;
        private readonly ConditionModel _isPaymentManualApproveAvailable;
        private readonly NestedProcessModel _preliminaryInsuranceInspectionProcess;
        private readonly ExpressionRunnerModel _initIsIrisCalculation;
        private readonly NestedProcessModel _diKaskoPreInsuranceCheckStatusesProcess;
        private readonly CustomProcessModel _exportToOssGuaranteedProcess;
        private readonly CustomProcessModel _kaskoSaveBasketProcessKeyRelation;
        private readonly NestedProcessModel _underwriterApprovalProcess;
        private readonly ProcedureModel _allChecksSkipRequired;
        private readonly ProcedureModel _setBeneficiary;
        private readonly ProcedureModel _filterOffers;
        private readonly ExpressionRunnerModel _setDateRepaymentWithShiftFlag;
        private readonly CustomProcessModel _updateProlongationStatus;
        private readonly CustomProcessModel _changeBasketStatusToOfferTerminated;
        private readonly CustomProcessModel _changeBasketStatusAfterPsoAndUrm;
        private readonly ConditionModel _isB2CPartner;
        private readonly ConditionModel _checkInitBasketSourceDeals;
        private readonly ProcedureModel _setDealSourceProcedure;
        private readonly NestedProcessModel _sasCheckForIssueButtonLink2;
        private readonly ProcedureModel _addOtaApprovalToDeal;
        private readonly NestedProcessModel _diKaskoBSIProcess;
        private readonly ExpressionRunnerModel _copyDealsFromBasketSource;
        private readonly ConditionModel _isPaymentByA7Receipt;
        private readonly ConditionModel _checkProductDictCode;
        private readonly CustomProcessModel _insuranceInspectionWithFilesSavingCustomProcess;
        private readonly ProcedureModel _mapSumForIrisCalculation;
        private readonly CustomProcessModel _enrichBasketBySiebelIdsBeforeSendToOssEKasko;
        private readonly NestedProcessModel _link2KaskoBamIntegrationProcess;
        private readonly NestedProcessModel _diKaskoSuccessfulBuyEPolicyProcess;
        private readonly ExpressionRunnerModel _savePaymentLink;
        private readonly ProcedureModel _initializeInvoicesBeforeLink2Print;
        private readonly ExpressionRunnerModel _setDefaultCurrencyToDeals;
        private readonly NestedProcessModel _preCheckBasketPayment;
        private readonly NestedProcessModel _link2KaskoUrmCheckProcess;
        private readonly CustomProcessModel _getRecalculationChanges;
        private readonly ProcedureModel _setExternalSystemTypeProcedure;
        private readonly ConditionModel _checkNeedPSOForLink2;
        private readonly ProcedureModel _isAllowedToSkipPublishAfterReadyForSign;
        private readonly ProcedureModel _fillDateSign;
        private readonly ProcedureModel _formDocumentsForPsoPrinting2;
        private readonly NestedProcessModel _diKaskoHoldedPaymentFormProcess;
        private readonly ExpressionRunnerModel _setManualApproveWaitingPaymentState;
        private readonly ProcedureModel _setDealDateStartDueToNow;
        private readonly ExpressionRunnerModel _setCheckDirectProcessFlagTrue;
        private readonly ConditionModel _processContainsEKaskoBeforeGeneratePaymentLink;
        private readonly NestedProcessModel _diKaskoPolicyLayoutProcess;
        private readonly ProcedureModel _setEndOfDayForRepaymentDate;
        private readonly CustomProcessModel _insurancePostponedInspectionAdditionalFieldsSendProcess;
        private readonly CustomProcessModel _insurancePostponedInspectionSharingProcess;
        private readonly CustomProcessModel _insurancePostponedInspectionCreationProcess;
        private readonly ExpressionRunnerModel _initChanges;
        private readonly CustomProcessModel _changeBasketStatusToRequestFillingAftrerConstructor;
        private readonly NestedProcessModel _diKaskoConstructorProcess;
        private readonly ExpressionRunnerModel _setIsPSOAllowedToSkip;
        private readonly ProcedureModel _recalculationSensitiveData;
        private readonly ExpressionRunnerModel _paymentTypeOfflineAndA7PayWayAssign;
        private readonly CustomProcessModel _findIntermediariesAndCostcenter;
        private readonly ProcedureModel _getRecurringToken;
        private readonly ProcedureModel _insuranceClassInitialization;
        private readonly ExpressionRunnerModel _insuranceClassAssign;
        private readonly ProcedureModel _insuranceTypesInitialization;
        private readonly ExpressionRunnerModel _insuranceTypesAssign;
        private readonly NestedProcessModel _basketInitializationProcess;
        private readonly ProcedureModel _availableOfferIdsInitializationProcedure;
        private readonly ProcedureModel _dealInitializationProcedure;
        private readonly CustomProcessModel _changeBasketStatusToSegmentation;
        private readonly ProcedureModel _setOrResetInsuranceTypes;
        private readonly ProcedureModel _setDefaultAutoValue;
        private readonly NestedProcessModel _segmentationProcess;
        private readonly ProcedureModel _getIsConversionRegionProcedure;
        private readonly NestedProcessModel _diKaskoQuestionnaireProcess;
        private readonly ExitPointModel _basketInitializationProcessError;
        private readonly FormDataModel _sendKaskoPolicySuccessMessage;
        private readonly CustomProcessModel _changeBasketStatusToPolicyIssued;
        private readonly ProcedureModel _formDocumentsForPrinting;
        private readonly VersionPublisherModel _savePublishBasketAfterPolicyIssued;
        private readonly FormDataModel _sendKaskoPolicyErrorMessage;
        private readonly ProcedureModel _setEmailSentFlag;
        private readonly NestedProcessModel _diKaskoGeneratePaymentLinkProcess;
        private readonly ExpressionRunnerModel _setCheckDirectProcessFlagFalse;
        private readonly InputModel _redirectToOnlinePaymentDefault;
        private readonly ExpressionRunnerModel _externalBasketInitialization;
        private readonly ProcedureModel _readFlagDisableActivityUnderWriterFromConfig;
        private readonly NestedProcessModel _createFakeInsuranceInspectionProcess;
        private readonly CustomProcessModel _changeBasketStatusToPolicyLayout;
        private readonly CustomProcessModel _printDocumentsProcess;
        private readonly RedirectModel _redirectToOnlinePaymentUrl;
        private readonly ProcedureModel _getInspection;
        private readonly ProcedureModel _setSpecialNotes;
        private readonly FormDataModel _generatePolicyNumberShowMessageError;
        private readonly CustomProcessModel _generatePolicyNumberByServiceProcess;
        private readonly ConditionModel _isAllowedToSKipPublishForLink2;
        private readonly ExitPointModel _exitMainProcess;
        private readonly ProcedureModel _getSelectedOfferId;
        private readonly CustomProcessModel _setIntermediariesAndCostcenter;
        private readonly VersionPublisherModel _publishBasketAfterChangedStatusToReadyForSignForEKasko;
        private readonly CustomProcessModel _changeBasketStatusToReadyForSignForEKasko;
        private readonly ExitPointModel _diKaskoSegmentationPostProcessError;

        public DiKaskoInsurance()
        {
            _initializeInvoices = new CustomProcessModel();
            _createDraftInspection = new CustomProcessModel();
            _isAllowedToUseBSI = new ProcedureModel();
            _getUrlResumeProcessKaskoWithToken = new ProcedureModel();
            _linkToPaymentSendEmailCustomProcess = new CustomProcessModel();
            _sendEmailLinkToPaymentFailedErrorMessage = new FormDataModel();
            _sendEmailLinkToPaymentSuccessMessage = new FormDataModel();
            _downloadDocumentsCustomProcess = new CustomProcessModel();
            _uploadDocumentsCustomProcess = new CustomProcessModel();
            _printDocumentsErrorMessage = new ProcedureModel();
            _fillDeliveryDate = new ProcedureModel();
            _setDealDatesDueToNowId = new ProcedureModel();
            _getNeedPSO = new ProcedureModel();
            _checkNeedPSO = new ConditionModel();
            _publishBasketBeforeDiKaskoPSOThanksgivingProcess = new VersionPublisherModel();
            _publishBasketBeforeGenerationMessageContentLinkToPayment = new VersionPublisherModel();
            _diKaskoPSOProcess = new NestedProcessModel();
            _setEntityContextForPso = new ProcedureModel();
            _isAllowedToSkipAfterReadyForSign_ = new ProcedureModel();
            _isPaymentHoldedOrCancelled = new ConditionModel();
            _initializeVersionAutoDictionaryClientProcess = new CustomProcessModel();
            _checkDealsUniversalPaymentProcess = new CustomProcessModel();
            _createPsoAdditionalFieldsForPostponedPso = new ProcedureModel();
            _salesLoggingProcess = new CustomProcessModel();
            _checkIsLegal = new ConditionModel();
            _getSelectedOfferIdForPostponedPso = new ProcedureModel();
            _hasAnyOtherChecks = new ConditionModel();
            _canSkipPsoForSpecialCreditAuto = new ProcedureModel();
            _checkSkipPsoForSpecialConditions1 = new ConditionModel();
            _setCheckNecessityCode = new ProcedureModel();
            _prePaymentDocumentsProcess = new CustomProcessModel();
            _setOfflinePaymentTypeForLink2 = new ProcedureModel();
            _changeBasketStatusToSigned = new CustomProcessModel();
            _logPaymentLink = new ProcedureModel();
            _getEmailSentFlag = new ProcedureModel();
            _createInspectionFileDescriptionModel = new ProcedureModel();
            _changeBasketStatusToProcessing = new CustomProcessModel();
            _setPaymentDueDate = new ExpressionRunnerModel();
            _createPsoAdditionalFields = new ProcedureModel();
            _setPromocodeForBasketByCompany = new ProcedureModel();
            _skipCreatePaymentLinkCheckSecond = new ConditionModel();
            _isAllowedToSkipPSOAfterBSICheck = new ConditionModel();
            _canUseOldPsoInspectionTrue = new ConditionModel();
            _paymentMailAttachmentsCustomProcess = new CustomProcessModel();
            _checkSkipPsoForSpecialConditions2 = new ConditionModel();
            _createInspectionFileDescriptionModelForDraftPso = new ProcedureModel();
            _createPsoAdditionalFieldsForDraftPso = new ProcedureModel();
            _insuranceInspectionWithFilesSavingCustomProcessForDraftPso = new CustomProcessModel();
            _exportBasketWithCommandEPolicyPaid = new NestedProcessModel();
            _publishBasketAfterChangeToProcessing = new VersionPublisherModel();
            _generationKaskoMessageContentCustomProcess = new CustomProcessModel();
            _kaskoSendEmailCustomProcess = new CustomProcessModel();
            _checkUniversalPaymentFormProcess = new NestedProcessModel();
            _needSendPolicyToEmail = new ConditionModel();
            _publishBasketAfterGetOnlinePaymentUrl = new VersionPublisherModel();
            _createInspectionFileDescriptionModelForPostponedPso = new ProcedureModel();
            _formDocumentsForPsoPrinting = new ProcedureModel();
            _saveDraftBeforePrintingPolicyLink2Documents = new VersionPublisherModel();
            _kaskoPreviewPrintDocumentsForLink2 = new ProcedureModel();
            _publishBasketAfterUrmChecks = new VersionPublisherModel();
            _hasUrmApprovalsInDeal = new ConditionModel();
            _setSiebelVersionIntegration = new ExpressionRunnerModel();
            _hasPaymnetLinkAutoSendAndWebHookActionFlag2 = new ConditionModel();
            _generationMessageContentLinkToPayment = new CustomProcessModel();
            _exportBasketWithCommandCheck = new NestedProcessModel();
            _checkIsLegal2 = new ConditionModel();
            _isAllowedToSkipPublishForLink2_ = new ConditionModel();
            _isBoxProposalSelected = new ConditionModel();
            _redirectToExternalSys = new NestedProcessModel();
            _savePublishBasketAfterPayment = new VersionPublisherModel();
            _needToSetInitialStatusToDraft = new ConditionModel();
            _isLink2ExportBasketWithCommandCheck = new ConditionModel();
            _paymentPartiallyPaidFormProcess = new NestedProcessModel();
            _publishBasketAfterSkipPso = new VersionPublisherModel();
            _changeBasketStatusToProcessingAtSkipPSO = new CustomProcessModel();
            _setRedirectUrlsToBasketContext = new ProcedureModel();
            _getOnlinePaymentUrlFailedErrorMessage = new FormDataModel();
            _addUrmlToDeal = new ProcedureModel();
            _setPaymentDueDateBeforeMessageGeneration = new ExpressionRunnerModel();
            _setOfflinePaymentTypeForLink2Again = new ProcedureModel();
            _diKaskoSegmentationPostProcess = new NestedProcessModel();
            _checkDirectProcessFlag = new ConditionModel();
            _isPostponedPSOSwitch = new ConditionModel();
            _newPaymentLinkManagement = new CustomProcessModel();
            _sendEmailErrorMessage = new ProcedureModel();
            _isAllowedToUseBSIForLink2 = new ConditionModel();
            _otaCheckForIssueButtonLink2 = new NestedProcessModel();
            _isPostponedPSO = new ProcedureModel();
            _isPaymentManualApproveAvailable = new ConditionModel();
            _preliminaryInsuranceInspectionProcess = new NestedProcessModel();
            _initIsIrisCalculation = new ExpressionRunnerModel();
            _diKaskoPreInsuranceCheckStatusesProcess = new NestedProcessModel();
            _exportToOssGuaranteedProcess = new CustomProcessModel();
            _kaskoSaveBasketProcessKeyRelation = new CustomProcessModel();
            _underwriterApprovalProcess = new NestedProcessModel();
            _allChecksSkipRequired = new ProcedureModel();
            _setBeneficiary = new ProcedureModel();
            _filterOffers = new ProcedureModel();
            _setDateRepaymentWithShiftFlag = new ExpressionRunnerModel();
            _updateProlongationStatus = new CustomProcessModel();
            _changeBasketStatusToOfferTerminated = new CustomProcessModel();
            _changeBasketStatusAfterPsoAndUrm = new CustomProcessModel();
            _isB2CPartner = new ConditionModel();
            _checkInitBasketSourceDeals = new ConditionModel();
            _setDealSourceProcedure = new ProcedureModel();
            _sasCheckForIssueButtonLink2 = new NestedProcessModel();
            _addOtaApprovalToDeal = new ProcedureModel();
            _diKaskoBSIProcess = new NestedProcessModel();
            _copyDealsFromBasketSource = new ExpressionRunnerModel();
            _isPaymentByA7Receipt = new ConditionModel();
            _checkProductDictCode = new ConditionModel();
            _insuranceInspectionWithFilesSavingCustomProcess = new CustomProcessModel();
            _mapSumForIrisCalculation = new ProcedureModel();
            _enrichBasketBySiebelIdsBeforeSendToOssEKasko = new CustomProcessModel();
            _link2KaskoBamIntegrationProcess = new NestedProcessModel();
            _diKaskoSuccessfulBuyEPolicyProcess = new NestedProcessModel();
            _savePaymentLink = new ExpressionRunnerModel();
            _initializeInvoicesBeforeLink2Print = new ProcedureModel();
            _setDefaultCurrencyToDeals = new ExpressionRunnerModel();
            _preCheckBasketPayment = new NestedProcessModel();
            _link2KaskoUrmCheckProcess = new NestedProcessModel();
            _getRecalculationChanges = new CustomProcessModel();
            _setExternalSystemTypeProcedure = new ProcedureModel();
            _checkNeedPSOForLink2 = new ConditionModel();
            _isAllowedToSkipPublishAfterReadyForSign = new ProcedureModel();
            _fillDateSign = new ProcedureModel();
            _formDocumentsForPsoPrinting2 = new ProcedureModel();
            _diKaskoHoldedPaymentFormProcess = new NestedProcessModel();
            _setManualApproveWaitingPaymentState = new ExpressionRunnerModel();
            _setDealDateStartDueToNow = new ProcedureModel();
            _setCheckDirectProcessFlagTrue = new ExpressionRunnerModel();
            _processContainsEKaskoBeforeGeneratePaymentLink = new ConditionModel();
            _diKaskoPolicyLayoutProcess = new NestedProcessModel();
            _setEndOfDayForRepaymentDate = new ProcedureModel();
            _insurancePostponedInspectionAdditionalFieldsSendProcess = new CustomProcessModel();
            _insurancePostponedInspectionSharingProcess = new CustomProcessModel();
            _insurancePostponedInspectionCreationProcess = new CustomProcessModel();
            _initChanges = new ExpressionRunnerModel();
            _changeBasketStatusToRequestFillingAftrerConstructor = new CustomProcessModel();
            _diKaskoConstructorProcess = new NestedProcessModel();
            _setIsPSOAllowedToSkip = new ExpressionRunnerModel();
            _recalculationSensitiveData = new ProcedureModel();
            _paymentTypeOfflineAndA7PayWayAssign = new ExpressionRunnerModel();
            _findIntermediariesAndCostcenter = new CustomProcessModel();
            _getRecurringToken = new ProcedureModel();
            _insuranceClassInitialization = new ProcedureModel();
            _insuranceClassAssign = new ExpressionRunnerModel();
            _insuranceTypesInitialization = new ProcedureModel();
            _insuranceTypesAssign = new ExpressionRunnerModel();
            _basketInitializationProcess = new NestedProcessModel();
            _availableOfferIdsInitializationProcedure = new ProcedureModel();
            _dealInitializationProcedure = new ProcedureModel();
            _changeBasketStatusToSegmentation = new CustomProcessModel();
            _setOrResetInsuranceTypes = new ProcedureModel();
            _setDefaultAutoValue = new ProcedureModel();
            _segmentationProcess = new NestedProcessModel();
            _getIsConversionRegionProcedure = new ProcedureModel();
            _diKaskoQuestionnaireProcess = new NestedProcessModel();
            _basketInitializationProcessError = new ExitPointModel();
            _sendKaskoPolicySuccessMessage = new FormDataModel();
            _changeBasketStatusToPolicyIssued = new CustomProcessModel();
            _formDocumentsForPrinting = new ProcedureModel();
            _savePublishBasketAfterPolicyIssued = new VersionPublisherModel();
            _sendKaskoPolicyErrorMessage = new FormDataModel();
            _setEmailSentFlag = new ProcedureModel();
            _diKaskoGeneratePaymentLinkProcess = new NestedProcessModel();
            _setCheckDirectProcessFlagFalse = new ExpressionRunnerModel();
            _redirectToOnlinePaymentDefault = new InputModel();
            _externalBasketInitialization = new ExpressionRunnerModel();
            _readFlagDisableActivityUnderWriterFromConfig = new ProcedureModel();
            _createFakeInsuranceInspectionProcess = new NestedProcessModel();
            _changeBasketStatusToPolicyLayout = new CustomProcessModel();
            _printDocumentsProcess = new CustomProcessModel();
            _redirectToOnlinePaymentUrl = new RedirectModel();
            _getInspection = new ProcedureModel();
            _setSpecialNotes = new ProcedureModel();
            _generatePolicyNumberShowMessageError = new FormDataModel();
            _generatePolicyNumberByServiceProcess = new CustomProcessModel();
            _isAllowedToSKipPublishForLink2 = new ConditionModel();
            _exitMainProcess = new ExitPointModel();
            _getSelectedOfferId = new ProcedureModel();
            _setIntermediariesAndCostcenter = new CustomProcessModel();
            _publishBasketAfterChangedStatusToReadyForSignForEKasko = new VersionPublisherModel();
            _changeBasketStatusToReadyForSignForEKasko = new CustomProcessModel();
            _diKaskoSegmentationPostProcessError = new ExitPointModel();

            InitializeDiKaskoInsurance(this);

            InitializeInitializeInvoices(_initializeInvoices);
            InitializeCreateDraftInspection(_createDraftInspection);
            InitializeIsAllowedToUseBSI(_isAllowedToUseBSI);
            InitializeGetUrlResumeProcessKaskoWithToken(_getUrlResumeProcessKaskoWithToken);
            InitializeLinkToPaymentSendEmailCustomProcess(_linkToPaymentSendEmailCustomProcess);
            InitializeSendEmailLinkToPaymentFailedErrorMessage(_sendEmailLinkToPaymentFailedErrorMessage);
            InitializeSendEmailLinkToPaymentSuccessMessage(_sendEmailLinkToPaymentSuccessMessage);
            InitializeDownloadDocumentsCustomProcess(_downloadDocumentsCustomProcess);
            InitializeUploadDocumentsCustomProcess(_uploadDocumentsCustomProcess);
            InitializePrintDocumentsErrorMessage(_printDocumentsErrorMessage);
            InitializeFillDeliveryDate(_fillDeliveryDate);
            InitializeSetDealDatesDueToNowId(_setDealDatesDueToNowId);
            InitializeGetNeedPSO(_getNeedPSO);
            InitializeCheckNeedPSO(_checkNeedPSO);
            InitializePublishBasketBeforeDiKaskoPSOThanksgivingProcess(_publishBasketBeforeDiKaskoPSOThanksgivingProcess);
            InitializePublishBasketBeforeGenerationMessageContentLinkToPayment(_publishBasketBeforeGenerationMessageContentLinkToPayment);
            InitializeDiKaskoPSOProcess(_diKaskoPSOProcess);
            InitializeSetEntityContextForPso(_setEntityContextForPso);
            InitializeIsAllowedToSkipAfterReadyForSign_(_isAllowedToSkipAfterReadyForSign_);
            InitializeIsPaymentHoldedOrCancelled(_isPaymentHoldedOrCancelled);
            InitializeInitializeVersionAutoDictionaryClientProcess(_initializeVersionAutoDictionaryClientProcess);
            InitializeCheckDealsUniversalPaymentProcess(_checkDealsUniversalPaymentProcess);
            InitializeCreatePsoAdditionalFieldsForPostponedPso(_createPsoAdditionalFieldsForPostponedPso);
            InitializeSalesLoggingProcess(_salesLoggingProcess);
            InitializeCheckIsLegal(_checkIsLegal);
            InitializeGetSelectedOfferIdForPostponedPso(_getSelectedOfferIdForPostponedPso);
            InitializeHasAnyOtherChecks(_hasAnyOtherChecks);
            InitializeCanSkipPsoForSpecialCreditAuto(_canSkipPsoForSpecialCreditAuto);
            InitializeCheckSkipPsoForSpecialConditions1(_checkSkipPsoForSpecialConditions1);
            InitializeSetCheckNecessityCode(_setCheckNecessityCode);
            InitializePrePaymentDocumentsProcess(_prePaymentDocumentsProcess);
            InitializeSetOfflinePaymentTypeForLink2(_setOfflinePaymentTypeForLink2);
            InitializeChangeBasketStatusToSigned(_changeBasketStatusToSigned);
            InitializeLogPaymentLink(_logPaymentLink);
            InitializeGetEmailSentFlag(_getEmailSentFlag);
            InitializeCreateInspectionFileDescriptionModel(_createInspectionFileDescriptionModel);
            InitializeChangeBasketStatusToProcessing(_changeBasketStatusToProcessing);
            InitializeSetPaymentDueDate(_setPaymentDueDate);
            InitializeCreatePsoAdditionalFields(_createPsoAdditionalFields);
            InitializeSetPromocodeForBasketByCompany(_setPromocodeForBasketByCompany);
            InitializeSkipCreatePaymentLinkCheckSecond(_skipCreatePaymentLinkCheckSecond);
            InitializeIsAllowedToSkipPSOAfterBSICheck(_isAllowedToSkipPSOAfterBSICheck);
            InitializeCanUseOldPsoInspectionTrue(_canUseOldPsoInspectionTrue);
            InitializePaymentMailAttachmentsCustomProcess(_paymentMailAttachmentsCustomProcess);
            InitializeCheckSkipPsoForSpecialConditions2(_checkSkipPsoForSpecialConditions2);
            InitializeCreateInspectionFileDescriptionModelForDraftPso(_createInspectionFileDescriptionModelForDraftPso);
            InitializeCreatePsoAdditionalFieldsForDraftPso(_createPsoAdditionalFieldsForDraftPso);
            InitializeInsuranceInspectionWithFilesSavingCustomProcessForDraftPso(_insuranceInspectionWithFilesSavingCustomProcessForDraftPso);
            InitializeExportBasketWithCommandEPolicyPaid(_exportBasketWithCommandEPolicyPaid);
            InitializePublishBasketAfterChangeToProcessing(_publishBasketAfterChangeToProcessing);
            InitializeGenerationKaskoMessageContentCustomProcess(_generationKaskoMessageContentCustomProcess);
            InitializeKaskoSendEmailCustomProcess(_kaskoSendEmailCustomProcess);
            InitializeCheckUniversalPaymentFormProcess(_checkUniversalPaymentFormProcess);
            InitializeNeedSendPolicyToEmail(_needSendPolicyToEmail);
            InitializePublishBasketAfterGetOnlinePaymentUrl(_publishBasketAfterGetOnlinePaymentUrl);
            InitializeCreateInspectionFileDescriptionModelForPostponedPso(_createInspectionFileDescriptionModelForPostponedPso);
            InitializeFormDocumentsForPsoPrinting(_formDocumentsForPsoPrinting);
            InitializeSaveDraftBeforePrintingPolicyLink2Documents(_saveDraftBeforePrintingPolicyLink2Documents);
            InitializeKaskoPreviewPrintDocumentsForLink2(_kaskoPreviewPrintDocumentsForLink2);
            InitializePublishBasketAfterUrmChecks(_publishBasketAfterUrmChecks);
            InitializeHasUrmApprovalsInDeal(_hasUrmApprovalsInDeal);
            InitializeSetSiebelVersionIntegration(_setSiebelVersionIntegration);
            InitializeHasPaymnetLinkAutoSendAndWebHookActionFlag2(_hasPaymnetLinkAutoSendAndWebHookActionFlag2);
            InitializeGenerationMessageContentLinkToPayment(_generationMessageContentLinkToPayment);
            InitializeExportBasketWithCommandCheck(_exportBasketWithCommandCheck);
            InitializeCheckIsLegal2(_checkIsLegal2);
            InitializeIsAllowedToSkipPublishForLink2_(_isAllowedToSkipPublishForLink2_);
            InitializeIsBoxProposalSelected(_isBoxProposalSelected);
            InitializeRedirectToExternalSys(_redirectToExternalSys);
            InitializeSavePublishBasketAfterPayment(_savePublishBasketAfterPayment);
            InitializeNeedToSetInitialStatusToDraft(_needToSetInitialStatusToDraft);
            InitializeIsLink2ExportBasketWithCommandCheck(_isLink2ExportBasketWithCommandCheck);
            InitializePaymentPartiallyPaidFormProcess(_paymentPartiallyPaidFormProcess);
            InitializePublishBasketAfterSkipPso(_publishBasketAfterSkipPso);
            InitializeChangeBasketStatusToProcessingAtSkipPSO(_changeBasketStatusToProcessingAtSkipPSO);
            InitializeSetRedirectUrlsToBasketContext(_setRedirectUrlsToBasketContext);
            InitializeGetOnlinePaymentUrlFailedErrorMessage(_getOnlinePaymentUrlFailedErrorMessage);
            InitializeAddUrmlToDeal(_addUrmlToDeal);
            InitializeSetPaymentDueDateBeforeMessageGeneration(_setPaymentDueDateBeforeMessageGeneration);
            InitializeSetOfflinePaymentTypeForLink2Again(_setOfflinePaymentTypeForLink2Again);
            InitializeDiKaskoSegmentationPostProcess(_diKaskoSegmentationPostProcess);
            InitializeCheckDirectProcessFlag(_checkDirectProcessFlag);
            InitializeIsPostponedPSOSwitch(_isPostponedPSOSwitch);
            InitializeNewPaymentLinkManagement(_newPaymentLinkManagement);
            InitializeSendEmailErrorMessage(_sendEmailErrorMessage);
            InitializeIsAllowedToUseBSIForLink2(_isAllowedToUseBSIForLink2);
            InitializeOtaCheckForIssueButtonLink2(_otaCheckForIssueButtonLink2);
            InitializeIsPostponedPSO(_isPostponedPSO);
            InitializeIsPaymentManualApproveAvailable(_isPaymentManualApproveAvailable);
            InitializePreliminaryInsuranceInspectionProcess(_preliminaryInsuranceInspectionProcess);
            InitializeInitIsIrisCalculation(_initIsIrisCalculation);
            InitializeDiKaskoPreInsuranceCheckStatusesProcess(_diKaskoPreInsuranceCheckStatusesProcess);
            InitializeExportToOssGuaranteedProcess(_exportToOssGuaranteedProcess);
            InitializeKaskoSaveBasketProcessKeyRelation(_kaskoSaveBasketProcessKeyRelation);
            InitializeUnderwriterApprovalProcess(_underwriterApprovalProcess);
            InitializeAllChecksSkipRequired(_allChecksSkipRequired);
            InitializeSetBeneficiary(_setBeneficiary);
            InitializeFilterOffers(_filterOffers);
            InitializeSetDateRepaymentWithShiftFlag(_setDateRepaymentWithShiftFlag);
            InitializeUpdateProlongationStatus(_updateProlongationStatus);
            InitializeChangeBasketStatusToOfferTerminated(_changeBasketStatusToOfferTerminated);
            InitializeChangeBasketStatusAfterPsoAndUrm(_changeBasketStatusAfterPsoAndUrm);
            InitializeIsB2CPartner(_isB2CPartner);
            InitializeCheckInitBasketSourceDeals(_checkInitBasketSourceDeals);
            InitializeSetDealSourceProcedure(_setDealSourceProcedure);
            InitializeSasCheckForIssueButtonLink2(_sasCheckForIssueButtonLink2);
            InitializeAddOtaApprovalToDeal(_addOtaApprovalToDeal);
            InitializeDiKaskoBSIProcess(_diKaskoBSIProcess);
            InitializeCopyDealsFromBasketSource(_copyDealsFromBasketSource);
            InitializeIsPaymentByA7Receipt(_isPaymentByA7Receipt);
            InitializeCheckProductDictCode(_checkProductDictCode);
            InitializeInsuranceInspectionWithFilesSavingCustomProcess(_insuranceInspectionWithFilesSavingCustomProcess);
            InitializeMapSumForIrisCalculation(_mapSumForIrisCalculation);
            InitializeEnrichBasketBySiebelIdsBeforeSendToOssEKasko(_enrichBasketBySiebelIdsBeforeSendToOssEKasko);
            InitializeLink2KaskoBamIntegrationProcess(_link2KaskoBamIntegrationProcess);
            InitializeDiKaskoSuccessfulBuyEPolicyProcess(_diKaskoSuccessfulBuyEPolicyProcess);
            InitializeSavePaymentLink(_savePaymentLink);
            InitializeInitializeInvoicesBeforeLink2Print(_initializeInvoicesBeforeLink2Print);
            InitializeSetDefaultCurrencyToDeals(_setDefaultCurrencyToDeals);
            InitializePreCheckBasketPayment(_preCheckBasketPayment);
            InitializeLink2KaskoUrmCheckProcess(_link2KaskoUrmCheckProcess);
            InitializeGetRecalculationChanges(_getRecalculationChanges);
            InitializeSetExternalSystemTypeProcedure(_setExternalSystemTypeProcedure);
            InitializeCheckNeedPSOForLink2(_checkNeedPSOForLink2);
            InitializeIsAllowedToSkipPublishAfterReadyForSign(_isAllowedToSkipPublishAfterReadyForSign);
            InitializeFillDateSign(_fillDateSign);
            InitializeFormDocumentsForPsoPrinting2(_formDocumentsForPsoPrinting2);
            InitializeDiKaskoHoldedPaymentFormProcess(_diKaskoHoldedPaymentFormProcess);
            InitializeSetManualApproveWaitingPaymentState(_setManualApproveWaitingPaymentState);
            InitializeSetDealDateStartDueToNow(_setDealDateStartDueToNow);
            InitializeSetCheckDirectProcessFlagTrue(_setCheckDirectProcessFlagTrue);
            InitializeProcessContainsEKaskoBeforeGeneratePaymentLink(_processContainsEKaskoBeforeGeneratePaymentLink);
            InitializeDiKaskoPolicyLayoutProcess(_diKaskoPolicyLayoutProcess);
            InitializeSetEndOfDayForRepaymentDate(_setEndOfDayForRepaymentDate);
            InitializeInsurancePostponedInspectionAdditionalFieldsSendProcess(_insurancePostponedInspectionAdditionalFieldsSendProcess);
            InitializeInsurancePostponedInspectionSharingProcess(_insurancePostponedInspectionSharingProcess);
            InitializeInsurancePostponedInspectionCreationProcess(_insurancePostponedInspectionCreationProcess);
            InitializeInitChanges(_initChanges);
            InitializeChangeBasketStatusToRequestFillingAftrerConstructor(_changeBasketStatusToRequestFillingAftrerConstructor);
            InitializeDiKaskoConstructorProcess(_diKaskoConstructorProcess);
            InitializeSetIsPSOAllowedToSkip(_setIsPSOAllowedToSkip);
            InitializeRecalculationSensitiveData(_recalculationSensitiveData);
            InitializePaymentTypeOfflineAndA7PayWayAssign(_paymentTypeOfflineAndA7PayWayAssign);
            InitializeFindIntermediariesAndCostcenter(_findIntermediariesAndCostcenter);
            InitializeGetRecurringToken(_getRecurringToken);
            InitializeInsuranceClassInitialization(_insuranceClassInitialization);
            InitializeInsuranceClassAssign(_insuranceClassAssign);
            InitializeInsuranceTypesInitialization(_insuranceTypesInitialization);
            InitializeInsuranceTypesAssign(_insuranceTypesAssign);
            InitializeBasketInitializationProcess(_basketInitializationProcess);
            InitializeAvailableOfferIdsInitializationProcedure(_availableOfferIdsInitializationProcedure);
            InitializeDealInitializationProcedure(_dealInitializationProcedure);
            InitializeChangeBasketStatusToSegmentation(_changeBasketStatusToSegmentation);
            InitializeSetOrResetInsuranceTypes(_setOrResetInsuranceTypes);
            InitializeSetDefaultAutoValue(_setDefaultAutoValue);
            InitializeSegmentationProcess(_segmentationProcess);
            InitializeGetIsConversionRegionProcedure(_getIsConversionRegionProcedure);
            InitializeDiKaskoQuestionnaireProcess(_diKaskoQuestionnaireProcess);
            InitializeBasketInitializationProcessError(_basketInitializationProcessError);
            InitializeSendKaskoPolicySuccessMessage(_sendKaskoPolicySuccessMessage);
            InitializeChangeBasketStatusToPolicyIssued(_changeBasketStatusToPolicyIssued);
            InitializeFormDocumentsForPrinting(_formDocumentsForPrinting);
            InitializeSavePublishBasketAfterPolicyIssued(_savePublishBasketAfterPolicyIssued);
            InitializeSendKaskoPolicyErrorMessage(_sendKaskoPolicyErrorMessage);
            InitializeSetEmailSentFlag(_setEmailSentFlag);
            InitializeDiKaskoGeneratePaymentLinkProcess(_diKaskoGeneratePaymentLinkProcess);
            InitializeSetCheckDirectProcessFlagFalse(_setCheckDirectProcessFlagFalse);
            InitializeRedirectToOnlinePaymentDefault(_redirectToOnlinePaymentDefault);
            InitializeExternalBasketInitialization(_externalBasketInitialization);
            InitializeReadFlagDisableActivityUnderWriterFromConfig(_readFlagDisableActivityUnderWriterFromConfig);
            InitializeCreateFakeInsuranceInspectionProcess(_createFakeInsuranceInspectionProcess);
            InitializeChangeBasketStatusToPolicyLayout(_changeBasketStatusToPolicyLayout);
            InitializePrintDocumentsProcess(_printDocumentsProcess);
            InitializeRedirectToOnlinePaymentUrl(_redirectToOnlinePaymentUrl);
            InitializeGetInspection(_getInspection);
            InitializeSetSpecialNotes(_setSpecialNotes);
            InitializeGeneratePolicyNumberShowMessageError(_generatePolicyNumberShowMessageError);
            InitializeGeneratePolicyNumberByServiceProcess(_generatePolicyNumberByServiceProcess);
            InitializeIsAllowedToSKipPublishForLink2(_isAllowedToSKipPublishForLink2);
            InitializeExitMainProcess(_exitMainProcess);
            InitializeGetSelectedOfferId(_getSelectedOfferId);
            InitializeSetIntermediariesAndCostcenter(_setIntermediariesAndCostcenter);
            InitializePublishBasketAfterChangedStatusToReadyForSignForEKasko(_publishBasketAfterChangedStatusToReadyForSignForEKasko);
            InitializeChangeBasketStatusToReadyForSignForEKasko(_changeBasketStatusToReadyForSignForEKasko);
            InitializeDiKaskoSegmentationPostProcessError(_diKaskoSegmentationPostProcessError);
        }

        private void InitializeDiKaskoInsurance(FlowProcessModel model)
        {
            model.Identifier = "DiKaskoInsurance";
            model.Name = "Основной процесс Каско";
            model.Description = @"Основной процесс Каско";
            model.Version = "Draft";
            model.IsPrivate = false;
            model.EntityLoaderTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName;
            model.FormChangingImplementationTypeName = typeof(iRIS.InsuranceCore.Code.ProcessFormChangingProcedures).AssemblyQualifiedName;
            model.VersionPublisherImplementationTypeName = typeof(iRIS.InsuranceCore.Code.VersionPublisher).AssemblyQualifiedName;
            model.CatchProcessModelIdentifier = "DiKaskoUnhandledErrorCatchProcess";
            model.CatchProcessModelVersion = "Draft";
            model.ResumeProcessModelIdentifier = "DiKaskoInsuranceResumeProcess";
            model.ResumeProcessModelVersion = "Draft";
            model.ProcessResumeAccessRules = new List<FlowProcessSecurity>();
            model.ProcessResumeAccessRules.Add(new FlowProcessSecurity
            {
                EntityId = @"Basket.EntityId",
                EntityTypeName = @"'Basket'",
                PermissionType = "Read",
            });
            model.ProcessStartAccessRules = new List<FlowProcessSecurity>();
            model.VariableModelInfoList = new List<ProcessVariableDefinition>();
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "insuranceClass",
                TypeName = typeof(iRIS.InsuranceCore.Entities.InsuranceClass).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "insuranceTypes",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.InsuranceType>).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "isIrisCalculation",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "SiebelVersionIntegration",
                TypeName = typeof(string).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "policyIssuedByCallCenter",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "EOsagoImportDataHash",
                TypeName = typeof(string).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "IsAllowedToSkipPSO",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "paymentTypeOfflineCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = true,
                IsOptional = true
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "a7PayWayCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = true,
                IsOptional = true
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "DateRepaymentWithShift",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = true,
                IsOptional = true
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "RecalculationChanges",
                TypeName = typeof(iRIS.InsuranceCore.Entities.ChangesWrapper).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "ExternalBasket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = false,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.Start = _readFlagDisableActivityUnderWriterFromConfig;
            model.NavigationStartPoints = new List<NavigationStartModel>();
            model.NavigationStartPoints.Add(new NavigationStartModel
            {
                Identifier = "ShedulerCallbackStatusUrmPsoNavigationPoint",
                NextStep = _diKaskoPreInsuranceCheckStatusesProcess,
            });
        }

        private void InitializeInitializeInvoices(CustomProcessModel model)
        {
            model.Identifier = "InitializeInvoices";
            model.Name = "Инициализация счетов и платежа";
            model.Description = @"Инициализация счетов";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.PaymentInitializationProcess.Draft.PaymentInitializationProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.PaymentInitializationResult).AssemblyQualifiedName;
            model.DefaultNextStep = _setEndOfDayForRepaymentDate;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].Product.ProductDictCode == 'KASKO' &&(Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && Basket.Deals[i].IsInBasket==true)deals.push(Basket.Deals[i])}deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "PaymentIndex",
                TypeName = typeof(int).AssemblyQualifiedName,
            });
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Payment",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Payment).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeCreateDraftInspection(CustomProcessModel model)
        {
            model.Identifier = "CreateDraftInspection";
            model.Name = "Создание инспекции в статусе Draft";
            model.Description = @"Создание инспекции в статусе Draft";
            model.Title = "Создание инспекции в статусе Draft";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.DraftPsoInspectionCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _diKaskoPreInsuranceCheckStatusesProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
                Expression = @"InsuranceInspectionWithFilesSavingCustomProcessForDraftPso.Inspection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeIsAllowedToUseBSI(ProcedureModel model)
        {
            model.Identifier = "IsAllowedToUseBSI";
            model.Name = "Проверка возможности вызова BSI";
            model.Description = string.Empty;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _isAllowedToUseBSIForLink2;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CheckIsAllowedToUseBSI),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "integrationLogin",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "CheckIsAllowedToUseBSI",
            });
        }

        private void InitializeGetUrlResumeProcessKaskoWithToken(ProcedureModel model)
        {
            model.Identifier = "GetUrlResumeProcessKaskoWithToken";
            model.Name = "Получение ссылки с токеном на возобновление процесса";
            model.Description = @"Получение ссылки с токеном на возобновление процесса";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.StringResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _diKaskoGeneratePaymentLinkProcess;
            model.ExceptionNextStep = _getOnlinePaymentUrlFailedErrorMessage;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetUrlResumeProcessKaskoWithToken),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "authorizationData",
                        TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                        Expression = @"AuthorizationData",
                    },
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "isReusable",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"false",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(string).AssemblyQualifiedName,
                SourceName = "GetUrlResumeProcessKaskoWithToken",
            });
        }

        private void InitializeLinkToPaymentSendEmailCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "LinkToPaymentSendEmailCustomProcess";
            model.Name = "C2. Отправка E-mail с сылкой на оплату";
            model.Description = @"C2. Отправка E-mail с сылкой на оплату";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.Activities.SendEmailCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "EmailTypeString",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'КАСКО. Письмо с сылкой на оплату'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressFrom",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'messenger@online.renins.com'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressFromDisplayName",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Ренессанс страхование'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressToList",
                TypeName = typeof(List<string>).AssemblyQualifiedName,
                Expression = @"var emails = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) { emails.push(Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.Email1);break; }} emails;",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailSubject",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"GenerationMessageContentLinkToPayment.Subject",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailBody",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"GenerationMessageContentLinkToPayment.Content",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailAttachmentList",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
                Expression = @"PaymentMailAttachmentsCustomProcess.DocumentCollection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailLinkToPaymentFailedErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _logPaymentLink,
            });
        }

        private void InitializeSendEmailLinkToPaymentFailedErrorMessage(FormDataModel model)
        {
            model.Identifier = "SendEmailLinkToPaymentFailedErrorMessage";
            model.Name = "Алерт «Произошла ошибка при отправке E-mail»";
            model.Description = string.Empty;
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Произошла ошибка при отправке E-mail'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Error;
            model.Caption = "Ошибка";
            model.NextStep = _diKaskoPolicyLayoutProcess;
        }

        private void InitializeSendEmailLinkToPaymentSuccessMessage(FormDataModel model)
        {
            model.Identifier = "SendEmailLinkToPaymentSuccessMessage";
            model.Name = "Алерт «Письмо успешно отправлено»";
            model.Description = string.Empty;
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Письмо успешно отправлено'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Info;
            model.Caption = "Сообщение";
            model.NextStep = _setEmailSentFlag;
        }

        private void InitializeDownloadDocumentsCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "DownloadDocumentsCustomProcess";
            model.Name = "E1. Скачивание документов (C1.Массив (ключ, название группы))";
            model.Description = @"E1. Скачивание документов (C1.Массив (ключ, название группы))";
            model.ImplementationTypeName = typeof(iRIS.Printing.Code.Activities.PrintingDownloadActivity).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivityResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InDocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
                Expression = @"PrintDocumentsProcess.DocumentCollection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "DocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Succes",
                NextStep = _uploadDocumentsCustomProcess,
            });
        }

        private void InitializeUploadDocumentsCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "UploadDocumentsCustomProcess";
            model.Name = "Аплоад документов, не требующих повторной генерации";
            model.Description = @"Аплоад документов, не требующих повторной генерации";
            model.ImplementationTypeName = typeof(iRIS.Printing.Code.Activities.PrintingUploadActivity).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _checkProductDictCode;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InDocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
                Expression = @"DownloadDocumentsCustomProcess.DocumentCollection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializePrintDocumentsErrorMessage(ProcedureModel model)
        {
            model.Identifier = "PrintDocumentsErrorMessage";
            model.Name = "Error: Ошибка при формировании документов";
            model.Description = @"Error: Ошибка при формировании документов";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _sendKaskoPolicyErrorMessage;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.AddCustomError),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "error",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"""Ошибка при формировании документов""",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeFillDeliveryDate(ProcedureModel model)
        {
            model.Identifier = "FillDeliveryDate";
            model.Name = "Заполнение даты платежа";
            model.Description = @"Заполнение даты доставки";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _changeBasketStatusToSigned;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.FillDeliveryDate),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deal",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                        Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal;",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetDealDatesDueToNowId(ProcedureModel model)
        {
            model.Identifier = "SetDealDatesDueToNowId";
            model.Name = "Обновление дат в сделки при оформлении \"День в  день\"";
            model.Description = string.Empty;
            model.Title = "Обновление дат в сделки при оформлении День в  день";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _isAllowedToSkipPublishAfterReadyForSign;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetDealDatesDueToNow),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "GetDealDatesDueToNow",
            });
        }

        private void InitializeGetNeedPSO(ProcedureModel model)
        {
            model.Identifier = "GetNeedPSO";
            model.Name = "Доступность осмотра без ПСО";
            model.Description = @"Доступность осмотра без ПСО";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.DeliveryProcess.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _allChecksSkipRequired;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CheckDealWithoutInspection),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "CheckDealWithoutInspection",
            });
        }

        private void InitializeCheckNeedPSO(ConditionModel model)
        {
            model.Identifier = "CheckNeedPSO";
            model.Name = "Доступность осмотра без ПСО";
            model.Description = @"Доступность осмотра без ПСО";
            model.Default = _isPostponedPSOSwitch;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"GetNeedPSO.Value || AllChecksSkipRequired.Value",
                NextStep = _changeBasketStatusToReadyForSignForEKasko,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Есть проверки и нет ПСО",
                Expression = @"ChecksNavigationFunctionsInvoker.NoPsoOtherChecks(Basket)",
                NextStep = _diKaskoPreInsuranceCheckStatusesProcess,
            });
        }

        private void InitializePublishBasketBeforeDiKaskoPSOThanksgivingProcess(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketBeforeDiKaskoPSOThanksgivingProcess";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _diKaskoPSOProcess;
            model.ExceptionNextStep = null;
        }

        private void InitializePublishBasketBeforeGenerationMessageContentLinkToPayment(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketBeforeGenerationMessageContentLinkToPayment";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _setCheckDirectProcessFlagFalse;
            model.ExceptionNextStep = null;
        }

        private void InitializeDiKaskoPSOProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoPSOProcess";
            model.Name = "Форма ожидания проверок";
            model.Description = @"Форма ожидания проверок УРМ, ОТА, андеррайтинга и ПСО.";
            model.FlowProcessIdentifier = "DiKaskoPSOProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "goToHomePageExitPoint",
                NextStep = null,
            });
        }

        private void InitializeSetEntityContextForPso(ProcedureModel model)
        {
            model.Identifier = "SetEntityContextForPso";
            model.Name = "Установка переменной ПСО в статус \"InWork\"";
            model.Description = @"Установка переменной ПСО в статус ""InWork""";
            model.Title = "Возможность пропуска публикации корзины";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _diKaskoPSOProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetPsoEntityContext),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeIsAllowedToSkipAfterReadyForSign_(ProcedureModel model)
        {
            model.Identifier = "IsAllowedToSkipAfterReadyForSign_";
            model.Name = "Возможность пропуска публикации корзины";
            model.Description = string.Empty;
            model.Title = "Возможность пропуска публикации корзины";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _isAllowedToSkipPublishForLink2_;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CheckIsAllowedSkipPublishBasket),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "integrationLogin",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "CheckIsAllowedSkipPublishBasket",
            });
        }

        private void InitializeIsPaymentHoldedOrCancelled(ConditionModel model)
        {
            model.Identifier = "IsPaymentHoldedOrCancelled";
            model.Name = "Платеж захолдирован или отменен";
            model.Description = string.Empty;
            model.Default = _checkDealsUniversalPaymentProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Cancelled",
                Expression = @"Basket.Payments[InitializeInvoices.PaymentIndex].TransactionStatusCode === 'cancelled'",
                NextStep = _diKaskoHoldedPaymentFormProcess,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Holded",
                Expression = @"Basket.Payments[InitializeInvoices.PaymentIndex].TransactionStatusCode === 'holded'",
                NextStep = _diKaskoHoldedPaymentFormProcess,
            });
        }

        private void InitializeInitializeVersionAutoDictionaryClientProcess(CustomProcessModel model)
        {
            model.Identifier = "InitializeVersionAutoDictionaryClientProcess";
            model.Name = "Инициализация версии фильтрации справочников авто";
            model.Description = @"Инициализация версии фильтрации справочников авто";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.InitializeVersionAutoDictionaryClientProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _initIsIrisCalculation;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AuthorizationData",
                TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                Expression = @"AuthorizationData",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsCreateProcess",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Expression = @"true",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeCheckDealsUniversalPaymentProcess(CustomProcessModel model)
        {
            model.Identifier = "CheckDealsUniversalPaymentProcess";
            model.Name = "Проверка оплаты по сделкам (Все сделки IsInBasket == True)";
            model.Description = @"Проверка оплаты по сделкам (Все сделки IsInBasket == True)";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.CheckDealsUniversalPaymentProcess.CheckDealsUniversalPaymentProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].IsInBasket==true && !(Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))deals.push(Basket.Deals[i])}deals",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Все сделки корректно оплачены",
                NextStep = _setDealDateStartDueToNow,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Есть сделки с некорректной оплатой",
                NextStep = _paymentPartiallyPaidFormProcess,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Оплачены не все сделки",
                NextStep = _paymentPartiallyPaidFormProcess,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Сделки не оплачены",
                NextStep = _paymentPartiallyPaidFormProcess,
            });
        }

        private void InitializeCreatePsoAdditionalFieldsForPostponedPso(ProcedureModel model)
        {
            model.Identifier = "CreatePsoAdditionalFieldsForPostponedPso";
            model.Name = "Дополнительные поля для редактирования формы осмотра";
            model.Description = @"Дополнительные поля для редактирования формы осмотра";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateAdditionalFieldsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insuranceInspectionWithFilesSavingCustomProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreatePsoAdditionalFields),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "PsoAdditionalFields",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                SourceName = "CreatePsoAdditionalFields",
            });
        }

        private void InitializeSalesLoggingProcess(CustomProcessModel model)
        {
            model.Identifier = "SalesLoggingProcess";
            model.Name = "Логирование успешной продажи";
            model.Description = string.Empty;
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.SalesLoggingProcess.Draft.SalesLoggingProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _setSpecialNotes;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "ProductDictCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'KASKO'",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeCheckIsLegal(ConditionModel model)
        {
            model.Identifier = "CheckIsLegal";
            model.Name = "Юр. лицо";
            model.Description = string.Empty;
            model.Default = _sasCheckForIssueButtonLink2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"Basket.IsLegal == true",
                NextStep = _link2KaskoUrmCheckProcess,
            });
        }

        private void InitializeGetSelectedOfferIdForPostponedPso(ProcedureModel model)
        {
            model.Identifier = "GetSelectedOfferIdForPostponedPso";
            model.Name = "Текущий Offer_Id";
            model.Description = @"Текущий Offer_Id";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.IntResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _createInspectionFileDescriptionModelForPostponedPso;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetSelectedOfferId),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deal",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                        Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal;",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(int).AssemblyQualifiedName,
                SourceName = "GetSelectedOfferId",
            });
        }

        private void InitializeHasAnyOtherChecks(ConditionModel model)
        {
            model.Identifier = "HasAnyOtherChecks";
            model.Name = "Есть ли проверки в сделке";
            model.Description = @"Есть ли проверки в сделке";
            model.Default = _diKaskoPreInsuranceCheckStatusesProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Проверок нет",
                Expression = @"ChecksNavigationFunctionsInvoker.NoOtherChecks(Basket)",
                NextStep = _changeBasketStatusAfterPsoAndUrm,
            });
        }

        private void InitializeCanSkipPsoForSpecialCreditAuto(ProcedureModel model)
        {
            model.Identifier = "CanSkipPsoForSpecialCreditAuto";
            model.Name = "Возможен ли пропуск ПСО для кредитной машины";
            model.Description = string.Empty;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _checkSkipPsoForSpecialConditions1;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.PsoMustBeSkippedForSpecialCreditAuto),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "PsoMustBeSkippedForSpecialCreditAuto",
            });
        }

        private void InitializeCheckSkipPsoForSpecialConditions1(ConditionModel model)
        {
            model.Identifier = "CheckSkipPsoForSpecialConditions1";
            model.Name = "Проверка пропуска ПСО для специальных кредитных Авто";
            model.Description = @"Проверка пропуска ПСО для специальных кредитных Авто";
            model.Default = _canUseOldPsoInspectionTrue;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"CanSkipPsoForSpecialCreditAuto.Value",
                NextStep = _setCheckNecessityCode,
            });
        }

        private void InitializeSetCheckNecessityCode(ProcedureModel model)
        {
            model.Identifier = "SetCheckNecessityCode";
            model.Name = "Установка кода inspec_no_old_auto";
            model.Description = @"Установка кода inspec_no_old_auto";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.IntResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _diKaskoPreInsuranceCheckStatusesProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetCheckNecessityCode),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "isProcessApiRequest",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"IsProcessApiRequest",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializePrePaymentDocumentsProcess(CustomProcessModel model)
        {
            model.Identifier = "PrePaymentDocumentsProcess";
            model.Name = "C1. Печать (все Сделки Рутовой Корзины с признаком IsInBasket==true; “pdf”; WhatToUse = “All/Policy”)";
            model.Description = @"C1. Печать (все Сделки Рутовой Корзины с признаком IsInBasket==true; “pdf”; WhatToUse = “All/Policy”)";
            model.ImplementationTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivity).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivityResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "WhatToUse",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'PrintStoresToUse.PrintingFormCode'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "PrintingFormCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.GetPrePaymentPrintingFormCodes(Basket)",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "PrintingFormSource",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'PrintingFormSource.Db'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsPreview",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Expression = @"true",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "ProductWhatToUse",
                TypeName = typeof(Dictionary<string, string>).AssemblyQualifiedName,
                Expression = @"ExternalFunctionsInvoker.GetProductWhatToUseForOnlinePolicyIssue()",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsNeedReloadDeals",
                TypeName = typeof(bool?).AssemblyQualifiedName,
                Expression = @"false",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"ExternalFunctionsInvoker.GetDealsForPrinting(Basket)",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DocType",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Pdf'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketEntityId",
                TypeName = typeof(int?).AssemblyQualifiedName,
                Expression = @"Basket.EntityId",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AdditionalData",
                TypeName = typeof(iRIS.Printing.Code.Dto.PrintingAdditionalData).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.SetAdditionalDataForDateRepayment(Basket, DateRepaymentWithShift)",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "DocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailLinkToPaymentFailedErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Succes",
                NextStep = _paymentMailAttachmentsCustomProcess,
            });
        }

        private void InitializeSetOfflinePaymentTypeForLink2(ProcedureModel model)
        {
            model.Identifier = "SetOfflinePaymentTypeForLink2";
            model.Name = "Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.Description = @"Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.Title = "Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _saveDraftBeforePrintingPolicyLink2Documents;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetPaymentType),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "paymentTypeOfflineCode",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"paymentTypeOfflineCode",
                    },
                    new FunctionParameter
                    {
                        Name = "a7PayWayCode",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"a7PayWayCode",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeChangeBasketStatusToSigned(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToSigned";
            model.Name = "D9. Смена статуса корзины и сделок";
            model.Description = @"D9. Смена статуса корзины и сделок";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Signed'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _savePublishBasketAfterPayment,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _savePublishBasketAfterPayment,
            });
        }

        private void InitializeLogPaymentLink(ProcedureModel model)
        {
            model.Identifier = "LogPaymentLink";
            model.Name = "Логирование ссылки на оплату";
            model.Description = string.Empty;
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _sendEmailLinkToPaymentSuccessMessage;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.LogPaymentLink),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "paymentUrl",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"DiKaskoGeneratePaymentLinkProcess.KaskoUrl",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeGetEmailSentFlag(ProcedureModel model)
        {
            model.Identifier = "GetEmailSentFlag";
            model.Name = "Проверка отправки письма на оплату";
            model.Description = @"Проверка отправки письма на оплату";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _checkDirectProcessFlag;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetEmailSentFlag),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "GetEmailSentFlag",
            });
        }

        private void InitializeCreateInspectionFileDescriptionModel(ProcedureModel model)
        {
            model.Identifier = "CreateInspectionFileDescriptionModel";
            model.Name = "Печатные формы для ПСО";
            model.Description = @"Печатные формы для ПСО";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateFileDescriptionsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _createPsoAdditionalFields;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreateInspectionFileDescriptionModel),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "InspectionFileDescriptions",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                SourceName = "CreateInspectionFileDescriptionModel",
            });
        }

        private void InitializeChangeBasketStatusToProcessing(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToProcessing";
            model.Name = "D9. Смена статуса корзины и сделок на \"В обработке\"";
            model.Description = @"D9. Смена статуса корзины и сделок на ""В обработке""";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Processing'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _publishBasketAfterChangeToProcessing,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _publishBasketAfterChangeToProcessing,
            });
        }

        private void InitializeSetPaymentDueDate(ExpressionRunnerModel model)
        {
            model.Identifier = "SetPaymentDueDate";
            model.Name = "SetPaymentDueDate";
            model.Description = string.Empty;
            model.Title = "SetPaymentDueDate";
            model.Expression = @"var paymentDueDate = DiKaskoExternalFunctionsInvoker.GetDuePaymentDate(Basket, SharedData.integrationLogin, null);";
            model.NextStep = _changeBasketStatusToPolicyLayout;
        }

        private void InitializeCreatePsoAdditionalFields(ProcedureModel model)
        {
            model.Identifier = "CreatePsoAdditionalFields";
            model.Name = "Дополнительные поля для редактирования формы осмотра";
            model.Description = @"Дополнительные поля для редактирования формы осмотра";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateAdditionalFieldsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _changeBasketStatusToProcessing;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreatePsoAdditionalFields),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "PsoAdditionalFields",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                SourceName = "CreatePsoAdditionalFields",
            });
        }

        private void InitializeSetPromocodeForBasketByCompany(ProcedureModel model)
        {
            model.Identifier = "SetPromocodeForBasketByCompany";
            model.Name = "SetPromocodeForBasketByCompany";
            model.Description = @"SetPromocodeForBasketByCompany";
            model.Title = "SetPromocodeForBasketByCompany";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _externalBasketInitialization;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.SetPromocodeForBasketByCompany),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "productId",
                        TypeName = typeof(int).AssemblyQualifiedName,
                        Expression = @"14",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSkipCreatePaymentLinkCheckSecond(ConditionModel model)
        {
            model.Identifier = "SkipCreatePaymentLinkCheckSecond";
            model.Name = "Проверка пропуска создания ссылки на оплату для Link2 сценария";
            model.Description = @"Проверка пропуска создания ссылки на оплату для Link2 сценария";
            model.Default = _redirectToOnlinePaymentUrl;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "NotLink2EnablePaymentLinkFlag ",
                Expression = @"(SharedData.ProcessApiCommandName != 'Link2GetPaymentLinkCommand' && Link2FunctionsInvoker.BasketCreatorIsLink2Partner(Basket)) && (IsProcessApiRequest || AuthorizationData.Name === 'SystemRobot')",
                NextStep = _redirectToOnlinePaymentDefault,
            });
        }

        private void InitializeIsAllowedToSkipPSOAfterBSICheck(ConditionModel model)
        {
            model.Identifier = "IsAllowedToSkipPSOAfterBSICheck";
            model.Name = "Проверка возможности оформления без ПСО по итогам запроса в БСИ";
            model.Description = string.Empty;
            model.Default = _checkNeedPSO;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Пропуск ПСО по итогам запроса в BSI",
                Expression = @"IsAllowedToSkipPSO",
                NextStep = _changeBasketStatusToProcessingAtSkipPSO,
            });
        }

        private void InitializeCanUseOldPsoInspectionTrue(ConditionModel model)
        {
            model.Identifier = "CanUseOldPsoInspectionTrue";
            model.Name = "Включена ли настройка CanUseOldPsoInspection";
            model.Description = @"Включена ли настройка CanUseOldPsoInspection";
            model.Default = _checkIsLegal2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"ChecksNavigationFunctionsInvoker.CanUseOldPsoInspection(SharedData.integrationLogin)",
                NextStep = _isPostponedPSO,
            });
        }

        private void InitializePaymentMailAttachmentsCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "PaymentMailAttachmentsCustomProcess";
            model.Name = "E1. Скачивание документов (C1.Массив (ключ, название группы))";
            model.Description = @"E1. Скачивание документов (C1.Массив (ключ, название группы))";
            model.ImplementationTypeName = typeof(iRIS.Printing.Code.Activities.PrintingDownloadActivity).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivityResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InDocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
                Expression = @"PrePaymentDocumentsProcess.DocumentCollection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "DocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailLinkToPaymentFailedErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Succes",
                NextStep = _generationMessageContentLinkToPayment,
            });
        }

        private void InitializeCheckSkipPsoForSpecialConditions2(ConditionModel model)
        {
            model.Identifier = "CheckSkipPsoForSpecialConditions2";
            model.Name = "Проверка пропуска ПСО для спец.условий";
            model.Description = @"Проверка пропуска ПСО для спец.условий";
            model.Default = _createFakeInsuranceInspectionProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"CanSkipPsoForSpecialCreditAuto.Value || IsAllowedToSkipPSO || IsPostponedPSO.Value",
                NextStep = _hasAnyOtherChecks,
            });
        }

        private void InitializeCreateInspectionFileDescriptionModelForDraftPso(ProcedureModel model)
        {
            model.Identifier = "CreateInspectionFileDescriptionModelForDraftPso";
            model.Name = "Печатные формы для ПСО (полис и предыдущий полис)";
            model.Description = @"Печатные формы для ПСО (полис и предыдущий полис)";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateFileDescriptionsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _createPsoAdditionalFieldsForDraftPso;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreateInspectionFileDescriptionModel),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "InspectionFileDescriptions",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                SourceName = "CreateInspectionFileDescriptionModel",
            });
        }

        private void InitializeCreatePsoAdditionalFieldsForDraftPso(ProcedureModel model)
        {
            model.Identifier = "CreatePsoAdditionalFieldsForDraftPso";
            model.Name = "Дополнительные поля для редактирования формы осмотра";
            model.Description = @"Дополнительные поля для редактирования формы осмотра";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateAdditionalFieldsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insuranceInspectionWithFilesSavingCustomProcessForDraftPso;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreatePsoAdditionalFields),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "PsoAdditionalFields",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                SourceName = "CreatePsoAdditionalFields",
            });
        }

        private void InitializeInsuranceInspectionWithFilesSavingCustomProcessForDraftPso(CustomProcessModel model)
        {
            model.Identifier = "InsuranceInspectionWithFilesSavingCustomProcessForDraftPso";
            model.Name = "Процесс создания осмотра и доп файлов в дб";
            model.Description = @"Создание инспекции для дб и прикрепление к ней описаний доп. файлов.";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.SavingInspectionFileDescriptionsInDbCustomProces).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _createDraftInspection;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InspectionFileDescriptions",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                Expression = @"CreateInspectionFileDescriptionModelForDraftPso.InspectionFileDescriptions",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AdditionalFields",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                Expression = @"CreatePsoAdditionalFieldsForDraftPso.PsoAdditionalFields",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealEntityId",
                TypeName = typeof(int).AssemblyQualifiedName,
                Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal.EntityId;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeExportBasketWithCommandEPolicyPaid(NestedProcessModel model)
        {
            model.Identifier = "ExportBasketWithCommandEPolicyPaid";
            model.Name = "Отправка корзины в Siebel c командой ePolicyPaid";
            model.Description = @"Отправка корзины в Siebel c командой ePolicyPaid";
            model.FlowProcessIdentifier = "DiKaskoExportBasketSiebelProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Command",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"'ePolicyPaid'",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Процесс завершен",
                NextStep = _formDocumentsForPrinting,
            });
        }

        private void InitializePublishBasketAfterChangeToProcessing(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketAfterChangeToProcessing";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _isLink2ExportBasketWithCommandCheck;
            model.ExceptionNextStep = null;
        }

        private void InitializeGenerationKaskoMessageContentCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "GenerationKaskoMessageContentCustomProcess";
            model.Name = "E5. Генерация сообщения по шаблону Каско";
            model.Description = @"E5. Генерация сообщения по шаблону Каско";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.GenerationMessageContentProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.GenerationMessageContentResult).AssemblyQualifiedName;
            model.DefaultNextStep = _kaskoSendEmailCustomProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Objects",
                TypeName = typeof(List<object>).AssemblyQualifiedName,
                Expression = @"var objects = []; objects.push(Basket); objects;",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MessageTemplateCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.GetKaskoPolicySuccessfulBuyMessageTemplateCode(Basket)",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Parameters",
                TypeName = typeof(System.Dynamic.ExpandoObject).AssemblyQualifiedName,
                Expression = @"var dict = {};dict['Name']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.Name; } } result;\"";dict['MiddleName']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.MiddleName; } } result;\"";dict['LastName']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.LastName; } } result;\"";dict['PolicyNumber']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].PolicyNumber; } } result;\"";dict['AutoBrandName']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].InsuranceObjects[0].Auto.AutoBrandName; } } result;\"";dict['AutoModelName']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.InsuranceClassCode == 'Auto' && Basket.Deals[i].IsInBasket == true) { result = Basket.Deals[i].InsuranceObjects[0].Auto.AutoModelName; } } result;\"";dict['DateStart']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].Product.InsuranceClassCode == 'Auto') {  result =  (Basket.Deals[i].DateStart.getDate() < 10 ? '0' : '' ) + Basket.Deals[i].DateStart.getDate() + '.' + (Basket.Deals[i].DateStart.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateStart.getMonth() + 1) + '.' + Basket.Deals[i].DateStart.getFullYear();}} result;\"";dict['DateEnd']=\""var result = ''; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].Product.InsuranceClassCode == 'Auto') {  result =  (Basket.Deals[i].DateEnd.getDate() < 10 ? '0' : '' ) + Basket.Deals[i].DateEnd.getDate() + '.' + (Basket.Deals[i].DateEnd.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateEnd.getMonth() + 1) + '.' + Basket.Deals[i].DateEnd.getFullYear();}} result;\"";dict['CurrentYear']=\""var date = new Date(); date.getFullYear();\"";dict;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Subject",
                TypeName = typeof(string).AssemblyQualifiedName,
            });
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Content",
                TypeName = typeof(string).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailErrorMessage,
            });
        }

        private void InitializeKaskoSendEmailCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "KaskoSendEmailCustomProcess";
            model.Name = "C2. Отправка E-mail (Успешная покупка полиса) Kasko";
            model.Description = @"C2. Отправка E-mail (Успешная покупка полиса) Kasko";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.Activities.SendEmailCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "EmailTypeString",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Каско. Письмо об успешной покупке'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressFrom",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'messenger@online.renins.com'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressFromDisplayName",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Ренессанс страхование'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AddressToList",
                TypeName = typeof(List<string>).AssemblyQualifiedName,
                Expression = @"var emails = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true && Basket.Deals[i].Deliveries[0].AddresseeEmail != null) { emails.push(Basket.Deals[i].Deliveries[0].AddresseeEmail); } } emails;",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailSubject",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"GenerationKaskoMessageContentCustomProcess.Subject",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailBody",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"GenerationKaskoMessageContentCustomProcess.Content",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MailAttachmentList",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
                Expression = @"DownloadDocumentsCustomProcess.DocumentCollection",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _sendKaskoPolicySuccessMessage,
            });
        }

        private void InitializeCheckUniversalPaymentFormProcess(NestedProcessModel model)
        {
            model.Identifier = "CheckUniversalPaymentFormProcess";
            model.Name = "Z4. Форма проверки платежа";
            model.Description = @"Z4. Форма проверки платежа";
            model.FlowProcessIdentifier = "CheckUniversalPaymentFormProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Payment",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Payment).AssemblyQualifiedName,
                InExpression = @"Basket.Payments[InitializeInvoices.PaymentIndex]",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Завершение оформления",
                NextStep = _isPaymentHoldedOrCancelled,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Назад",
                NextStep = _redirectToExternalSys,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Оплатить",
                NextStep = _preCheckBasketPayment,
            });
        }

        private void InitializeNeedSendPolicyToEmail(ConditionModel model)
        {
            model.Identifier = "NeedSendPolicyToEmail";
            model.Name = "Необходимо ли отправить полис по почте?";
            model.Description = @"Необходимо ли отправить полис по почте?";
            model.Default = _changeBasketStatusToPolicyIssued;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.NeedSendPolicyToEMail(AuthorizationData, Basket)",
                NextStep = _printDocumentsProcess,
            });
        }

        private void InitializePublishBasketAfterGetOnlinePaymentUrl(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketAfterGetOnlinePaymentUrl";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _getEmailSentFlag;
            model.ExceptionNextStep = null;
        }

        private void InitializeCreateInspectionFileDescriptionModelForPostponedPso(ProcedureModel model)
        {
            model.Identifier = "CreateInspectionFileDescriptionModelForPostponedPso";
            model.Name = "Печатные формы для ПСО";
            model.Description = @"Печатные формы для ПСО";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionCreateFileDescriptionsResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _createPsoAdditionalFieldsForPostponedPso;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CreateInspectionFileDescriptionModel),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "InspectionFileDescriptions",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                SourceName = "CreateInspectionFileDescriptionModel",
            });
        }

        private void InitializeFormDocumentsForPsoPrinting(ProcedureModel model)
        {
            model.Identifier = "FormDocumentsForPsoPrinting";
            model.Name = "E2. Формирование документов для печати (Сделки КАСКО Рутовой Корзины с признаком IsInBasket==true; ShouldSaveInDB == true)";
            model.Description = @"E2. Формирование документов для печати (Сделки КАСКО Рутовой Корзины с признаком IsInBasket==true; ShouldSaveInDB == true)";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _getSelectedOfferId;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FormDocumentsForPrintingKasko),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deals",
                        TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                        Expression = @"deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true)deals.push(Basket.Deals[i])}deals;",
                    },
                    new FunctionParameter
                    {
                        Name = "shouldSaveInDb",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"true",
                    },
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSaveDraftBeforePrintingPolicyLink2Documents(VersionPublisherModel model)
        {
            model.Identifier = "SaveDraftBeforePrintingPolicyLink2Documents";
            model.Name = "Сохранение черновика";
            model.Description = @"Сохранение черновика";
            model.Title = "Сохранение черновика";
            model.VersionAction = VersionAction.SaveDraft;
            model.RelationType = RelationType.Draft;
            model.NextStep = _kaskoPreviewPrintDocumentsForLink2;
            model.ExceptionNextStep = null;
        }

        private void InitializeKaskoPreviewPrintDocumentsForLink2(ProcedureModel model)
        {
            model.Identifier = "KaskoPreviewPrintDocumentsForLink2";
            model.Name = "Формирование превью документов для печати для Link2";
            model.Description = @"Формирование превью документов для печати для Link2 (Сделки КАСКО Рутовой Корзины с признаком IsInBasket==true; ShouldSaveInDB == true)";
            model.Title = "Формирование превью документов для печати для Link2";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _isBoxProposalSelected;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FormDocumentsForPrintingKasko),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deals",
                        TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                        Expression = @"deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true)deals.push(Basket.Deals[i])}deals;",
                    },
                    new FunctionParameter
                    {
                        Name = "shouldSaveInDb",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"true",
                    },
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializePublishBasketAfterUrmChecks(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketAfterUrmChecks";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _needToSetInitialStatusToDraft;
            model.ExceptionNextStep = null;
        }

        private void InitializeHasUrmApprovalsInDeal(ConditionModel model)
        {
            model.Identifier = "HasUrmApprovalsInDeal";
            model.Name = "Есть ли проверки URM?";
            model.Description = string.Empty;
            model.Default = _needToSetInitialStatusToDraft;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Есть проверки URM",
                Expression = @"DiKaskoExternalFunctionsInvoker.HasUrmApprovals(Basket)",
                NextStep = _publishBasketAfterUrmChecks,
            });
        }

        private void InitializeSetSiebelVersionIntegration(ExpressionRunnerModel model)
        {
            model.Identifier = "SetSiebelVersionIntegration";
            model.Name = "Инициализация версии интеграции c Siebel";
            model.Description = @"Инициализация версии интеграции c Siebel";
            model.Expression = @"SiebelVersionIntegration = DiKaskoSiebelVersionIntegration.GetSiebelVersionIntegration(Basket.Number, isIrisCalculation)";
            model.NextStep = _segmentationProcess;
        }

        private void InitializeHasPaymnetLinkAutoSendAndWebHookActionFlag2(ConditionModel model)
        {
            model.Identifier = "HasPaymnetLinkAutoSendAndWebHookActionFlag2";
            model.Name = "HasPaymnetLinkAutoSendAndWebHookActionFlag";
            model.Description = @"Проверка есть ли на сделке OperatorId и вызван ли процесс таской шедулера запущенной веб хуком от viewApp";
            model.Default = _skipCreatePaymentLinkCheckSecond;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData['ActionName'] === 'ViewAppServiceWebHookAction' && DiKaskoExternalFunctionsInvoker.HasPaymnetLinkAutoSendFlag(Basket)",
                NextStep = _setPaymentDueDateBeforeMessageGeneration,
            });
        }

        private void InitializeGenerationMessageContentLinkToPayment(CustomProcessModel model)
        {
            model.Identifier = "GenerationMessageContentLinkToPayment";
            model.Name = "E5. Генерация сообщения по шаблону";
            model.Description = @"E5. Генерация сообщения по шаблону";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.GenerationMessageContentProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.GenerationMessageContentResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Objects",
                TypeName = typeof(List<object>).AssemblyQualifiedName,
                Expression = @"var objects = []; objects.push(Basket); objects",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "MessageTemplateCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Auto_Mail_KaskoApiLinkToPayment'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Parameters",
                TypeName = typeof(System.Dynamic.ExpandoObject).AssemblyQualifiedName,
                Expression = @"var dict = {};
                        dict['LastName'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) {
                        		result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.LastName;
                        	}
                        }
                        result;
                        "";
                        dict['Name'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) {
                        		result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.Name;
                        	}
                        }
                        result;
                        "";
                		dict['MiddleName'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) {
                        		result = Basket.Deals[i].Insurant.Subject.IndividualEntity.Person.MiddleName;
                        	}
                        }
                        result;
                        "";
                        dict['AutoBrandName'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) {
                        		result = Basket.Deals[i].InsuranceObjects[0].Auto.AutoBrandName
                        	}
                        }
                        result;
                        "";
                        dict['AutoModelName'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].IsInBasket == true) {
                        		result = Basket.Deals[i].InsuranceObjects[0].Auto.AutoModelName
                        	}
                        }
                        result;
                        "";
                        dict['DateStart'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true) {
                        		result = (Basket.Deals[i].DateStart.getDate() < 10 ? '0' : '') + Basket.Deals[i].DateStart.getDate() + '.' + (Basket.Deals[i].DateStart.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateStart.getMonth() + 1) + '.' + Basket.Deals[i].DateStart.getFullYear();
                        	}
                        }
                        result;
                        "";
                        dict['DateEnd'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true) {
                        		result = (Basket.Deals[i].DateEnd.getDate() < 10 ? '0' : '') + Basket.Deals[i].DateEnd.getDate() + '.' + (Basket.Deals[i].DateEnd.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateEnd.getMonth() + 1) + '.' + Basket.Deals[i].DateEnd.getFullYear();
                        	}
                        }
                        result;
                        "";
                        dict['OsagoDateStart'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && (Basket.Deals[i].Product.ProductDictCode == 'eOSAGO' || Basket.Deals[i].Product.ProductDictCode == 'OSAGO')) {
                        		result = (Basket.Deals[i].DateStart.getDate() < 10 ? '0' : '') + Basket.Deals[i].DateStart.getDate() + '.' + (Basket.Deals[i].DateStart.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateStart.getMonth() + 1) + '.' + Basket.Deals[i].DateStart.getFullYear();
                        	}
                        }
                        result;
                        "";
                        dict['OsagoDateEnd'] = ""
                        var result = '';
                        for (var i = 0; i < Basket.Deals.Count; i++) {
                        	if (Basket.Deals[i].Product != null && (Basket.Deals[i].Product.ProductDictCode == 'eOSAGO' || Basket.Deals[i].Product.ProductDictCode == 'OSAGO')) {
                        		result = (Basket.Deals[i].DateEnd.getDate() < 10 ? '0' : '') + Basket.Deals[i].DateEnd.getDate() + '.' + (Basket.Deals[i].DateEnd.getMonth() + 1 < 10 ? '0' : '') + (Basket.Deals[i].DateEnd.getMonth() + 1) + '.' + Basket.Deals[i].DateEnd.getFullYear();
                        	}
                        }
                        result;
                        "";
                        dict['Price'] = ""
                        var result = DiKaskoExternalFunctionsInvoker.GetKaskoPrice(Basket);
                        result;
                        "";
                        dict['OsagoPrice'] = ""
                        var result = DiKaskoExternalFunctionsInvoker.GetEOsagoPrice(Basket);
                        result;
                        "";
                        dict['PolicyNumber'] = ""
                		var result = '';
                		for (var i = 0; i < Basket.Deals.Count; i++) {
                			if (Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true) {
                				result = Basket.Deals[i].PolicyNumber
                			}
                		}
                		result;
                        "";		
                        dict['OsagoPolicyNumber'] = ""
                		var result = '';
                		for (var i = 0; i < Basket.Deals.Count; i++) {
                			if (Basket.Deals[i].Product != null && (Basket.Deals[i].Product.ProductDictCode == 'eOSAGO' || Basket.Deals[i].Product.ProductDictCode == 'OSAGO')) {
                				result = Basket.Deals[i].PolicySeries;
                                result += Basket.Deals[i].PolicyNumber;
                			}
                		}
                		result;
                        "";	
                        dict['LinkToPayment'] = ""
        				var result = '';
        				var containsKasko = false;
        				for(var i=0;i<Basket.Deals.Count;i++) {
        					if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Deliveries.Count > 0 && Basket.Deals[i].Deliveries[0].DeliveryWayCode === 'Email' && Basket.Deals[i].Product.ProductDictCode === 'KASKO') { 
        						containsKasko = true; 
        						break; 
        					} 
        				}
        				if (containsKasko)
        				{
        					result = DiKaskoGeneratePaymentLinkProcess.KaskoUrl;
        				}
                        result;
                        "";				
                		dict['DateRepayment'] = ""
                        var result = paymentDueDate;
                        result;
                        "";
        				dict['UpsalesInfo'] = ""
        				var result = DiKaskoExternalFunctionsInvoker.GetUpsalesInfo(Basket);
        				result;
        				"";
        				
        				dict;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Subject",
                TypeName = typeof(string).AssemblyQualifiedName,
            });
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Content",
                TypeName = typeof(string).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _sendEmailLinkToPaymentFailedErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _linkToPaymentSendEmailCustomProcess,
            });
        }

        private void InitializeExportBasketWithCommandCheck(NestedProcessModel model)
        {
            model.Identifier = "ExportBasketWithCommandCheck";
            model.Name = "Отправка корзины в Siebel c командой Check";
            model.Description = @"Отправка корзины в Siebel c командой Check";
            model.FlowProcessIdentifier = "DiKaskoExportBasketSiebelProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Command",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"'Check'",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Процесс завершен",
                NextStep = _checkSkipPsoForSpecialConditions2,
            });
        }

        private void InitializeCheckIsLegal2(ConditionModel model)
        {
            model.Identifier = "CheckIsLegal2";
            model.Name = "Юр. лицо";
            model.Description = string.Empty;
            model.Default = _formDocumentsForPsoPrinting2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"Basket.IsLegal == true",
                NextStep = _createPsoAdditionalFieldsForDraftPso,
            });
        }

        private void InitializeIsAllowedToSkipPublishForLink2_(ConditionModel model)
        {
            model.Identifier = "IsAllowedToSkipPublishForLink2_";
            model.Name = "Возможность пропуска публикации корзины для Link2";
            model.Description = string.Empty;
            model.Title = "Возможность пропуска публикации корзины для Link2";
            model.Default = null;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Нет",
                Expression = @"IsProcessApiRequest == false || IsAllowedToSkipAfterReadyForSign_.Value == false",
                NextStep = _publishBasketAfterChangedStatusToReadyForSignForEKasko,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"IsProcessApiRequest == true && IsAllowedToSkipAfterReadyForSign_.Value == true",
                NextStep = _setCheckDirectProcessFlagTrue,
            });
        }

        private void InitializeIsBoxProposalSelected(ConditionModel model)
        {
            model.Identifier = "IsBoxProposalSelected";
            model.Name = "Оформляется оффер коробка";
            model.Description = @"Оформляется оффер с признаком IsBox == true";
            model.Default = _addOtaApprovalToDeal;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Оформляется оффер коробка",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsBoxProposalSelected(Basket)",
                NextStep = _changeBasketStatusAfterPsoAndUrm,
            });
        }

        private void InitializeRedirectToExternalSys(NestedProcessModel model)
        {
            model.Identifier = "RedirectToExternalSys";
            model.Name = "Pr.Q Редирект во внешнюю систему по Fail";
            model.Description = @"Pr.Q Редирект во внешнюю систему по Fail";
            model.FlowProcessIdentifier = "RedirectProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "RedirectURL",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"Basket.CallingProcessFailReturnUrl",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Далее",
                NextStep = _diKaskoPolicyLayoutProcess,
            });
        }

        private void InitializeSavePublishBasketAfterPayment(VersionPublisherModel model)
        {
            model.Identifier = "SavePublishBasketAfterPayment";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _exportBasketWithCommandEPolicyPaid;
            model.ExceptionNextStep = null;
        }

        private void InitializeNeedToSetInitialStatusToDraft(ConditionModel model)
        {
            model.Identifier = "NeedToSetInitialStatusToDraft";
            model.Name = "Нужно ли устанавливать статус инспекции в Draft";
            model.Description = @"Нужно ли устанавливать статус инспекции в Draft";
            model.Default = _diKaskoPreInsuranceCheckStatusesProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Нужно",
                Expression = @"ChecksNavigationFunctionsInvoker.NeedToSetDraftStatus(Basket, SharedData.integrationLogin)",
                NextStep = _createInspectionFileDescriptionModelForDraftPso,
            });
        }

        private void InitializeIsLink2ExportBasketWithCommandCheck(ConditionModel model)
        {
            model.Identifier = "IsLink2ExportBasketWithCommandCheck";
            model.Name = "Необходимо отправлять в Siebel";
            model.Description = @"Необходимо отправлять в Siebel?";
            model.Title = "Link2 запрос";
            model.Default = _exportBasketWithCommandCheck;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Нет",
                Expression = @"IsProcessApiRequest && DiKaskoExternalFunctionsInvoker.HasDIUnderwriterApprovalInWork(Basket) == false",
                NextStep = _checkSkipPsoForSpecialConditions2,
            });
        }

        private void InitializePaymentPartiallyPaidFormProcess(NestedProcessModel model)
        {
            model.Identifier = "PaymentPartiallyPaidFormProcess";
            model.Name = "Форма некорректной оплаты";
            model.Description = @"Форма некорректной оплаты";
            model.FlowProcessIdentifier = "PaymentPartiallyPaidFormProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Некорректная оплата",
                NextStep = null,
            });
        }

        private void InitializePublishBasketAfterSkipPso(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketAfterSkipPso";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _checkSkipPsoForSpecialConditions2;
            model.ExceptionNextStep = null;
        }

        private void InitializeChangeBasketStatusToProcessingAtSkipPSO(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToProcessingAtSkipPSO";
            model.Name = "D9. Смена статуса корзины и сделок на \"В обработке\"";
            model.Description = @"D9. Смена статуса корзины и сделок на ""В обработке""";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _publishBasketAfterSkipPso;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Processing'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _publishBasketAfterSkipPso,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _publishBasketAfterSkipPso,
            });
        }

        private void InitializeSetRedirectUrlsToBasketContext(ProcedureModel model)
        {
            model.Identifier = "SetRedirectUrlsToBasketContext";
            model.Name = "Сохранение переданных на импорте урлов в контекст корзины";
            model.Description = @"Сохранение переданных на импорте урлов в контекст корзины";
            model.Title = "Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _paymentTypeOfflineAndA7PayWayAssign;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetRedirectUrls),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "link2SuccessURL",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.Link2SuccessURL",
                    },
                    new FunctionParameter
                    {
                        Name = "link2FailURL",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.Link2FailURL",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeGetOnlinePaymentUrlFailedErrorMessage(FormDataModel model)
        {
            model.Identifier = "GetOnlinePaymentUrlFailedErrorMessage";
            model.Name = "Алерт «Произошла ошибка при генерации ссылки на оплату»";
            model.Description = string.Empty;
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Произошла ошибка при генерации ссылки на оплату. Повторите последнее действие, если ошибка повторится, обратитесь в службу поддержки.'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Error;
            model.Caption = "Ошибка";
            model.NextStep = _diKaskoQuestionnaireProcess;
        }

        private void InitializeAddUrmlToDeal(ProcedureModel model)
        {
            model.Identifier = "AddUrmlToDeal";
            model.Name = "Добавление урм если запрос в сас отключен";
            model.Description = string.Empty;
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _checkIsLegal;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.AddUrmToDeal),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                    new FunctionParameter
                    {
                        Name = "isSensitiveDataChanged",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"RecalculationSensitiveData.Value",
                    },
                    new FunctionParameter
                    {
                        Name = "externalBasketUrmAproval",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.URMApproval).AssemblyQualifiedName,
                        Expression = @"DiKaskoExternalFunctionsInvoker.GetLastUrmApproval(ExternalBasket)",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetPaymentDueDateBeforeMessageGeneration(ExpressionRunnerModel model)
        {
            model.Identifier = "SetPaymentDueDateBeforeMessageGeneration";
            model.Name = "SetPaymentDueDateBeforeMessageGeneration";
            model.Description = string.Empty;
            model.Title = "SetPaymentDueDateBeforeMessageGeneration";
            model.Expression = @"var paymentDueDate = DiKaskoExternalFunctionsInvoker.GetDuePaymentDate(Basket, SharedData.integrationLogin, DateRepaymentWithShift);";
            model.NextStep = _prePaymentDocumentsProcess;
        }

        private void InitializeSetOfflinePaymentTypeForLink2Again(ProcedureModel model)
        {
            model.Identifier = "SetOfflinePaymentTypeForLink2Again";
            model.Name = "Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.Description = @"Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.Title = "Установка типа оффлайн-оплаты (при наличии) для Link2";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _isPaymentManualApproveAvailable;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetPaymentType),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "paymentTypeOfflineCode",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"paymentTypeOfflineCode",
                    },
                    new FunctionParameter
                    {
                        Name = "a7PayWayCode",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"a7PayWayCode",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDiKaskoSegmentationPostProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoSegmentationPostProcess";
            model.Name = "Pr.B. Пост-процесс сегментации";
            model.Description = @"Pr.B. Пост-процесс сегментации";
            model.FlowProcessIdentifier = "DiKaskoSegmentationPostProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = _diKaskoSegmentationPostProcessError;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Конструктор",
                NextStep = _getRecalculationChanges,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Ошибка",
                NextStep = _diKaskoSegmentationPostProcessError,
            });
        }

        private void InitializeCheckDirectProcessFlag(ConditionModel model)
        {
            model.Identifier = "CheckDirectProcessFlag";
            model.Name = "Необхомо отправить письмо со ссылкой на оплату";
            model.Description = @"Необхомо отправить письмо со ссылкой на оплату";
            model.Default = _hasPaymnetLinkAutoSendAndWebHookActionFlag2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "да",
                Expression = @"IsProcessApiRequest == true && GetEmailSentFlag.Value == false && DiKaskoExternalFunctionsInvoker.CanUseNeedSendMailBeforePaymentSetting(SharedData.integrationLogin) == true && !DiKaskoExternalFunctionsInvoker.IsUpsale(Basket)",
                NextStep = _setPaymentDueDateBeforeMessageGeneration,
            });
        }

        private void InitializeIsPostponedPSOSwitch(ConditionModel model)
        {
            model.Identifier = "IsPostponedPSOSwitch";
            model.Name = "Отложенный ли ПСО?";
            model.Description = @"Отложенный ли ПСО?";
            model.Default = _checkNeedPSOForLink2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"IsPostponedPSO.Value == true",
                NextStep = _getSelectedOfferIdForPostponedPso,
            });
        }

        private void InitializeNewPaymentLinkManagement(CustomProcessModel model)
        {
            model.Identifier = "NewPaymentLinkManagement";
            model.Name = "Проверка необходимости создания ссылки";
            model.Description = @"Проверка необходимости создания ссылки";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.NeedToMakeNewPaymentLinkProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Link2SuccessURL",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"SharedData.link2SuccessURL",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Link2FailURL",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"SharedData.link2FailURL",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsProcessApiRequest",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Expression = @"IsProcessApiRequest",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Нужно сделать новую ссылку",
                NextStep = _processContainsEKaskoBeforeGeneratePaymentLink,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Ссылка уже есть, и новых параметров не передано",
                NextStep = _publishBasketAfterGetOnlinePaymentUrl,
            });
        }

        private void InitializeSendEmailErrorMessage(ProcedureModel model)
        {
            model.Identifier = "SendEmailErrorMessage";
            model.Name = "Error - Произошла ошибка при отправке E-mail";
            model.Description = @"Error - Произошла ошибка при отправке E-mail";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _sendKaskoPolicyErrorMessage;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.AddCustomError),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "error",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"""Произошла ошибка при отправке E-mail""",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeIsAllowedToUseBSIForLink2(ConditionModel model)
        {
            model.Identifier = "IsAllowedToUseBSIForLink2";
            model.Name = "Возможность вызова BSI";
            model.Description = string.Empty;
            model.Default = null;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"IsAllowedToUseBSI.Value == true",
                NextStep = _diKaskoBSIProcess,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Нет",
                Expression = @"IsAllowedToUseBSI.Value == false",
                NextStep = _isAllowedToSkipPSOAfterBSICheck,
            });
        }

        private void InitializeOtaCheckForIssueButtonLink2(NestedProcessModel model)
        {
            model.Identifier = "OtaCheckForIssueButtonLink2";
            model.Name = "Проверки ота";
            model.Description = @"Проверки SAS для кнопки Отправить";
            model.Title = "Проверки SAS для кнопки Отправить";
            model.FlowProcessIdentifier = "Link2KaskoOtaCheckProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Выход",
                NextStep = _canSkipPsoForSpecialCreditAuto,
            });
        }

        private void InitializeIsPostponedPSO(ProcedureModel model)
        {
            model.Identifier = "IsPostponedPSO";
            model.Name = "Отложенное ли ПСО";
            model.Description = @"Доступность осмотра без ПСО";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.DeliveryProcess.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _getNeedPSO;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CheckIsPostponedPso),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "CheckIsPostponedPso",
            });
        }

        private void InitializeIsPaymentManualApproveAvailable(ConditionModel model)
        {
            model.Identifier = "IsPaymentManualApproveAvailable";
            model.Name = "Доступно ли ручное подтверждение платежа";
            model.Description = @"Ручное подтверждение платежа доступно, если создателем корзины является партнер Link2 c разрешением на ручное подтверждение (именованная настройка)";
            model.Default = _newPaymentLinkManagement;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Только ручное подтверждение доступно",
                Expression = @"SharedData.ProcessApiCommandName == 'Link2ConfirmPaymentCommand' || Link2FunctionsInvoker.IsOnlyPaymentManualApproveAvailable(Basket) ",
                NextStep = _setManualApproveWaitingPaymentState,
            });
        }

        private void InitializePreliminaryInsuranceInspectionProcess(NestedProcessModel model)
        {
            model.Identifier = "PreliminaryInsuranceInspectionProcess";
            model.Name = "Процесс ПСО";
            model.Description = @"Процесс ПСО";
            model.FlowProcessIdentifier = "PreliminaryInsuranceInspectionProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "DealEntityId",
                ExpressionType = typeof(int).AssemblyQualifiedName,
                InExpression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket == true) { deal = Basket.Deals[i].EntityId; } } deal",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "OfferId",
                ExpressionType = typeof(int).AssemblyQualifiedName,
                InExpression = @"GetSelectedOfferId.Value",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Person",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Person).AssemblyQualifiedName,
                InExpression = @"Basket.Deals[0].Insurant.Subject.IndividualEntity.Person",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "BasketNumber",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"Basket.Number",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "InspectionFileDescriptions",
                ExpressionType = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                InExpression = @"CreateInspectionFileDescriptionModel.InspectionFileDescriptions",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "AdditionalFields",
                ExpressionType = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                InExpression = @"CreatePsoAdditionalFields.PsoAdditionalFields",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Intermediary",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Intermediary).AssemblyQualifiedName,
                InExpression = @"DiKaskoExternalFunctionsInvoker.GetKaskoIntermediary(Basket)",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit_FilesNotSaved",
                NextStep = _diKaskoPSOProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit_InspectionCreated",
                NextStep = _setEntityContextForPso,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit_InspectionFinished",
                NextStep = _diKaskoPreInsuranceCheckStatusesProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit_InspectionNotFinished",
                NextStep = _diKaskoPSOProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit_InspectionVerificationFailure",
                NextStep = _diKaskoPreInsuranceCheckStatusesProcess,
            });
        }

        private void InitializeInitIsIrisCalculation(ExpressionRunnerModel model)
        {
            model.Identifier = "InitIsIrisCalculation";
            model.Name = "Иницализация способа расчета";
            model.Description = @"Иницализация способа расчета";
            model.Expression = @"isIrisCalculation = AdditionalData.QueryParams.IsIrisCalculation == 'true' || SharedData.UseIrisConstructorForLink2 == 'true' ||
        DiKaskoAbTestTariffCalculation.IsIrisCalculation(Basket)";
            model.NextStep = _setDealSourceProcedure;
        }

        private void InitializeDiKaskoPreInsuranceCheckStatusesProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoPreInsuranceCheckStatusesProcess";
            model.Name = "Подпроцесс проверки статусов предстраховых проверок";
            model.Description = @"Подпроцесс проверки статусов предстраховых проверок";
            model.FlowProcessIdentifier = "DiKaskoPreInsuranceCheckStatusesProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "policyIssuedByCallCenter",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"policyIssuedByCallCenter",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Все проверки успешны",
                NextStep = _changeBasketStatusAfterPsoAndUrm,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Проверки не завершены",
                NextStep = _diKaskoPSOProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Проверки не успешны",
                NextStep = _changeBasketStatusToOfferTerminated,
            });
        }

        private void InitializeExportToOssGuaranteedProcess(CustomProcessModel model)
        {
            model.Identifier = "ExportToOssGuaranteedProcess";
            model.Name = "Гарантированная доставка сделки в ОСС";
            model.Description = @"Гарантированная доставка сделки в ОСС";
            model.ImplementationTypeName = typeof(iRIS.OSS.Code.Activities.ExportToOssGuaranteedCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.StringResult).AssemblyQualifiedName;
            model.DefaultNextStep = _diKaskoSuccessfulBuyEPolicyProcess;
            model.ExceptionNextStep = _diKaskoSuccessfulBuyEPolicyProcess;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deal",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                Expression = @"var deal = {}; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && Basket.Deals[i].Product != null && Basket.Deals[i].Product.ProductDictCode == 'KASKO') { deal = Basket.Deals[i]; } } deal;",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "RsaIntegrationVersion",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"null",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "RsaCheckErrors",
                TypeName = typeof(System.Collections.Generic.IReadOnlyCollection<iRIS.InsuranceCore.Entities.Custom.RsaCheckErrorDto>).AssemblyQualifiedName,
                Expression = @"null",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "StartAfter",
                TypeName = typeof(DateTime?).AssemblyQualifiedName,
                Expression = @"null",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Message",
                TypeName = typeof(string).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _diKaskoSuccessfulBuyEPolicyProcess,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _diKaskoSuccessfulBuyEPolicyProcess,
            });
        }

        private void InitializeKaskoSaveBasketProcessKeyRelation(CustomProcessModel model)
        {
            model.Identifier = "KaskoSaveBasketProcessKeyRelation";
            model.Name = "Сохранение связи корзины и процесса";
            model.Description = @"Сохранение связи корзины и процесса";
            model.Title = "Сохранение связи корзины и процесса";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.KaskoSaveBasketProcessKeyRelationProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _setPromocodeForBasketByCompany;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeUnderwriterApprovalProcess(NestedProcessModel model)
        {
            model.Identifier = "UnderwriterApprovalProcess";
            model.Name = "Подпроцесс проверок андеррайтинга";
            model.Description = @"Подпроцесс проверок андеррайтинга";
            model.FlowProcessIdentifier = "UnderwriterApprovalProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "В основной процесс",
                NextStep = _otaCheckForIssueButtonLink2,
            });
        }

        private void InitializeAllChecksSkipRequired(ProcedureModel model)
        {
            model.Identifier = "AllChecksSkipRequired";
            model.Name = "Нужен ли пропуск всех проверок";
            model.Description = string.Empty;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _isAllowedToUseBSI;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.AllKaskoChecksMustBeSkipped),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "AllKaskoChecksMustBeSkipped",
            });
        }

        private void InitializeSetBeneficiary(ProcedureModel model)
        {
            model.Identifier = "SetBeneficiary";
            model.Name = "Заполнение выгодоприобретателя";
            model.Description = string.Empty;
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _filterOffers;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetBeneficiary),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeFilterOffers(ProcedureModel model)
        {
            model.Identifier = "FilterOffers";
            model.Name = "Фильтрация офферов";
            model.Description = @"Фильтрация офферов";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _getIsConversionRegionProcedure;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.FilterOffers),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetDateRepaymentWithShiftFlag(ExpressionRunnerModel model)
        {
            model.Identifier = "SetDateRepaymentWithShiftFlag";
            model.Name = "Установка флага DateRepaymentWithShift";
            model.Description = @"Установка флага DateRepaymentWithShift";
            model.Title = "Установка флага DateRepaymentWithShift";
            model.Expression = @"DateRepaymentWithShift = SetDealDatesDueToNowId.Value";
            model.NextStep = _setOfflinePaymentTypeForLink2Again;
        }

        private void InitializeUpdateProlongationStatus(CustomProcessModel model)
        {
            model.Identifier = "UpdateProlongationStatus";
            model.Name = "Получение информации о покупке пролонгации через ЛК";
            model.Description = string.Empty;
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.UpdateProlongationStatusCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _exportToOssGuaranteedProcess;
            model.ExceptionNextStep = _exportToOssGuaranteedProcess;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeChangeBasketStatusToOfferTerminated(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToOfferTerminated";
            model.Name = "D9. Смена статуса корзины и сделок на \"Прекращено действие предложения\"";
            model.Description = @"D9. Смена статуса корзины и сделок на ""Прекращено действие предложения""";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'OfferTerminated'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _publishBasketBeforeDiKaskoPSOThanksgivingProcess,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _publishBasketBeforeDiKaskoPSOThanksgivingProcess,
            });
        }

        private void InitializeChangeBasketStatusAfterPsoAndUrm(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusAfterPsoAndUrm";
            model.Name = "D9. Смена статуса корзины и сделок на \"Готово к оформлению\"";
            model.Description = @"D9. Смена статуса корзины и сделок на ""Готово к оформлению""";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'ReadyForSign'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _setDealDatesDueToNowId,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _setDealDatesDueToNowId,
            });
        }

        private void InitializeIsB2CPartner(ConditionModel model)
        {
            model.Identifier = "IsB2CPartner";
            model.Name = "Партнер б2с";
            model.Description = @"Партнер б2с";
            model.Default = _mapSumForIrisCalculation;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsB2CPartner(SharedData.integrationLogin) || DiKaskoExternalFunctionsInvoker.IsUpsale(Basket)",
                NextStep = _diKaskoQuestionnaireProcess,
            });
        }

        private void InitializeCheckInitBasketSourceDeals(ConditionModel model)
        {
            model.Identifier = "CheckInitBasketSourceDeals";
            model.Name = "Проверка необходимости инициализации сделок";
            model.Description = @"CheckInitBasketSourceDeals";
            model.Default = _dealInitializationProcedure;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Сделки инициализированы",
                Expression = @"CustomInputData.BasketSource != null 
        && CustomInputData.BasketSource.Deals != null 
        && CustomInputData.BasketSource.Deals.Count > 0",
                NextStep = _copyDealsFromBasketSource,
            });
        }

        private void InitializeSetDealSourceProcedure(ProcedureModel model)
        {
            model.Identifier = "SetDealSourceProcedure";
            model.Name = "Проставление источника котировки у сделок.";
            model.Description = @"Проставление источника котировки у сделок.";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _setSiebelVersionIntegration;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetDealSource),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "isLink2Api",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"IsProcessApiRequest",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSasCheckForIssueButtonLink2(NestedProcessModel model)
        {
            model.Identifier = "SasCheckForIssueButtonLink2";
            model.Name = "Проверки SAS для кнопки Отправить";
            model.Description = @"Проверки SAS для кнопки Отправить";
            model.Title = "Проверки SAS для кнопки Отправить";
            model.FlowProcessIdentifier = "DiKaskoQuestionnaireSasCheckProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "SkipKaskoCheck",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"true",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "IsSensitiveDataChanged",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"RecalculationSensitiveData.Value",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "ExternalBasketUrmAproval",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.URMApproval).AssemblyQualifiedName,
                InExpression = @"DiKaskoExternalFunctionsInvoker.GetLastUrmApproval(ExternalBasket)",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Запрет оформления",
                NextStep = null,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Проверки не пройдены, но продолжаем",
                NextStep = _link2KaskoUrmCheckProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Проверки успешно пройдены",
                NextStep = _link2KaskoUrmCheckProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Редактировать данные",
                NextStep = null,
            });
        }

        private void InitializeAddOtaApprovalToDeal(ProcedureModel model)
        {
            model.Identifier = "AddOtaApprovalToDeal";
            model.Name = "Добавление ота";
            model.Description = string.Empty;
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _recalculationSensitiveData;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.AddOtaApprovalToDeal),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDiKaskoBSIProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoBSIProcess";
            model.Name = "Подпроцесс проверки BSI";
            model.Description = string.Empty;
            model.Title = "Подпроцесс проверки BSI";
            model.FlowProcessIdentifier = "DiKaskoBSIProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Возможен пропуск ПСО",
                NextStep = _setIsPSOAllowedToSkip,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Невозможен пропуск ПСО",
                NextStep = _isAllowedToSkipPSOAfterBSICheck,
            });
        }

        private void InitializeCopyDealsFromBasketSource(ExpressionRunnerModel model)
        {
            model.Identifier = "CopyDealsFromBasketSource";
            model.Name = "Копирование сделок из BasketSource";
            model.Description = @"Копирование сделок из BasketSource";
            model.Expression = @"Basket.Deals = CustomInputData.BasketSource.Deals;
        Basket.ParentBasketNumber = CustomInputData.BasketSource.ParentBasketNumber;";
            model.NextStep = _setDefaultCurrencyToDeals;
        }

        private void InitializeIsPaymentByA7Receipt(ConditionModel model)
        {
            model.Identifier = "IsPaymentByA7Receipt";
            model.Name = "Оплата по квитанции А7?";
            model.Description = @"Оплата по квитанции А7?";
            model.Default = _checkUniversalPaymentFormProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsPaymentByA7Receipt(Basket)",
                NextStep = _link2KaskoBamIntegrationProcess,
            });
        }

        private void InitializeCheckProductDictCode(ConditionModel model)
        {
            model.Identifier = "CheckProductDictCode";
            model.Name = "Анализ продуктов в сделках Deal.Product.ProductDictCode";
            model.Description = @"Анализ продуктов в сделках Deal.Product.ProductDictCode";
            model.Default = _generationKaskoMessageContentCustomProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "ProductDictCodeIsOsago",
                Expression = @"var flag = false; for(var i = 0; i < Basket.Deals.Count; i++) { if (Basket.Deals[i].Product.ProductDictCode == 'OSAGO' && Basket.Deals[i].IsInBasket == true && Basket.Deals[i].IsEPolicy !== true) { flag = true; } } flag",
                NextStep = _sendKaskoPolicySuccessMessage,
            });
        }

        private void InitializeInsuranceInspectionWithFilesSavingCustomProcess(CustomProcessModel model)
        {
            model.Identifier = "InsuranceInspectionWithFilesSavingCustomProcess";
            model.Name = "Процесс отправки доп файлов в осмотр.";
            model.Description = @"Процесс отправки доп файлов в осмотр.";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.InsuranceInspectionWithFilesSavingCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _getInspection;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealEntityId",
                TypeName = typeof(int).AssemblyQualifiedName,
                Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal.EntityId;",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InspectionFileDescriptions",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoInspectionFileDescriptionModel>).AssemblyQualifiedName,
                Expression = @"CreateInspectionFileDescriptionModelForPostponedPso.InspectionFileDescriptions",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AdditionalFields",
                TypeName = typeof(List<iRIS.InsuranceCore.Code.Interfaces.Clients.ViewAppServiceClient.Models.PsoAdditionalFieldModel>).AssemblyQualifiedName,
                Expression = @"CreatePsoAdditionalFieldsForPostponedPso.PsoAdditionalFields",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeMapSumForIrisCalculation(ProcedureModel model)
        {
            model.Identifier = "MapSumForIrisCalculation";
            model.Name = "Маппинг страховых сумм сделки Каско для расчета с тарификатором";
            model.Description = @"Маппинг страховых сумм сделки Каско для расчета с тарификатором";
            model.Title = "Иницализация счетов перед печатью";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _diKaskoQuestionnaireProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.MapSumForIrisCalculation),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deal",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                        Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal;",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeEnrichBasketBySiebelIdsBeforeSendToOssEKasko(CustomProcessModel model)
        {
            model.Identifier = "EnrichBasketBySiebelIdsBeforeSendToOssEKasko";
            model.Name = "Обогащение корзины SiebelIds перед отправкой в ОСС ";
            model.Description = @"Обогащение корзины SiebelIds перед отправкой в ОСС электронного Каско";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.Siebel.CustomProcesses.EnrichBasketBySiebelIdsProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _setExternalSystemTypeProcedure,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _setExternalSystemTypeProcedure,
            });
        }

        private void InitializeLink2KaskoBamIntegrationProcess(NestedProcessModel model)
        {
            model.Identifier = "Link2KaskoBamIntegrationProcess";
            model.Name = "Интеграция с BAM по квитанции А7";
            model.Description = @"Интеграция с BAM по квитанции А7";
            model.FlowProcessIdentifier = "Link2KaskoBamIntegrationProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Номер квитанции получен",
                NextStep = _checkUniversalPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Ошибка интеграции с BAM",
                NextStep = _checkUniversalPaymentFormProcess,
            });
        }

        private void InitializeDiKaskoSuccessfulBuyEPolicyProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoSuccessfulBuyEPolicyProcess";
            model.Name = "Pr.X. Успешная покупка е-полиса";
            model.Description = @"Pr.X. Успешная покупка е-полиса";
            model.FlowProcessIdentifier = "DiKaskoSuccessfulBuyEPolicyProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Перейти на главную страницу портала",
                NextStep = _exitMainProcess,
            });
        }

        private void InitializeSavePaymentLink(ExpressionRunnerModel model)
        {
            model.Identifier = "SavePaymentLink";
            model.Name = "Сохранение ссылки на оплату";
            model.Description = string.Empty;
            model.Title = "SetPaymentDueDate";
            model.Expression = @"DiKaskoExternalFunctionsInvoker.SavePaymentLink(Basket, DiKaskoGeneratePaymentLinkProcess.KaskoUrl);";
            model.NextStep = _publishBasketAfterGetOnlinePaymentUrl;
        }

        private void InitializeInitializeInvoicesBeforeLink2Print(ProcedureModel model)
        {
            model.Identifier = "InitializeInvoicesBeforeLink2Print";
            model.Name = "Иницализация счетов перед печатью";
            model.Description = @"Иницализация счетов перед печатью";
            model.Title = "Иницализация счетов перед печатью";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _setRedirectUrlsToBasketContext;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoQuestionnaireProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoQuestionnaireProcedures.InitializeInvoiceDealKasko),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetDefaultCurrencyToDeals(ExpressionRunnerModel model)
        {
            model.Identifier = "SetDefaultCurrencyToDeals";
            model.Name = "Присвоение валюты для сделок по умолчанию Руб. ";
            model.Description = @"IRIS-47852";
            model.Title = "Присвоение валюты для сделок по умолчанию Руб. ";
            model.Expression = @"for(var i = 0; i < Basket.Deals.Count; i++) { Basket.Deals[i].SelectedCurrencyCode = 'RUR'; }";
            model.NextStep = _changeBasketStatusToSegmentation;
        }

        private void InitializePreCheckBasketPayment(NestedProcessModel model)
        {
            model.Identifier = "PreCheckBasketPayment";
            model.Name = "Проверки перед оплатой Корзины";
            model.Description = @"Проверки перед оплатой Корзины";
            model.FlowProcessIdentifier = "PreCheckBasketUniversalPayment";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = _diKaskoPolicyLayoutProcess;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "formingDocumentsOnly",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"false",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "BackToExternalProcess",
                NextStep = _diKaskoPolicyLayoutProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Завершение оформления",
                NextStep = _checkUniversalPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "К оплате",
                NextStep = _initializeInvoices,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "К форме проверки платежа",
                NextStep = _checkUniversalPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Назад",
                NextStep = _diKaskoPolicyLayoutProcess,
            });
        }

        private void InitializeLink2KaskoUrmCheckProcess(NestedProcessModel model)
        {
            model.Identifier = "Link2KaskoUrmCheckProcess";
            model.Name = "Подпроцесс проверок УРМ";
            model.Description = string.Empty;
            model.FlowProcessIdentifier = "Link2KaskoUrmCheckProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "FillIntouchInternal",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"false",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Продолжение процесса по несовпадению роли",
                NextStep = _underwriterApprovalProcess,
            });
        }

        private void InitializeGetRecalculationChanges(CustomProcessModel model)
        {
            model.Identifier = "GetRecalculationChanges";
            model.Name = "Определение ченжей при перерасчете";
            model.Description = @"Определение изменений при перерасчете";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.GetRecalculationChangesCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Entities.ChangesResult).AssemblyQualifiedName;
            model.DefaultNextStep = _initChanges;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "ExpectedBasket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"ExternalBasket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "ActualBasket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Changes",
                TypeName = typeof(iRIS.InsuranceCore.Entities.ChangesWrapper).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeSetExternalSystemTypeProcedure(ProcedureModel model)
        {
            model.Identifier = "SetExternalSystemTypeProcedure";
            model.Name = "Заполнение ExternalSystemType для приложенных документов";
            model.Description = @"Заполнение ExternalSystemType для приложенных документов";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _savePublishBasketAfterPolicyIssued;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetExternalSystemTypeToDocs),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "isProcessApiRequest",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"IsProcessApiRequest",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeCheckNeedPSOForLink2(ConditionModel model)
        {
            model.Identifier = "CheckNeedPSOForLink2";
            model.Name = "Необходимость проверки для пролонгации через Link2";
            model.Description = @"Необходимость проверки для пролонгации через Link2";
            model.Default = _formDocumentsForPsoPrinting;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Link2ProlongationWithoutInspection",
                Expression = @"IsProcessApiRequest && KaskoQuestionnaireExternalFunctionsInvoker.IsKaskoProlongation(Basket)&& DiKaskoExternalFunctionsInvoker.CheckDealWithoutInspection(Basket)",
                NextStep = _diKaskoPreInsuranceCheckStatusesProcess,
            });
        }

        private void InitializeIsAllowedToSkipPublishAfterReadyForSign(ProcedureModel model)
        {
            model.Identifier = "IsAllowedToSkipPublishAfterReadyForSign";
            model.Name = "Возможность пропуска публикации корзины";
            model.Description = string.Empty;
            model.Title = "Возможность пропуска публикации корзины";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _isAllowedToSKipPublishForLink2;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.CheckIsAllowedSkipPublishBasket),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "integrationLogin",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "CheckIsAllowedSkipPublishBasket",
            });
        }

        private void InitializeFillDateSign(ProcedureModel model)
        {
            model.Identifier = "FillDateSign";
            model.Name = "Заполнение даты платежа";
            model.Description = @"Заполнение даты платежа";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _fillDeliveryDate;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FillDateSign),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "payment",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Payment).AssemblyQualifiedName,
                        Expression = @"Basket.Payments[InitializeInvoices.PaymentIndex]",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeFormDocumentsForPsoPrinting2(ProcedureModel model)
        {
            model.Identifier = "FormDocumentsForPsoPrinting2";
            model.Name = "E2. Формирование документов для печати (Сделки КАСКО Рутовой Корзины с признаком IsInBasket==true; ShouldSaveInDB == true)";
            model.Description = @"E2. Формирование документов для печати (Сделки КАСКО Рутовой Корзины с признаком IsInBasket==true; ShouldSaveInDB == true)";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _hasUrmApprovalsInDeal;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FormDocumentsForPrintingKasko),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deals",
                        TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                        Expression = @"deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true)deals.push(Basket.Deals[i])}deals;",
                    },
                    new FunctionParameter
                    {
                        Name = "shouldSaveInDb",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"true",
                    },
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDiKaskoHoldedPaymentFormProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoHoldedPaymentFormProcess";
            model.Name = "Форма захолдированного платежа";
            model.Description = @"Форма захолдированного платежа";
            model.FlowProcessIdentifier = "DiKaskoHoldedPaymentFormProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Форма холдированного платежа пройдена",
                NextStep = null,
            });
        }

        private void InitializeSetManualApproveWaitingPaymentState(ExpressionRunnerModel model)
        {
            model.Identifier = "SetManualApproveWaitingPaymentState";
            model.Name = "Установка статуса платежа \"Ожидание ручного подтверждения\"";
            model.Description = @"Установка статуса платежа ""Ожидание ручного подтверждения""";
            model.Expression = @"Basket.Payments[InitializeInvoices.PaymentIndex].StatusCode = 'ManualApproveWaiting'";
            model.NextStep = _isPaymentByA7Receipt;
        }

        private void InitializeSetDealDateStartDueToNow(ProcedureModel model)
        {
            model.Identifier = "SetDealDateStartDueToNow";
            model.Name = "Установка даты старта полиса";
            model.Description = @"Установка даты старта полиса";
            model.Title = "Установка даты старта полиса";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _fillDateSign;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetDealDateStartDueToNow),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "integrationLoginName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.integrationLogin",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetCheckDirectProcessFlagTrue(ExpressionRunnerModel model)
        {
            model.Identifier = "SetCheckDirectProcessFlagTrue";
            model.Name = "Установка флага прямой оплаты";
            model.Description = @"Установка флага прямой оплаты (без ПСО)";
            model.Expression = @"if(policyIssuedByCallCenter){CheckDirectProcessFlag = 'false'}else{CheckDirectProcessFlag = 'true'}";
            model.NextStep = _preCheckBasketPayment;
        }

        private void InitializeProcessContainsEKaskoBeforeGeneratePaymentLink(ConditionModel model)
        {
            model.Identifier = "ProcessContainsEKaskoBeforeGeneratePaymentLink";
            model.Name = "Процесс содержит еКаско";
            model.Description = @"Процесс содержит еКаско";
            model.Default = _publishBasketAfterGetOnlinePaymentUrl;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Deliveries.Count > 0 && Basket.Deals[i].Deliveries[0].DeliveryWayCode === 'Email' && Basket.Deals[i].Product.ProductDictCode === 'KASKO') { flag = true; break; } } flag;",
                NextStep = _getRecurringToken,
            });
        }

        private void InitializeDiKaskoPolicyLayoutProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoPolicyLayoutProcess";
            model.Name = "Cтраница макета КАСКО";
            model.Description = @"Cтраница макета КАСКО";
            model.FlowProcessIdentifier = "DiKaskoPolicyLayoutProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Переход к оплате",
                NextStep = _generatePolicyNumberByServiceProcess,
            });
        }

        private void InitializeSetEndOfDayForRepaymentDate(ProcedureModel model)
        {
            model.Identifier = "SetEndOfDayForRepaymentDate";
            model.Name = "Смещение даты оплаты на 1 день";
            model.Description = @"Смещение даты оплаты на 1 день.
        Для кейса день в день со смещением проверок.";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _setDateRepaymentWithShiftFlag;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetEndOfDayForRepaymentDate),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "needUpdateDateRepayment",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"SetDealDatesDueToNowId.Value",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeInsurancePostponedInspectionAdditionalFieldsSendProcess(CustomProcessModel model)
        {
            model.Identifier = "InsurancePostponedInspectionAdditionalFieldsSendProcess";
            model.Name = "Процесс редактирования дополнительных полей формы осмотра.";
            model.Description = @"Процесс редактирования дополнительных полей формы осмотра после разделения файла с пользователем.";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.InsuranceInspectionSendAdditionalFieldsCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _changeBasketStatusToProcessing;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
                Expression = @"GetInspection.Inspection",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeInsurancePostponedInspectionSharingProcess(CustomProcessModel model)
        {
            model.Identifier = "InsurancePostponedInspectionSharingProcess";
            model.Name = "Процесс разделения отложенного осмотра с пользователем";
            model.Description = @"Процесс разделения осмотра с пользователем";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.InsuranceInspectionSharingCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _insurancePostponedInspectionAdditionalFieldsSendProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
                Expression = @"GetInspection.Inspection",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Person",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Person).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.GetInspectionPerson(Basket, GetInspection.Inspection.InspectionResponsibleCode)",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeInsurancePostponedInspectionCreationProcess(CustomProcessModel model)
        {
            model.Identifier = "InsurancePostponedInspectionCreationProcess";
            model.Name = "Процесс создания отложенного осмотра";
            model.Description = @"Процесс создания осмотра во ViewApp";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.InsuranceInspectionCreationCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.DefaultNextStep = _insurancePostponedInspectionSharingProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
                Expression = @"GetInspection.Inspection",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "OfferId",
                TypeName = typeof(int).AssemblyQualifiedName,
                Expression = @"GetSelectedOfferIdForPostponedPso.Value",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeInitChanges(ExpressionRunnerModel model)
        {
            model.Identifier = "InitChanges";
            model.Name = "Иницализация ченжей";
            model.Description = @"Иницализация ченжей";
            model.Expression = @"RecalculationChanges = GetRecalculationChanges.Changes ";
            model.NextStep = _diKaskoConstructorProcess;
        }

        private void InitializeChangeBasketStatusToRequestFillingAftrerConstructor(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToRequestFillingAftrerConstructor";
            model.Name = "D9. Смена статуса корзины и сделок";
            model.Description = @"D9. Смена статуса корзины и сделок";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _isB2CPartner;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'RequestFilling'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = null,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _isB2CPartner,
            });
        }

        private void InitializeDiKaskoConstructorProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoConstructorProcess";
            model.Name = "Pr.H. Конструктор";
            model.Description = @"Pr.H. Конструктор";
            model.FlowProcessIdentifier = "DiKaskoConstructorProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Продолжить оформление",
                NextStep = _changeBasketStatusToRequestFillingAftrerConstructor,
            });
        }

        private void InitializeSetIsPSOAllowedToSkip(ExpressionRunnerModel model)
        {
            model.Identifier = "SetIsPSOAllowedToSkip";
            model.Name = "Установка флага пропуска ПСО";
            model.Description = string.Empty;
            model.Expression = @"IsAllowedToSkipPSO = true";
            model.NextStep = _isAllowedToSkipPSOAfterBSICheck;
        }

        private void InitializeRecalculationSensitiveData(ProcedureModel model)
        {
            model.Identifier = "RecalculationSensitiveData";
            model.Name = "Проверка чувствительных изменений для URM";
            model.Description = @"Проверка чувствительных изменений для URM при перерасчете";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _addUrmlToDeal;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.IsSensitiveDataChanged),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "recalculationChanges",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.ChangesWrapper).AssemblyQualifiedName,
                        Expression = @"RecalculationChanges",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "IsSensitiveDataChanged",
            });
        }

        private void InitializePaymentTypeOfflineAndA7PayWayAssign(ExpressionRunnerModel model)
        {
            model.Identifier = "PaymentTypeOfflineAndA7PayWayAssign";
            model.Name = "Привязка типа оплаты";
            model.Description = @"Сохранение типа оплаты в процессные переменные для возможности доступа к нему из любой части процесса";
            model.Expression = @"paymentTypeOfflineCode = SharedData.PaymentTypeOffline;
        a7PayWayCode = SharedData.A7PayWay;";
            model.NextStep = _setOfflinePaymentTypeForLink2;
        }

        private void InitializeFindIntermediariesAndCostcenter(CustomProcessModel model)
        {
            model.Identifier = "FindIntermediariesAndCostcenter";
            model.Name = "A10. Определение посредников и канала продаж для сделок корзины.";
            model.Description = @"A10. Определение посредников и канала продаж для сделок корзины.";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.FindIntermediariesAndCostcenterV2).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.FindIntermediariesAndCostcenterResultV2).AssemblyQualifiedName;
            model.DefaultNextStep = _availableOfferIdsInitializationProcedure;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AuthorizationData",
                TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                Expression = @"AuthorizationData",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "CostCenterCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"SharedData.CostCenterCode",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "ProductsWithIntermediaries",
                TypeName = typeof(Dictionary<int, List<iRIS.InsuranceCore.Entities.Intermediary>>).AssemblyQualifiedName,
            });
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "ProductsWithCostcenters",
                TypeName = typeof(Dictionary<int, iRIS.InsuranceCore.Entities.Costcenter>).AssemblyQualifiedName,
            });
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "Intermediaries",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Intermediary>).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeGetRecurringToken(ProcedureModel model)
        {
            model.Identifier = "GetRecurringToken";
            model.Name = "Получить реккурентный токен";
            model.Description = @"Получить реккурентный токен";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.StringResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _getUrlResumeProcessKaskoWithToken;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetRecurringToken),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(string).AssemblyQualifiedName,
                SourceName = "GetRecurringToken",
            });
        }

        private void InitializeInsuranceClassInitialization(ProcedureModel model)
        {
            model.Identifier = "InsuranceClassInitialization";
            model.Name = "Загрузка класса страхования";
            model.Description = @"Загрузка класса страхования";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.InsuranceClassResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insuranceClassAssign;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.LoadEntity),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "entityTypeName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"'InsuranceClass'",
                    },
                    new FunctionParameter
                    {
                        Name = "id",
                        TypeName = typeof(int).AssemblyQualifiedName,
                        Expression = @"1",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "InsuranceClass",
                TypeName = typeof(iRIS.InsuranceCore.Entities.InsuranceClass).AssemblyQualifiedName,
                SourceName = "LoadEntity",
            });
        }

        private void InitializeInsuranceClassAssign(ExpressionRunnerModel model)
        {
            model.Identifier = "InsuranceClassAssign";
            model.Name = "Привязка класса страхования к процессу DI авто";
            model.Description = @"Привязка класса страхования к процессу DI авто";
            model.Expression = @"insuranceClass = InsuranceClassInitialization.InsuranceClass";
            model.NextStep = _insuranceTypesInitialization;
        }

        private void InitializeInsuranceTypesInitialization(ProcedureModel model)
        {
            model.Identifier = "InsuranceTypesInitialization";
            model.Name = "Загрузка типов страхования";
            model.Description = @"Загрузка типов страхования";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.InsuranceTypesResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insuranceTypesAssign;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.LoadInsuranceTypes),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "codes",
                        TypeName = typeof(List<string>).AssemblyQualifiedName,
                        Expression = @"['KASKO','OSAGO']",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "InsuranceTypes",
                TypeName = typeof(iRIS.InsuranceCore.Generated.Processes.InsuranceTypesResult).AssemblyQualifiedName,
                SourceName = "LoadInsuranceTypes",
            });
        }

        private void InitializeInsuranceTypesAssign(ExpressionRunnerModel model)
        {
            model.Identifier = "InsuranceTypesAssign";
            model.Name = "Привязка типов страхования к процессу еОсаго";
            model.Description = @"Привязка типов страхования к процессу еОсаго";
            model.Expression = @"insuranceTypes = InsuranceTypesInitialization.InsuranceTypes";
            model.NextStep = _basketInitializationProcess;
        }

        private void InitializeBasketInitializationProcess(NestedProcessModel model)
        {
            model.Identifier = "BasketInitializationProcess";
            model.Name = "Pr.A. Инициализация Корзины";
            model.Description = @"Pr.A. Инициализация Корзины";
            model.FlowProcessIdentifier = "BasketInitializationProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "insuranceClass",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.InsuranceClass).AssemblyQualifiedName,
                InExpression = @"insuranceClass",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "insuranceTypes",
                ExpressionType = typeof(List<iRIS.InsuranceCore.Entities.InsuranceType>).AssemblyQualifiedName,
                InExpression = @"insuranceTypes",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Инициализация пройдена",
                NextStep = _kaskoSaveBasketProcessKeyRelation,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Ошибка",
                NextStep = _basketInitializationProcessError,
            });
        }

        private void InitializeAvailableOfferIdsInitializationProcedure(ProcedureModel model)
        {
            model.Identifier = "AvailableOfferIdsInitializationProcedure";
            model.Name = "A6. Определение списка доступных офферов (Корзина, Посредник)";
            model.Description = @"A6. Определение списка доступных офферов (Корзина, A10.Посредник)";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _checkInitBasketSourceDeals;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.InitializeAvailableOffers),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "intermediaries",
                        TypeName = typeof(List<iRIS.InsuranceCore.Entities.Intermediary>).AssemblyQualifiedName,
                        Expression = @"FindIntermediariesAndCostcenter.Intermediaries",
                    },
                    new FunctionParameter
                    {
                        Name = "upsaleSegmentsIds",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"SharedData.link2UpsaleSegments",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDealInitializationProcedure(ProcedureModel model)
        {
            model.Identifier = "DealInitializationProcedure";
            model.Name = "A3. Инициализация сделок";
            model.Description = @"A3. Инициализация сделок";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _setDefaultCurrencyToDeals;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.InitializeDeals),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeChangeBasketStatusToSegmentation(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToSegmentation";
            model.Name = "D9. Смена статуса корзины и сделок";
            model.Description = @"D9. Смена статуса корзины и сделок";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _setIntermediariesAndCostcenter;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Segmentation'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false)deals.push(Basket.Deals[i])}deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = null,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _setIntermediariesAndCostcenter,
            });
        }

        private void InitializeSetOrResetInsuranceTypes(ProcedureModel model)
        {
            model.Identifier = "SetOrResetInsuranceTypes";
            model.Name = "Изменение типа страхования";
            model.Description = @"Изменение типа страхования";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _setDefaultAutoValue;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetOrResetInsuranceTypes),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "insuranceTypes",
                        TypeName = typeof(List<string>).AssemblyQualifiedName,
                        Expression = @"CustomInputData.InsuranceTypes != null ? CustomInputData.InsuranceTypes : new Array()",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSetDefaultAutoValue(ProcedureModel model)
        {
            model.Identifier = "SetDefaultAutoValue";
            model.Name = "Дефолтные значения для полей ТС 'С прицепом' и 'Цель использования'";
            model.Description = @"Дефолтные значения для полей ТС 'С прицепом' и 'Цель использования'";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _initializeVersionAutoDictionaryClientProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetDefaultAutoValueForKaskoProcess),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSegmentationProcess(NestedProcessModel model)
        {
            model.Identifier = "SegmentationProcess";
            model.Name = "Pr.B. Сегментация ";
            model.Description = @"Pr.B. Сегментация ";
            model.FlowProcessIdentifier = "DiKaskoSegmentationProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "IsUseNewTariffs",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"SharedData['IsUseNewTariffs']",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "IsBasketRecalculated",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"ExternalBasket != null ? true : false",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Сегментация пройдена",
                NextStep = _setBeneficiary,
            });
        }

        private void InitializeGetIsConversionRegionProcedure(ProcedureModel model)
        {
            model.Identifier = "GetIsConversionRegionProcedure";
            model.Name = "Относится ли регион использования к конверсионным";
            model.Description = @"Относится ли регион использования к конверсионным";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _diKaskoSegmentationPostProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DIKaskoCreateActivityProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DIKaskoCreateActivityProcedures.GetIsConversionRegion),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "GetIsConversionRegion",
            });
        }

        private void InitializeDiKaskoQuestionnaireProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoQuestionnaireProcess";
            model.Name = "Авто. Анкета";
            model.Description = @"Авто. Анкета";
            model.FlowProcessIdentifier = "DiKaskoQuestionnaireProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "DiAccountNumberIn",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"null",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "FillIntouchInternal",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"false",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "DisableActivityUnderWriter",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"ReadFlagDisableActivityUnderWriterFromConfig.Value",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "policyIssuedByCallCenter",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"policyIssuedByCallCenter",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "EOsagoImportDataHash",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"EOsagoImportDataHash",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Анкета заполнена",
                NextStep = _setPaymentDueDate,
            });
        }

        private void InitializeBasketInitializationProcessError(ExitPointModel model)
        {
            model.Identifier = "BasketInitializationProcessError";
            model.Name = "Ошибка";
            model.Description = @"Ошибка";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeSendKaskoPolicySuccessMessage(FormDataModel model)
        {
            model.Identifier = "SendKaskoPolicySuccessMessage";
            model.Name = "Алерт 'Успешная отправка полиса Каско клиенту'";
            model.Description = @"Алерт 'Успешная отправка полиса Каско клиенту'";
            model.Title = "Алерт 'Успешная отправка полиса Каско клиенту'";
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Ваш полис успешно отправлен'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Info;
            model.Caption = " Сообщение";
            model.NextStep = _changeBasketStatusToPolicyIssued;
        }

        private void InitializeChangeBasketStatusToPolicyIssued(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToPolicyIssued";
            model.Name = "D9. Смена статуса корзины и сделок на \"Полис выдан\"";
            model.Description = @"D9. Смена статуса корзины и сделок на ""Полис выдан""";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _enrichBasketBySiebelIdsBeforeSendToOssEKasko;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'PolicyIssued'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _enrichBasketBySiebelIdsBeforeSendToOssEKasko,
            });
        }

        private void InitializeFormDocumentsForPrinting(ProcedureModel model)
        {
            model.Identifier = "FormDocumentsForPrinting";
            model.Name = "E2. Формирование документов для печати ";
            model.Description = @"E2. Формирование документов для печати";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _needSendPolicyToEmail;
            model.ExceptionNextStep = _sendKaskoPolicyErrorMessage;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FormDocumentsForPrintingKasko),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deals",
                        TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                        Expression = @"deals = [];for(var i=0;i<Basket.Deals.Count;i++){if(Basket.Deals[i].Product.ProductDictCode == 'KASKO' && Basket.Deals[i].IsInBasket == true)deals.push(Basket.Deals[i])}deals;",
                    },
                    new FunctionParameter
                    {
                        Name = "shouldSaveInDb",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"true",
                    },
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeSavePublishBasketAfterPolicyIssued(VersionPublisherModel model)
        {
            model.Identifier = "SavePublishBasketAfterPolicyIssued";
            model.Name = "F1. Публикация версии после отправки полиса";
            model.Description = @"F1. Публикация версии после отправки полиса";
            model.Title = "F1. Публикация версии после отправки полиса";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _salesLoggingProcess;
            model.ExceptionNextStep = null;
        }

        private void InitializeSendKaskoPolicyErrorMessage(FormDataModel model)
        {
            model.Identifier = "SendKaskoPolicyErrorMessage";
            model.Name = "Алерт 'Сбой отправки полиса Каско клиенту'";
            model.Description = @"Алерт 'Сбой отправки полиса Каско клиенту'";
            model.Title = "Алерт 'Сбой отправки полиса Каско клиенту'";
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Сбой отправки'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Error;
            model.Caption = "Ошибка";
            model.NextStep = _enrichBasketBySiebelIdsBeforeSendToOssEKasko;
        }

        private void InitializeSetEmailSentFlag(ProcedureModel model)
        {
            model.Identifier = "SetEmailSentFlag";
            model.Name = "Установка флага отправки письма на оплату";
            model.Description = @"Установка флага отправки письма на оплату";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _skipCreatePaymentLinkCheckSecond;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetEmailSentFlag),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDiKaskoGeneratePaymentLinkProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoGeneratePaymentLinkProcess";
            model.Name = "Процесс генерации ссылки на оплату";
            model.Description = @"Процесс генерации ссылки на оплату";
            model.FlowProcessIdentifier = "DiKaskoGeneratePaymentLinkProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = typeof(iRIS.KaskoLink2.Generated.Processes.DiKaskoGeneratePaymentLinkProcess.PaymentLinksResult).AssemblyQualifiedName;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "CallbackUrl",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"GetUrlResumeProcessKaskoWithToken.Value",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "HidePreviewForm",
                ExpressionType = typeof(bool?).AssemblyQualifiedName,
                InExpression = @"CheckDirectProcessFlag == 'true' || Link2FunctionsInvoker.BasketCreatorIsLink2Partner(Basket)",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "DateRepayment",
                ExpressionType = typeof(DateTime?).AssemblyQualifiedName,
                InExpression = @"DiKaskoExternalFunctionsInvoker.GetDateRepayment(Basket, GetRecurringToken.Value)",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "InitRecurring",
                ExpressionType = typeof(bool?).AssemblyQualifiedName,
                InExpression = @"DiKaskoExternalFunctionsInvoker.GetInitRecurring(Basket, GetRecurringToken.Value)",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "RecurringToken",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"GetRecurringToken.Value",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.ReturnParameters.Add(new ProcedureModelOutput
            {
                Name = "KaskoUrl",
                TypeName = typeof(string).AssemblyQualifiedName,
                SourceName = "KaskoUrl",
            });
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Ошибка генерации ссылки на оплату",
                NextStep = _getOnlinePaymentUrlFailedErrorMessage,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Ссылка на оплату сгенерирована",
                NextStep = _savePaymentLink,
            });
        }

        private void InitializeSetCheckDirectProcessFlagFalse(ExpressionRunnerModel model)
        {
            model.Identifier = "SetCheckDirectProcessFlagFalse";
            model.Name = "Установка флага оплаты через Email";
            model.Description = @"Установка флага оплаты через Email";
            model.Expression = @"CheckDirectProcessFlag = 'false'";
            model.NextStep = _preCheckBasketPayment;
        }

        private void InitializeRedirectToOnlinePaymentDefault(InputModel model)
        {
            model.Identifier = "RedirectToOnlinePaymentDefault";
            model.Name = "Статус неопределенный";
            model.Description = @"Статус неопределенный";
            model.IsDefaultRedirect = true;
            model.ParallelInput = null;
            model.NextStep = _setCheckDirectProcessFlagTrue;
        }

        private void InitializeExternalBasketInitialization(ExpressionRunnerModel model)
        {
            model.Identifier = "ExternalBasketInitialization";
            model.Name = "Инициализация ExternalBasket";
            model.Description = @"Создание глубокой копии ExternalBasket";
            model.Expression = @"ExternalBasket = DiKaskoExternalFunctionsInvoker.DeepCopyBasket(SharedData['ExternalBasket'])";
            model.NextStep = _findIntermediariesAndCostcenter;
        }

        private void InitializeReadFlagDisableActivityUnderWriterFromConfig(ProcedureModel model)
        {
            model.Identifier = "ReadFlagDisableActivityUnderWriterFromConfig";
            model.Name = "Чтение флага отключения активности для андерайтеров из конфигурационного файла";
            model.Description = @"Чтение флага отключения активности для андерайтеров из конфигурационного файла";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insuranceClassInitialization;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.ReadConfigBooleanVariable),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "variableName",
                        TypeName = typeof(string).AssemblyQualifiedName,
                        Expression = @"'ModuleConfiguration:KaskoLink2:DisableActivityUnderWriter'",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "ReadConfigBooleanVariable",
            });
        }

        private void InitializeCreateFakeInsuranceInspectionProcess(NestedProcessModel model)
        {
            model.Identifier = "CreateFakeInsuranceInspectionProcess";
            model.Name = "Заглушка для ПСО";
            model.Description = string.Empty;
            model.FlowProcessIdentifier = "CreateFakeInsuranceInspectionProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "DealEntityId",
                ExpressionType = typeof(int).AssemblyQualifiedName,
                InExpression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket == true) { deal = Basket.Deals[i].EntityId; } } deal",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit",
                NextStep = _preliminaryInsuranceInspectionProcess,
            });
        }

        private void InitializeChangeBasketStatusToPolicyLayout(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToPolicyLayout";
            model.Name = "D9. Смена статуса корзины и сделок";
            model.Description = @"D9. Смена статуса корзины и сделок";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _diKaskoPolicyLayoutProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'InWork'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = null,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _diKaskoPolicyLayoutProcess,
            });
        }

        private void InitializePrintDocumentsProcess(CustomProcessModel model)
        {
            model.Identifier = "PrintDocumentsProcess";
            model.Name = "C1. Печать (все Сделки Рутовой Корзины с признаком IsInBasket==true; “pdf”; WhatToUse = “All/Policy”)";
            model.Description = @"C1. Печать (все Сделки Рутовой Корзины с признаком IsInBasket==true; “pdf”; WhatToUse = “All/Policy”)";
            model.ImplementationTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivity).AssemblyQualifiedName;
            model.DataTypeName = typeof(iRIS.Printing.Code.Activities.PrintingActivityResult).AssemblyQualifiedName;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "WhatToUse",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'PrintStoresToUse.PrintingFormCode'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "PrintingFormCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.GetAfterPaymentPrintingFormCodes()",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "PrintingFormSource",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'PrintingFormSource.Db'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsPreview",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Expression = @"false",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "ProductWhatToUse",
                TypeName = typeof(Dictionary<string, string>).AssemblyQualifiedName,
                Expression = @"ExternalFunctionsInvoker.GetProductWhatToUseForOnlinePolicyIssue()",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsNeedReloadDeals",
                TypeName = typeof(bool?).AssemblyQualifiedName,
                Expression = @"false",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"ExternalFunctionsInvoker.GetDealsForPrinting(Basket)",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DocType",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'Pdf'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketEntityId",
                TypeName = typeof(int?).AssemblyQualifiedName,
                Expression = @"Basket.EntityId",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AdditionalData",
                TypeName = typeof(iRIS.Printing.Code.Dto.PrintingAdditionalData).AssemblyQualifiedName,
                Expression = @"DiKaskoExternalFunctionsInvoker.SetAdditionalDataForDateRepayment(Basket, DateRepaymentWithShift)",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.OutputArguments.Add(new CustomProcessOutputArgument
            {
                Name = "DocumentCollection",
                TypeName = typeof(List<iRIS.Printing.Code.Activities.DocumentInfo>).AssemblyQualifiedName,
            });
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _printDocumentsErrorMessage,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Succes",
                NextStep = _downloadDocumentsCustomProcess,
            });
        }

        private void InitializeRedirectToOnlinePaymentUrl(RedirectModel model)
        {
            model.Identifier = "RedirectToOnlinePaymentUrl";
            model.Name = "Перейти на ссылку для оплаты";
            model.Description = @"Перейти на ссылку для оплаты";
            model.Url = "DiKaskoGeneratePaymentLinkProcess.KaskoUrl";
            model.OpenInNewTab = false;
            model.NextStep = _redirectToOnlinePaymentDefault;
        }

        private void InitializeGetInspection(ProcedureModel model)
        {
            model.Identifier = "GetInspection";
            model.Name = "Получение сущности ПСО";
            model.Description = @"Получение сущности ПСО";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.InsuranceInspectionProcess.ActivityDataModels.InsuranceInspectionResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _insurancePostponedInspectionCreationProcess;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetPostponedInspectionForKaskoDeal),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Inspection",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Inspection).AssemblyQualifiedName,
                SourceName = "GetPostponedInspectionForKaskoDeal",
            });
        }

        private void InitializeSetSpecialNotes(ProcedureModel model)
        {
            model.Identifier = "SetSpecialNotes";
            model.Name = "Установка особых условий каско";
            model.Description = @"Установка особых условий каско";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _updateProlongationStatus;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetSpecialNotes),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deal",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                        Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal;",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeGeneratePolicyNumberShowMessageError(FormDataModel model)
        {
            model.Identifier = "GeneratePolicyNumberShowMessageError";
            model.Name = "Отображение ошибки генерации номера полиса";
            model.Description = string.Empty;
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Сервис временно недоступен, просим повторить оформление полиса позднее. Приносим извинения за доставленные неудобства.'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Info;
            model.Caption = "Сообщение";
            model.NextStep = _diKaskoPolicyLayoutProcess;
        }

        private void InitializeGeneratePolicyNumberByServiceProcess(CustomProcessModel model)
        {
            model.Identifier = "GeneratePolicyNumberByServiceProcess";
            model.Name = "Генерация номера полиса";
            model.Description = @"Генерация номера полиса";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.GeneratePolicyNumberByServiceProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "BasketNumber",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"Basket.Number",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Error",
                NextStep = _generatePolicyNumberShowMessageError,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Success",
                NextStep = _initializeInvoicesBeforeLink2Print,
            });
        }

        private void InitializeIsAllowedToSKipPublishForLink2(ConditionModel model)
        {
            model.Identifier = "IsAllowedToSKipPublishForLink2";
            model.Name = "Возможность пропуска";
            model.Description = string.Empty;
            model.Title = "Возможность пропуска";
            model.Default = null;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Нет",
                Expression = @"IsAllowedToSkipPublishAfterReadyForSign.Value == false",
                NextStep = _publishBasketBeforeGenerationMessageContentLinkToPayment,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"IsAllowedToSkipPublishAfterReadyForSign.Value == true",
                NextStep = _setCheckDirectProcessFlagFalse,
            });
        }

        private void InitializeExitMainProcess(ExitPointModel model)
        {
            model.Identifier = "ExitMainProcess";
            model.Name = "Процесс завершен";
            model.Description = @"Завершение основного процесса";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeGetSelectedOfferId(ProcedureModel model)
        {
            model.Identifier = "GetSelectedOfferId";
            model.Name = "Текущий Offer_Id";
            model.Description = @"Текущий Offer_Id";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.IntResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _createInspectionFileDescriptionModel;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetSelectedOfferId),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "deal",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Deal).AssemblyQualifiedName,
                        Expression = @"var deal = null; for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO') deal = Basket.Deals[i]; } deal;",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(int).AssemblyQualifiedName,
                SourceName = "GetSelectedOfferId",
            });
        }

        private void InitializeSetIntermediariesAndCostcenter(CustomProcessModel model)
        {
            model.Identifier = "SetIntermediariesAndCostcenter";
            model.Name = "A11. Заполнение Посредника и Канала продаж в сделках";
            model.Description = @"A11. Заполнение Посредника и Канала продаж в сделках";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.SetIntermediariesAndCostcenterV2).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _setOrResetInsuranceTypes;
            model.ExceptionNextStep = _setOrResetInsuranceTypes;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InputArgument_ProductsWithIntermediaries",
                TypeName = typeof(Dictionary<int, List<iRIS.InsuranceCore.Entities.Intermediary>>).AssemblyQualifiedName,
                Expression = @"FindIntermediariesAndCostcenter.ProductsWithIntermediaries",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "InputArgument_ProductsWithCostcenters",
                TypeName = typeof(Dictionary<int, iRIS.InsuranceCore.Entities.Costcenter>).AssemblyQualifiedName,
                Expression = @"FindIntermediariesAndCostcenter.ProductsWithCostcenters",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializePublishBasketAfterChangedStatusToReadyForSignForEKasko(VersionPublisherModel model)
        {
            model.Identifier = "PublishBasketAfterChangedStatusToReadyForSignForEKasko";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.CreateVersion;
            model.RelationType = RelationType.None;
            model.NextStep = _setCheckDirectProcessFlagTrue;
            model.ExceptionNextStep = null;
        }

        private void InitializeChangeBasketStatusToReadyForSignForEKasko(CustomProcessModel model)
        {
            model.Identifier = "ChangeBasketStatusToReadyForSignForEKasko";
            model.Name = "D9. Смена статуса корзины и сделок на 'Готово к оформлению' для еКаско";
            model.Description = @"D9. Смена статуса корзины и сделок на 'Готово к оформлению' для еКаско";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.ChangeBasketStatusProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = null;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "TargetStatus",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"'ReadyForSign'",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "DealStatusConditionCode",
                TypeName = typeof(string).AssemblyQualifiedName,
                Expression = @"''",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Deals",
                TypeName = typeof(List<iRIS.InsuranceCore.Entities.Deal>).AssemblyQualifiedName,
                Expression = @"var deals = []; for(var i=0;i<Basket.Deals.Count;i++) { if(Basket.Deals[i].IsInBasket == true && (Basket.Deals[i].IsExternal==null || Basket.Deals[i].IsExternal==false) && !(Basket.Deals[i].Product.ProductDictCode === 'EOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) deals.push(Basket.Deals[i]) } deals;",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionNotPossible",
                NextStep = _isAllowedToSkipAfterReadyForSign_,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "TransitionPossible",
                NextStep = _isAllowedToSkipAfterReadyForSign_,
            });
        }

        private void InitializeDiKaskoSegmentationPostProcessError(ExitPointModel model)
        {
            model.Identifier = "DiKaskoSegmentationPostProcessError";
            model.Name = "Ошибка";
            model.Description = @"Ошибка";
            model.ReturnParameters = new List<ParameterModel>();
        }
    }
}
как в unity мне зациклить анимацию что бы она повторялась безконечно?