KeepAlive: maintain dialog windows open

Tag attribute: KeepAlive

The KeepAlive attribute controls dialog window behavior.

By default, all dialog windows close automatically during an automation process, without human intervention.

Use KeepAlive to choose whether a dialog or module window closes by itself when the automation process is done with it, or stays open so someone can review it or keep working in it.


Detailed Description

There are 3 cases: dialogs, main modules, and sub-modules that open in the same window. The two module cases apply to sapio365 only.

Dialogs

  • False (default): The automation process fills in the dialog, confirms it and moves on to the next step. Nobody needs to do anything.

  • True: The automation process fills in the dialog but leaves it open. Any dialog opened from it also stays open. The automation process continues once you close the dialog.

  • This: Only this dialog stays open. Any dialog opened from it is still filled in and closed by the automation process. The automation process continues once you you close the dialog.

  • ThisAndSuspend: This dialog stays open and the automation process pauses. You can use this dialog, and any dialog opened from it, as you would normally. When you you close the dialog, the automation process picks up again at the next step.

  • ThisAndStop: Works like ThisAndSuspend, except that closing the dialog ends the automation process. The remaining steps do not run.

False does not cancel a True set on a dialog that is already open. A dialog opened from a dialog that uses True stays open either way.

Message boxes only understand True and False. They treat This, ThisAndSuspend and ThisAndStop as False.

Main modules (sapio365 only)

These rules also apply to a sub-module that opens in its own window. A sub-module opens in its own window when NewFrame is set to True, or when it is given a list of IDs.

  • No KeepAlive (default): The window stays open after the module's steps are done, and the automation process continues.

  • True: The window stays open. Dialogs opened by the module's steps also stay open and wait for you to click OK.

  • This: The window stays open. Dialogs opened by the module's steps close by themselves as usual.

  • False: The window closes once the module's steps are done.

  • ThisAndSuspend and ThisAndStop: Work like False. The window closes.

Sub-modules in the same window (sapio365 only)

By default, a sub-module opens in the same window as the module it came from.

  • No KeepAlive (default): Once the sub-module's steps are done, the window goes back to the previous module and the automation process continues. If True is set higher up (for the whole automation process, or on the module that opened this sub-module), this sub-module follows the True rule below.

  • False, ThisAndSuspend and ThisAndStop: The window goes back to the previous module and the automation process continues.

  • True and This: The sub-module stays on screen and the automation process stops. The remaining steps do not run, and a warning is written to the log:
    "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."
    To keep a sub-module open and let the automation process carry on, set NewFrame to True so that it opens in its own window.


automation-logic-setScriptToRequireUserInput-1.gif

In the script above, the KeepAlive attribute is used on the Values action. But because it affects the next dialog encountered in the script, it will affect the Export action dialog—this dialog will stay open, awaiting user input.
KeepAlive="This" will trigger only the dialog corresponding to the action in which KeepAlive is used to stay open.

automation-logic-setScriptToRequireUserInput-2.gif

In the script above, because of KeepAlive="This", only the Values dialog stays open.


You can set KeepAlive as an action parameter.

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


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

In some odd situations, you may need to set it using a SetParam action.

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


Special Attribute Value: {{SKIP}}

The attribute value {{SKIP}} can be used in place of a SetParam option value, using the default setting.

For example, the following two script blocks are equivalent:

<Export keepAlive="this">
    <SetParam field="FilePath" value="D:\temp-exports\acl-ExportMainGrid-TextSelectedRows.xlsx"/>
    <SetParam field="OpenFileOnceGenerated" value="{{SKIP}}"/>
</Export>

and

XML
<Export keepAlive="this">
    <SetParam field="FilePath" value="D:\temp-exports\acl-ExportMainGrid-TextSelectedRows.xlsx"/>
</Export>

As shown above, omitting a SetParam option line for a dialog action causes its option setting to be ignored. But the{{SKIP}}attribute can be useful when setting IF conditions.

Example Scripts

XML
<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
<ytriaAutomation>
	<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
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ytriaAutomation Console="False">
    <Load Server="ACME01/ACME">
        <Load Database="dbtestrepl\Helptest.nsf" Select="True"/>
    </Load>
    <ReplicationAudit keepalive="ThisAndStop">
        <Setparam Field="SelectRepServer" Value="ACME02/ACME"/>
        <SetParam Field="ModifiedAfter" Value="2015-07-25T10:00:00"/>
        <RunAudit Select="All"/>
        <Select Lines="All"/>
            <Export>
                <SetParam field="FilePath" value="D:\scanEZ-ReplicaAudit.html"/>
                <SetParam field="ExportType" value="HTML"/>
                <SetParam field="SelectedRowsOnly" value="True"/>
            </Export>
    </ReplicationAudit>
</ytriaAutomation>

In the script above, keepalive="ThisAndStop" prevents the replication auditor window from being closed and stops the automation process so that user interaction is enabled.