Tag: KeepAlive

The KeepAlive function closes each window so that the script is executed without human intervention.

<Values KeepAlive="True">
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="Subject"/>
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="$Fonts"/>
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="Status"/>
</Values>
XML

Detailed Description

KeepAlive can be set to:
- "False" : default value (see exception below). Window will automatically be closed. Applies to the current action and all its children until its overridden.
- "True" : Window will stay opened until the user closes it. Applies to the current action and all its children until its overridden.
- "This": Window will stay opened until the user closes it. Only applies to the current action, not to its children.


KeepAlive is to be set as a param of the concerned action.

<Export KeepAlive="true">
	<SetParam field="ExportType" value="text"/>
	<SetParam field="FilePath" value="C:\test.csv"/>
</Export>
XML


You can also set KeepAlive (True or False only) in the main <ytriaAutomation> action so that it applies to the whole script (until overridden). 

It may happen, it some odd situation, that you need to set it using a SetParam action.

<Export>
	<SetParam field="ExportType" value="text"/>
	<SetParam field="FilePath" value="C:\test.csv"/>
	<SetParam KeepAlive="true"/>
</Export>
XML

Exception:

Sapio365
- When opening a module in a "new frame" (i.e. either a main-module or a sub-module with attribute newFrame="true"), KeepAlive is considered as true by default.
- For sub-modules with "newFrame" not set to "true":
- "Go Back" is called instead of closing the whole module.with no KeepAlive set to True Or This
- Otherwise the frame stays up and the automation stops with a console message: "Automation has stopped: the frame is instructed to stay open (action \"%s\": \"%s\" parameter is not set to \"%s\"), therefore no further action can be processed."

Example Script

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ytriaAutomation Application="ScanEZ ApplicationVersion="16.0.5" Version="1.0">
	<Load Server="Acme01/ACME" database="Mailtest.nsf"/>
	<Focus Target="Tree" Category="Documents" Type="Document"/>
	<Values KeepAlive="True">
		<SetParam Field="AddItem" value="readers"/>
		<SetParam Field="AddItem" value="From"/>
		<ShowTypeColumns value="false"/>
			<Export>
				<SetParam Field="FilePath" value="D:MailTestAudit.html"/>
				<SetParam Field="ExportType" value="HTML"/>
				<SetParam Field="SelectedRowsOnly" value="false"/>
			</Export>
	</Values>
	<Overwrite value="false"/>
</ytriaAutomation>

In the script above, the KeepAlive attribute is used on the Values action. But because it will affect the next dialog encountered in the script, it will affect the Export action dialog—this dialog will be kept open awaiting user input.

KeepAlive="This" will trigger only the dialog corresponding to the action in which the KeepAlive is used to stay open.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ytriaAutomation Application="ScanEZ ApplicationVersion="16.0.5" Version="1.0">
	<Load Server="Acme01/ACME" database="Mailtest.nsf"/>
	<Focus Target="Tree" Category="Documents" Type="Document"/>
	<Values KeepAlive="This">
		<SetParam Field="AddItem" value="readers"/>
		<SetParam Field="AddItem" value="From"/>
		<ShowTypeColumns value="false"/>
			<Export>
				<SetParam Field="FilePath" value="D:MailTestAudit.html"/>
				<SetParam Field="ExportType" value="HTML"/>
				<SetParam Field="SelectedRowsOnly" value="false"/>
			</Export>
	</Values>
	<Overwrite value="false"/>
</ytriaAutomation>
XML