Thursday, March 24, 2022

Sample Dialog Syntax - 1

 class AffiliationAutoAssignment extends RunBaseBatch

{    

// 1. Class Declaration and Pack variables

    #define.CurrentVersion(1)

    #define.Version1(1)

 

// 2. Dialog Method

/// <summary>

    /// Generate default dialog

    /// </summary>

    /// <returns>default framework dialog validation</returns>

    public Object dialog()

    {

        return super();

    }

// 2. getFromDialog Method

/// <summary>

    /// Get from dialog

    /// </summary>

    /// <returns>boolean</returns>

    public boolean getFromDialog()

    {

        return super();

    }

// 3. Construct Method

/// <summary>

    /// Class Construct method

    /// </summary>

    /// <returns>class AffiliationAutoAssignment </returns>

    public static AffiliationAutoAssignment construct()

    {

        return new AffiliationAutoAssignment();

    }

// 4 Pack method

/// <summary>

    /// Maintains state/version

    /// </summary>

    /// <returns>version and current list</returns>

    public container pack()

    {

        return [#CurrentVersion];

    }

// 5. UnPack method

 /// <summary>

    /// Gets the state/version

    /// </summary>

    /// <param name = "packedClass">container</param>

    /// <returns>true, if it gets previous version</returns>

    public boolean unpack(container packedClass)

    {

        Version version = runbase::getVersion(packedClass);

        ;

        switch (version)

        {

            case #CurrentVersion:

                [version] = packedClass;

                break;

            default:

                return false;

        }

        return true;

    }

// 7. CanRunInNewSession method

/// <summary>

    /// Describes whether the class is designed for execution in a new session.

    /// </summary>

    /// <returns>

    /// true if the class is designed for execution the operation in a new session; otherwise, false.

    /// </returns>

    protected boolean canRunInNewSession()

    {

        return false;

    }

// 8. Run method
/// <summary>
    /// Execute logic to update auto assignment for affiliations based on date range 
    /// </summary>
    public void run()
    {
        System.Exception ex;
        #OCCRetryCount

        try
        {
            this.processData();

            Info("@OperationCompleted");
        }
        catch (Exception::CLRError)
        {
            ex = CLRInterop::getLastException();
            error(ex.ToString());
        }
        catch (Exception::Deadlock)
        {
            retry;
        }
        catch (Exception::UpdateConflict)
        {
            if (appl.ttsLevel() == 0)
            {
                if (xSession::currentRetryCount() >= #RetryNum)
                {
                    throw Exception::UpdateConflictNotRecovered;
                }
                else
                {
                    retry;
                }
            }
            else
            {
                throw Exception::UpdateConflict;
            }
        }
    }

/// <summary>
    /// Entry point to process.
    /// </summary>
    /// <param name = "_args">Args</param>
    public static void main(Args _args)
    {
        AffiliationAutoAssignment affiliationAutoAssignment = new AffiliationAutoAssignment();
        
        if (affiliationAutoAssignment.prompt())
        {
            affiliationAutoAssignment.runOperation();
        }
    }


/// <summary>
    /// set description for batch run
    /// </summary>
    /// <returns>return class description string</returns>
    static ClassDescription description()
    {
        return "UpdateAffiliationAssignments";
    }

No comments:

Post a Comment

Sample Dialog Syntax - 1

 class AffiliationAutoAssignment extends RunBaseBatch {     // 1. Class Declaration and Pack variables     #define.CurrentVersion(1)     #de...