Difference between revisions of "SampleRule class"
Line 28: | Line 28: | ||
{{CGscriptMethods_Template|ReturnType=Array of SampleRule|Name=<nowiki>SampleRule_getByGroupResourceId</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Array of SampleRule|Name=<nowiki>SampleRule_getByGroupResourceId</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Resource id of the group to get samples from</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Resource id of the group to get samples from</nowiki>}} | ||
− | |Description=<nowiki>Get all sample rules | + | |Description=<nowiki>Get all sample rules associated with a group</nowiki>}} |
− | {{CGscriptMethods_Template|ReturnType=Array of SampleRule|Name=<nowiki> | + | {{CGscriptMethods_Template|ReturnType=Array of SampleRule|Name=<nowiki>SampleRule_getByQuestionnaireResourceId</nowiki>|Parameters= |
{{CGscriptParameters_Template|Type=int|Name=<nowiki>questionnaireResourceId</nowiki>|Description=<nowiki>Resource id of the questionnaire to get samples from</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>questionnaireResourceId</nowiki>|Description=<nowiki>Resource id of the questionnaire to get samples from</nowiki>}} | ||
− | |Description=<nowiki>Get all sample rules | + | |Description=<nowiki>Get all sample rules associated with a group</nowiki>}} |
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SampleRule_rebuild</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SampleRule_rebuild</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=Array of SampleRule|Name=<nowiki>samplesRules</nowiki>|Description=<nowiki>Sample rules to rebuild samples for</nowiki>}} | {{CGscriptParameters_Template|Type=Array of SampleRule|Name=<nowiki>samplesRules</nowiki>|Description=<nowiki>Sample rules to rebuild samples for</nowiki>}} | ||
|Description=<nowiki>Rebuild the samples in the given sample rules</nowiki>}} | |Description=<nowiki>Rebuild the samples in the given sample rules</nowiki>}} | ||
}} | }} | ||
+ | |||
=== <span style="color:#DF8621">'''Examples'''</span> === | === <span style="color:#DF8621">'''Examples'''</span> === |
Revision as of 03:39, 30 January 2019
SampleRule
Represents a SampleRule.
Constructors
- (string name "Name of rule", int questionnaireResourceId "Resource id of questionnaire to sample to", int groupResourceId "Resource id of group to sample") - Create new group samplerule
Methods
Properties
- bool Active { get; set; } - Get/Set if the SampleRule is active or not
- int ActualSize { get; } - Get how many qas is currently sampled for this rule.
- DateTime DeletedDate { get; } - Get/Set the DeletedDate of Samplerule
- string Description { get; set; } - Get/Set the Description of Samplerule
- int GroupId { get; } - Get id of group associated with this samplerule
- int GroupResourceId { get; } - Get resourceId of group associated with this samplerule
- string Name { get; set; } - Get/Set the Name of Samplerule.
- string ObjectTypeName { get; } - The name of the type of object.
- int QuestionnaireId { get; } - Get id of questionnaire associated with this samplerule
- int QuestionnaireResourceId { get; } - Get resourceId of questionnaire associated with this samplerule
- int RequestedSize { get; set; } - Get how many qas is requested to sample for this rule.
- int SampleRuleType { get; } - Get the Type of Samplerule.
- int SizeWithData { get; } - Get how many qas for this rule have data
- int SizeWithoutData { get; } - Get how many qas for this rule does not have data
- TypeInformation TypeInformation { get; } - Get information about this class.
Static Methods
- Array of SampleRule SampleRule_getByGroupResourceId(int groupResourceId "Resource id of the group to get samples from") - Get all sample rules associated with a group
- Array of SampleRule SampleRule_getByQuestionnaireResourceId(int questionnaireResourceId "Resource id of the questionnaire to get samples from") - Get all sample rules associated with a group
- Empty SampleRule_rebuild(Array of SampleRule samplesRules "Sample rules to rebuild samples for") - Rebuild the samples in the given sample rules
Examples
number groupRId = 15644390;
array sampleRule = SampleRule_getByGroupResourceId(groupRId);
for(number i = 0; i<sampleRule.Count; i++)
{
print(sampleRule[i].Active);
print(sampleRule[i].ActualSize);
print(sampleRule[i].DeletedDate);
print(sampleRule[i].Description);
print(sampleRule[i].SampleRuleType );
print(sampleRule[i].SizeWithData );
print(sampleRule[i].SizeWithoutData );
}