DSL-Rule Timer issue in UI-Rule

I recently try to migrate OH from 2.5 to 4.3, and when I try to migrate the rule from file to UI-rule, I found issue with timer, after dig around I found privateCache, I’ll share here for anyone might interest.

Code in file

var Timer AlarmTempOffTimer = null
rule "Front Door Open closed"
when
	Channel 'mqtt:topic:OpenHabSer:MiRemoteCube:Action' triggered
then
	if(AlarmTempOffTimer === null) {
		logInfo("Test", "Test about to start")
		AlarmTempOffTimer =createTimer(now.plusSeconds(5), [|
			logInfo("Test", "Timer Test for 5 Sec")])
	} 
	else {
		logInfo("Test", "Timer already set")
	}
end

Code in UI-Rule

configuration: {}
triggers:
  - id: "2"
    configuration:
      channelUID: mqtt:topic:OpenHabSer:MiRemoteCube:Action
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: >-
        if(privateCache.get("AlarmTempOffTimer") === null) {
          logInfo("Test", "Test about to start")
          privateCache.put("AlarmTempOffTimer", createTimer(now.plusSeconds(5), [|
            logInfo("Test", "Timer Test for 5 Sec")
            privateCache.put("AlarmTempOffTimer", null) // Reset the timer
          ]))
        } else {
          logInfo("Test", "Timer already set")
        }
    type: script.ScriptAction

as you can see from the example,
privateCache.put(“AlarmTempOffTimer”, createTimer(…)) stores the timer in the cache.
privateCache.get(“AlarmTempOffTimer”) retrieves the timer from the cache.
hope can help anyone might get stuck with DSL