QuestionnaireBatchJob
Process each QAS with some custom logic in a optimal way.
Parent class
Inherits from object
Constructors
- (int questionnaireId "Id of the base questionnaire") - Process each QAS with some custom logic in a optimal way.
Methods
- Empty AttachQuestionnaire(int questionnaireId "Id of the questionnaire", bool latestOnly "If user has multiple qas, only include last created or error", bool completedOnly "Limit by qas that is completed", string questionLabel "Label of the question to load") - Load readonly question from another questionnaire based on UserId
- Empty AttachQuestionnaire(int questionnaireId "Id of the questionnaire", bool latestOnly "If user has multiple qas, only include last created or error", bool completedOnly "Limit by qas that is completed", string questionLabel "Label of the question to load", string alias "Alias to use in execute parameter naming") - Load readonly question from another questionnaire based on UserId with an alias
- Empty Execute(Function runner "The function called for each QAS - parameter names infers which questions to load") - Run the batch job - implicitly saves all modified question data
- (From object) string ToString() - The string representation of the object.
Properties
- bool CompletedOnly { get; set; } - Get/Set Limit by qas that is completed. Default true
- bool CurrentCompleted { get; set; } - Get/Set current qas to completed or not
- int CurrentId { get; } - Get current qas id
- bool CurrentIsTest { get; } - Get current qas is test qas
- bool IncludeTest { get; set; } - Get/Set if include test qas. Default false
- bool LatestOnly { get; set; } - Get/Set If user has multiple qas, only include last created or all. Default false
- string ObjectTypeName { get; } - The name of the type of object.
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
Examples
old way
if(getRPQCompleted() && !getRPQTest() && D_Copied!=1 && D_Week == [202401] && Region==[1-5] && getRPQStatus() == 5)
print(getRPQId() + ",");
new way
QuestionnaireBatchJob batch = new QuestionnaireBatchJob(0);
//batch.LatestOnly = false;
//batch.CompletedOnly = true;
//batch.IncludeTest = false;
batch.Execute(function(Question D_Copied, Question D_Week, Question Region){
QAS qas = new QAS(batch.CurrentId);
if(D_Copied!=1 && D_Week == [202401] && Region==[1-5] && qas.Status == 5)
print(batch.CurrentId + ",");
});