Data Types
Here is the code used in this lesson
//DATA TYPES
//1) BASIC:
RuleContext Basic {
Rule rule {
String varStr = "string"
Integer varInt = 5
Double varDou = 5.5
Bool varBol = true
}
}
//2) SPECIAL:
RuleContext Special {
Rule rule {
Filter filter = Filter(modelName: "Location")
PageFetcher pageFetcher = PageFetcher(pageSize: 20, filter: filter)
DateFormatter dateFormatter = DateFormatter(format: "DD/MM/YYYY")
MediaFile mediaFile = broker.media.open()
MediaCameraConfigure mediaCameraConfigure = MediaCameraConfigure()
MediaGalleryConfigure mediaGalleryConfigure = MediaGalleryConfigure()
Timer timer = Timer(delay: true)
}
}
//3) MODELS/EXPERIENCES:
RuleContext Models {
Rule rule {
//BUILD-IN MODELS
Location location = Location()
Marker marker = Marker()
OAuth oauth = OAuth()
Date date = Date()
}
}
//4) VARIABLE DECLARATIONS:
RuleContext Vars {
Rule rule {
String strVar // correct
//String Integer // incorrect
Integer strVar // incorrect
}
}