Skip to main content
Kofax

The runmodel setting("session") function returns an empty string

3029866

Symptom

A document template is composed that uses the function runmodel_setting("session"). This function returns an empty string instead of the path to the session folder.

Cause

The function runmodel_setting("session") only returns the path to the session folder, when the document is composed in the context of a ComposerUI session.

Resolution

As an alternative it is possible to pass the session folder via a session variable. In the used Core script first create a session and then assign the path to the session folder to a session variable.

#Core script example
...
CreateSession;
Var Boolean Dummy = set_sessionparameter ( "sessionfolder", _sessiondir);
...
ITPRun
  Model(xxx)
...

In the master template the session variable can be retrieved using session_parameter

#BEGIN
TEXT session_folder := session_parameter ( "sessionfolder" )
(* as an example write the Data Backbone XML to the session folder *)
IF session_folder <> "" THEN
    WRITE _data TO session_folder + "\data_backbone.xml"
FI
END#

 

Applies to:  

Product Version
KCCM 4.4 and later
KCM 5.3 and later