IUiLicenseManager.CheckinCommuterLicense

Fore Syntax

CheckinCommuterLicense(FeatureName: String): UiLicenseStatusCode;

Fore.NET Syntax

CheckinCommuterLicense(FeatureName: String): Prognoz.Platform.Interop.ForeSystem.UiLicenseStatusCode;

Parameters

FeatureName. Feature name.

Description

The CheckinCommuterLicense method checks in a local license, enabling the temporary use of application out of network environment, to license server.

Comments

The method is relevant to use if a temporary license was previously checked out from the license server using the CheckoutCommuterLicense method.

To successfully check in the license to server, license search settings and settings determined at the moment when the temporary license was checked out from license server must match.

Fore Example

To execute the example, place the Button and Editbox components with the Button1 and Editbox1 identifiers on the form and add a link to the the Ui system assembly. The example is a handler of the OnClick event for the Button1 component. A network license must be used.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var 
    LicManager: IUiLicenseManager;
    Feature: String;
    FeatureInfo: IUiLicenseFeatureInfo;
    StatusCode: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    FeatureInfo:= LicManager.GetFeatureInfo(Feature);
    If LicManager.IsCheckedOut(Feature) Then
        StatusCode := LicManager.CheckinCommuterLicense(Feature);
        If StatusCode = UiLicenseStatusCode.Success Then
            WinApplication.InformationBox("License is successfully checked in");
        Else
            WinApplication.InformationBox("Error: " + StatusCode.ToString);
        End If;
    Else 
        WinApplication.InformationBox("License was not checked out from server");
    End If;
End Sub Button1OnClick;

Enter to Editbox name of pre-installed feature, for example, PP_OLAP, and click the button. If the specified feature was previously checked out from license server, it is checked in. If any errors are returned, the message with a code of occurred error is displayed.

Fore.NET Example

To execute the example, add links to the Ui, Fore, ForeSystem system assemblies. Place the Button and TextBox components with the Button1 and TextBox1 identifiers on the form. The example is a handler of the OnClick event for the Button1 component. The example of the Fore.NET example execution matches with that in the Fore example.

Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.Fore;  
Imports Prognoz.Platform.Interop.ForeSystem;

...

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var 
    WinApp: WinApplicationClassClass = New WinApplicationClassClass();
    Svc: IForeServices;
    RunContext: ForeRuntimeContext;
    LicManager: IUiLicenseManager;
    Feature: String;
    FeatureInfo: IUiLicenseFeatureInfo;
    StatusCode: UiLicenseStatusCode;
Begin
    Svc := Self.Metabase As IForeServices;
    RunContext := Svc.GetRuntime().Context;
    LicManager := WinApp.Instance[RunContext].LicenseManager;
    Feature := textBox1.Text;
    FeatureInfo:= LicManager.GetFeatureInfo(Feature);
    If LicManager.IsCheckedOut(Feature) Then
        StatusCode := LicManager.CheckinCommuterLicense(Feature);
        If StatusCode = UiLicenseStatusCode.lscSuccess Then
            WinApp.InformationBox("License is successfully checked in"New IWin32WindowForeAdapter(Self));
        Else
            WinApp.InformationBox("Error: " + StatusCode.ToString(), New IWin32WindowForeAdapter(Self));
        End If;
    Else 
        WinApp.InformationBox("License was not checked out from server"New IWin32WindowForeAdapter(Self));
    End If;
End Sub;

See also:

IUiLicenseManager | Licensing Options