TmNamespace TmContent Macro
<Macro name="RetryQuery">
<Argument>
<MaxRetries>10</MaxRetries>
<StatusFrom>Save,Update</StatusFrom>
</Argument>
<Result>
<NewLocalData>
<MaxRetries>[:$Macro.Argument.MaxRetries:]</MaxRetries>
<StatusFrom>[:$Macro.Argument.StatusFrom:]</StatusFrom>
<RetryScript>
<JavaScript>
<Response>
<Include>$Response.Message.Value</Include>
</Response>
<Retry>
<Include>$Macro.Argument</Include>
<Include>$LocalData.RetryScript</Include>
</Retry>
var result = null;
var max_retries = [:$LocalData.MaxRetries:];
if(--max_retries [:ge:] 0)
{
sffContext.setLocalData("MaxRetries", max_retries);
var check = Str.static.listSplitChar("[:$LocalData.StatusFrom:]", ", ", Str.static.SPL_TRIM);
for each (var path in check)
{
var key = Str.static.listSplitChar(path, ".", Str.static.SPL_TRIM);
key.add("Status");
for each (var status in Response.iterValues(key))
{
sffLog.info("RetryQuery(%s): Checking %s=%s", [~~max_retries, key, status]);
if(typeof status == "string" [:and:] status.startsWith("Failure"))
{
result = Retry;
break;
}
}
}
}
result;
</JavaScript>
</RetryScript>
</NewLocalData>
<Include>$Macro.Argument</Include>
<Include>NewLocalData.RetryScript</Include>
</Result>
</Macro>
Referenced by:
Namespace, TQL model content, Macro
TmContent.TmNamespace: nested namespace
TmDataContent (Data)
Example
Referenced by:
TmDataContent
Inherits: Inheritance descriptor.
Combine:
TmDataAttribute: TQL data model attribute definition.
StandAloneConstraint: Stand-alone constraint definition.
TmUnique: Unique constraint definition.
TmThingContent (Thing)
Example
Referenced by:
TmThingContent
Inherits: Inheritance descriptor.
Combine:
TmThingAttribute: TQL thing model attribute definition.
StandAloneConstraint: Stand-alone constraint definition.
TmUnique: Unique constraint definition.
TmAction: Thing action definition
TmAppContent (App)
Example
Referenced by:
TmAppContent
Inherits: Inheritance descriptor.
Combine:
TmThingAttribute: TQL thing model attribute definition.
StandAloneConstraint: Stand-alone constraint definition.
TmUnique: Unique constraint definition.
TmAction: Thing action definition.
TmUnique
Example
Referenced by:
Unique constraint definition
Name: Name is optional.
Value: List of attribute names.
TmDataAttribute
TmDataAtom
TmDataComposite
TmDataAdHocComposite
TmAttributeBase
Example
Referenced by:
TmAttributeBase
Name: Model attribute name.
Cardinality: Nested cardinalities are not yet supported.
Format: Attribute value format specifier.
Codec: Attribute value coder/decoder specifier.
InlineConstraint: Inline constraint.
TmThingAttribute
Example
Referenced by:
TmThingAttribute
Attribute: Cherry-picked attribute definition.
TmThingAtom
Example
Referenced by:
TmThingAtom
Update: Currently only 'auto' value is supported.
KnownBy: Associated action[s] name[s], comma-separated list.
TmThingComposite
Example
Referenced by:
TmThingComposite
Update: Currently only 'auto' value is supported.
KnownBy: Associated action[s] name[s], comma-separated list.
TmThingAdHocComposite
TmAction
Condition
ConditionExpression
ConstraintContent
StandAloneConstraint
NestedConstraint
InlineConstraint