Step 4 - Custom
This page provides details about writing your custom behaviors for articles and actions of your VR product.
This step allows you to write your customer behavior outcomes for articles and their action-responses. The articles and their respective action-responses are made available to design your Virtual Reality Scene behaviors. Following are the allowed code-constraints to write your behaviors (customized business rules).
Behaviors can be written using conditional statements. We have created customized conditional constructs which are easy for non-coding practitioners like Requirement Analysts to author behaviors at their convenience.
Following are the allowed Syntax conditional constructs
If
This is used as if type behavior conditional expression. Following is the conditional construct. The text in italics is for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: If#< behavior condition >#:< behavior outcome here >!
Elf
This is used as Else-if type behavior conditional expression. Following is the conditional construct. The text in italics is for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: EIf#< behavior condition >#:
< behavior outcome here >
<behavior outcome here >!
Switch
This is a typical Switch case type behavior conditional expression. Following is the conditional construct. The text in italics is for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: Switch#< behavior condition >#:
case#< behavior outcome here >#:<behavior outcome here >
case#< behavior outcome here >#:<behavior outcome here >
case#< behavior outcome here >#:<behavior outcome here >
default:<behavior outcome here >!
For
This is a typical for loop type behavior conditional expression. Following is the conditional construct. The text in italics is for for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: For#< behavior initialization>/< behavior range>/< behavior iteration>#:
<behavior outcome here >!
While
This is a typical while loop type behavior conditional expression. Following is the conditional construct. The text in italics is for for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: While#< behavior initialization>#:
<behavior outcome here >!
Do-While
This is a typical Do-While loop type behavior conditional expression. Following is the conditional construct. The text in italics is for for expression behavior condition and behavior outcome if the condition succeeds.
Syntax: Do#< behavior outcome>#:
While<behavior condition >!
Here is the backend template of custom.json file
Here is the finalized template of custom.json before getting published into the database
If we observe the behavior rules are converted into BASE-64 encoding as we cannot save a code-snippet inside a JSON file. We provide a provision to decode the BASE-64 behavior rule for pracitioners to review the behavior logic.
Managing State
Last updated