Development guidelines for RunBase framework

Following rules are dedicated for implementing handlers using the RunBase-framework.

Parameters

  • The parameter must be accompanied by a parm-method.

  • The parameter must be accompanied by a displayed field.

    Example:

    ItemId itemId;
    DialogField dialogItemId;
    
  • All parameters should be displayed on the dialog form thus this will allow for users to see all inputs for processing batch task.

    Example (incorrect as none of parameters are displayed):

  • The parameter should be extended from any primitive type, except container.
    Using of containers as the parameters is prohibited to use.
    Use RecordReference_RU table to have filter query with specific records, after extending it with needed Country Region Codes.

  • Parameters validation (using validate() method) must be also executed in run() method.

    Example:

    public void run()
    {
        #OCCRetryCount
    
        setPrefix(TutorialRunBase_PRJ::description());
    
        if (! this.validate())
        {
            throw error("@SYS18447");
        }
    
        try
        {
            ttsbegin;
    
            ...
      
            ttscommit;
        }
        catch (Exception::Deadlock)
        {
            queryRun.reset();
            retry;
        }
        catch (Exception::UpdateConflict)  
        {
            if (appl.ttsLevel() == 0)
            {
                if (xSession::currentRetryCount() >= #RetryNum)
                {
                    throw Exception::UpdateConflictNotRecovered;
                }
                else
                {
                    itemQueryRun.reset();
                    retry;
                }
            }
            else
            {
                throw Exception::UpdateConflict;
            }
        }
    }
    
    

Naming conventions

See Naming conventions for Variables for RunBase extensions.

See Naming conventions for Methods for RunBase extensions.