When triggering a module at page or level 0, each page is processed as a single individual task sent from the Captiva Server, so typically one page cannot access properties such as TemplateCode from another page that has either already processed thru the module, processing in another module, or pending to be sent for processing to this same module. For example what if page 1 was processing in Identification, and page 50 was still processing in Classification. then with some Identification task script, you try set the template code on page 50 to same code as page 1, may or may not work depending on what is occurring at the moment with page 50 such as Classification trying to set template code too.
With that being said, I was able to get this to work using fairly simple CFD value assignments and using StepCustomValue property however Classification and Identification are triggered at batch level and the NeedswClassificationEdit is used as the decision rule, very similar to the OOTB AdvamceMultiDocCapture process. I also arbitrarily set first page in batch to template code “A”, for simplicity sake because you could have the pages that was identified anywhere in the batch. see below.
These 3 values are set after ImageProcessor, but could be set after Classification or Identification step.
Hope this helps.