<?xml version="1.0" encoding="utf-8"?>
<Session ID="/baanerp/da/trg/datrg1100m000" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Triggers (datrg1100m000)</Title>
	</Header>
	<HelpTopic xml:lang="en"><AimSection><Paragraph class="Default">
                                 Use this session to add, update or delete triggers.</Paragraph>
		</AimSection>
		<GeneralSection><ProcedureList><ListIntro>To define a trigger, take the following steps:</ListIntro>
				<ListItem>Specify the trigger properties, such as the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.path" role="manual">Path for Program</GUIRef>, <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.cont" role="manual">Condition Template</GUIRef> and <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.actt" role="manual">Action Template</GUIRef>. Refer to the field help for detailed information on these properties.</ListItem>
				<ListItem>If any condition must be used, run the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.1" role="command">Configure Conditions...</GUIRef> command to define the trigger condition. Depending on the selected <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.cont" role="manual">Condition Template</GUIRef>, you must enter a condition script (in Baan C code) through a text editor, or enter the condition in a session. For details, refer to the field help of the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.cont" role="manual">Condition Template</GUIRef> field.</ListItem>
				<ListItem>Run the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.2" role="command">Configure Actions...</GUIRef> command to define the action that the trigger must take. Depending on the selected <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.actt" role="manual">Action Template</GUIRef>, you must enter a script (in Baan C code) through a text editor, or configure the action through a session. For details, refer to the field help of the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.actt" role="manual">Action Template</GUIRef> field.</ListItem>
			</ProcedureList>
			<Note><SectionTitle>
                                    Note
                                 </SectionTitle>
			</Note>
			<Paragraph class="Default">The trigger program (library object) is generated automatically. Refer to <Link href="#runtime_components" role="internal">RUNTIME COMPONENTS</Link> for details.</Paragraph>
			<Paragraph class="Default">When you delete a trigger, the trigger's runtime files are also deleted.</Paragraph>
			<Paragraph class="Default">When you add or update a trigger, you must specify the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.path" role="manual">Path for Program</GUIRef>. When you set or change the path, you are asked whether the system must create it, if it does not yet exist. When you change the path, the trigger's runtime files are moved to the new directory.</Paragraph>
			<Paragraph class="Default">When you copy a trigger, the configuration settings are also duplicated.</Paragraph>
		</GeneralSection>
		<GeneralSection ID="runtime_components"><SectionTitle>RUNTIME COMPONENTS</SectionTitle>
			<Paragraph class="Default">At runtime, the trigger logic is stored in a library object in the file system. This object is generated from the trigger configuration and is stored in the directory that is specified in the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.path" role="manual">Path for Program</GUIRef> field.</Paragraph>
			<List><ListIntro>The following files can be generated in that directory:</ListIntro>
				<ListItem>&lt;trigger&gt;.src (containing the generated source)</ListItem>
				<ListItem>&lt;trigger&gt;.bak (containing the previously generated source if an existing source is regenerated)</ListItem>
				<ListItem>&lt;trigger&gt;.dll (containing the compiled object)</ListItem>
				<ListItem>&lt;trigger&gt;.err (containing compilation errors if any)</ListItem>
			</List>
			<Paragraph class="Default">When you add a new trigger, empty runtime files are generated immediately. When you change the action or conditions, the library source and object are (re)generated automatically.</Paragraph>
			<List><ListIntro>During (re)generation, the following happens:</ListIntro>
				<ListItem>The &lt;trigger&gt;.src file (if existing) is moved to &lt;trigger&gt;.bak.</ListItem>
				<ListItem>A new &lt;trigger&gt;.src file is generated based on the actions and conditions.</ListItem>
				<ListItem>The source file &lt;trigger&gt;.src is compiled into an object &lt;trigger&gt;.dll. If an error occurred, the &lt;trigger&gt;.err file contains the compilation errors and warnings.</ListItem>
			</List>
		</GeneralSection>
		<RelatedTopics><SectionTitle>
                                 Related topics
                              </SectionTitle>
			<RelTopic><Link href="/baanerp/da/onlinemanual/000300" role="manual">Triggering</Link>
			</RelTopic>
			<RelTopic><Link href="/baanerp/da/onlinemanual/000302" role="manual">To configure an attached condition script</Link>
			</RelTopic>
			<RelTopic><Link href="/baanerp/da/onlinemanual/000303" role="manual">To configure an attached action script</Link>
			</RelTopic>
		</RelatedTopics>
	</HelpTopic>
	<Fields><FieldHelp ID="datrg100.trig"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Trigger</Title>
			</Header>
			<FuncDesc>An identification of the trigger. You can use a logical name.</FuncDesc>
		</FieldHelp>
		<FieldHelp ID="datrg100.dsca"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Description</Title>
			</Header>
			<FuncDesc>A description of the trigger. Filling in this field is optional.</FuncDesc>
		</FieldHelp>
		<FieldHelp ID="datrg100.path"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Path for Program</Title>
			</Header>
			<FuncDesc>The directory that contains the trigger's runtime library that is generated.</FuncDesc>
			<SimpleSection><Paragraph class="Default">When you change the path, the trigger's runtime files are removed and new runtime files are generated in the new directory. Refer to <Link href="#runtime_components" role="internal">RUNTIME COMPONENTS</Link> for more information.</Paragraph>
				<Paragraph class="Default">Filling this field is mandatory.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg100.cont"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Condition Template</Title>
			</Header>
			<FuncDesc>The condition template determines how a condition is configured.</FuncDesc>
			<SimpleSection><List><ListIntro>Select one of the following condition templates from the drop-down list box:</ListIntro>
					<ListItemHead>None:</ListItemHead>
					<ListItem>no condition needs to be checked; all incoming trigger events are processed.</ListItem>
					<ListItemHead>Attached Script:</ListItemHead>
					<ListItem>the condition is coded in a text (condition script) that is attached to the trigger. When you execute the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.1" role="command">Configure Conditions...</GUIRef> command, the text editor is started. The first time you run this command, an (almost) empty condition template is generated (consisting of a function header and some specifications with an almost empty function body). You must fill this template with Baan C code. For more information on trigger condition scripts, refer to <Link href="/baanerp/da/onlinemanual/000302" role="manual">To configure an attached condition script</Link>.</ListItem>
					<ListItemHead>Configure via Dialog:</ListItemHead>
					<ListItem>the condition is entered in a dialog. When you execute the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.1" role="command">Configure Conditions...</GUIRef> command, the <Link href="/baanerp/da/trg/datrg1110m000" role="session">Configure Trigger Conditions (datrg1110m000)</Link> session is started.</ListItem>
				</List>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg100.actt"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Action Template</Title>
			</Header>
			<FuncDesc>Use this field to select how the action to be executed by the trigger is configured.</FuncDesc>
			<SimpleSection><List><ListIntro>Select one of the following action templates from the drop-down list box:</ListIntro>
					<ListItemHead>Attached Script:</ListItemHead>
					<ListItem>The action is coded in a text that is attached to the trigger. Run the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.2" role="command">Configure Actions...</GUIRef> command, to open this text with the text editor. The first time you run this command, an (almost) empty action template is generated. This new template consists of a function header and some specifications, and an almost empty function body. You must fill this action template with Baan C code. For more information on Trigger Action scripts, refer to <Link href="/baanerp/da/onlinemanual/000303" role="manual">To configure an attached action script</Link>.</ListItem>
					<ListItemHead>Fan Out :</ListItemHead>
					<ListItem>The trigger will in turn invoke multiple other triggers. A fan out action is useful if a trigger must perform multiple actions in parallel, or if a trigger must use multiple conditions. In such situations, you must define a trigger that invokes multiple other triggers, which in turn implement the parallel conditions/actions. When you run the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.2" role="command">Configure Actions...</GUIRef> command, the <Link href="/baanerp/da/trg/datrg1120m000" role="session">Configure Fan Out Action (datrg1120m000)</Link> session is started.</ListItem>
					<ListItemHead>Create XML File:</ListItemHead>
					<ListItem>The trigger will write the event to an XML file. When you run the <GUIRef href="/baanerp/da/trg/datrg1100m000#exec.user.2" role="command">Configure Actions...</GUIRef> command, the <GUIRef href="/baanerp/da/trg/datrg1225m000" role="session">Configure XML File Action (datrg1225m000)</GUIRef> session is started. Note The 'create XML file' action is not suitable for high volumes. For details refer to <GUIRef href="" role="manual">Notes on performance</GUIRef> in the online help of the <Link href="/baanerp/da/trg/datrg1225m000" role="session">Configure XML File Action (datrg1225m000)</Link> session.</ListItem>
				</List>
				<Paragraph class="Default">In the future, other action templates may be added.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg100.dbug"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Debug</Title>
			</Header>
			<FuncDesc>This field indicates whether the runtime program must be generated in debug mode. The debug mode can be useful for searching an error in the program: the program can run step by step, you can trace variables and so on. For more information refer to "The Debugger" in the <DocRef>ERP LN 6.1 Programmer's Guide</DocRef>.</FuncDesc>
		</FieldHelp>
	</Fields>
	<FormCommands><CommandHelp ID="exec.user.1"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Configure Conditions...</Title>
			</Header>
			<FuncDesc>Use this command to define the trigger condition. Depending on the selected <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.cont" role="manual">Condition Template</GUIRef> you must configure the condition in a text editor or in a session.</FuncDesc>
		</CommandHelp>
		<CommandHelp ID="exec.user.2"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Configure Actions...</Title>
			</Header>
			<FuncDesc>Use this command to define the action that the trigger must take. Depending on the selected <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.actt" role="manual">Action Template</GUIRef> you must configure the action in a text editor or in a session.</FuncDesc>
		</CommandHelp>
		<CommandHelp ID="exec.user.3"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Generate Program</Title>
			</Header>
			<FuncDesc>Use this command to explicitly regenerate the trigger's runtime components when the conditions or action settings are not changed.</FuncDesc>
			<SimpleSection><Paragraph class="Default">Usually you won't need this command, because in most situations the generation is done automatically. You may need it, for example, when the generation failed because the trigger's runtime files could not be written to the directory that is specified in the <GUIRef href="/baanerp/da/trg/datrg1100m000#datrg100.path" role="manual">Path for Program</GUIRef> field. For more information, refer to RUNTIME COMPONENTS.</Paragraph>
			</SimpleSection>
		</CommandHelp>
	</FormCommands>
</Session>
