Categorie: reference Bijgewerkt: 2026-04-08 actionfield workflow actionfield1665

ActionField1665

Beschrijving: Select a unique PnID and attach it to the LockoutTagoutRequest. Custom: Nee

Propertiesbewerken

Property Type Accessor
LockoutTagoutRequest LockoutTagoutRequest Root

XMLbewerken

<Workflow Name="ActionField1665" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Select a unique PnID and attach it to the LockoutTagoutRequest.</Description>
	<Properties>
		<Property	Name="LockoutTagoutRequest"	Type="LockoutTagoutRequest"	Accessor="Root"		Direction="In"		Comment="The LockoutTagoutRequest to attach the PnID to" />

		<Property	Name="InsertedPlotPlan"		Type="PlotPlan"				Accessor="Internal" />
		<Property	Name="SelectedPlotPlan"		Type="PlotPlan"				Accessor="Internal" />
		<Property	Name="SqlWhereClause"		Type="String"				Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="ValidateLockoutTagoutRequestHasStatusRequested" Condition="${LockoutTagoutRequest.Status} == LockoutTagoutRequestStatus.Requested" MessageCode="3214">
			<Parameter	Name="LockoutTagoutRequest"	Direction="In"		Value="${LockoutTagoutRequest}" />
		</Validation>

		<Comment><![CDATA[	Exclude the PnIDs that are already copied and attached to this LOTO request or linked to another LOTO request/LOTO plan

							SELECT *
								FROM dba.PlotPlan
								WHERE PpContext = 32		-- PpContext 32 = PlotPlanContext.LockoutTagout
									AND PpLtrId IS NULL
									AND PpLtpId IS NULL
									AND PpId NOT IN (
										SELECT alreadyLinked.PpCopyFromPpId
											FROM dba.PlotPlan alreadyLinked
											WHERE alreadyLinked.PpLtrId = <this LOTO request's ID>
												AND alreadyLinked.PpCopyFromPpId IS NOT NULL
									)
		]]></Comment>

		<Assign Name="Build sql where clause for selection list" Property="${SqlWhereClause}" Value="PpContext = 32 AND PpLtrId IS NULL AND PpLtpId IS NULL AND PpId NOT IN (SELECT a.PpCopyFromPpId FROM dba.PlotPlan a WHERE a.PpLtrId = '${LockoutTagoutRequest.Id}' AND a.PpCopyFromPpId IS NOT NULL)" />

		<SystemDialog Name="Select a LockoutTagoutPlan to add" DialogName="SelectDomainObject" Comment="Enable user to select a unique PnID.">
			<Parameter	Name="IsSystem"						Direction="In"		Value="True" />
			<Parameter	Name="SelectionListConfiguration"	Direction="In"		Value="Default" />
			<Parameter	Name="SqlWhereClause"				Direction="In"		Value="${SqlWhereClause}" />
			<Parameter	Name="TableName"					Direction="In"		Value="PlotPlan" />
			<Parameter	Name="DomainObject"					Direction="Out"									OutputProperty="${SelectedPlotPlan}" />
		</SystemDialog>

		<Transaction>
			<Insert Name="Insert a copy of SelectedPlotPlan into PlotPlan" ObjectType="PlotPlan" OutputProperty="${InsertedPlotPlan}">
				<Parameter	Name="Context"				Direction="In"		Value="${SelectedPlotPlan.Context}" />
				<Parameter	Name="Status"				Direction="In"		Value="${SelectedPlotPlan.Status}" />
				<Parameter	Name="CopyFromPlotPlan"		Direction="In"		Value="${SelectedPlotPlan}"						Comment="Used to exclude this PnID from the selection list." />
				<Parameter	Name="Description"			Direction="In"		Value="${SelectedPlotPlan.Description}" />
				<Parameter	Name="ImageFile"			Direction="In"		Value="${SelectedPlotPlan.ImageFile}" />
				<Parameter	Name="LockoutTagoutPlan"	Direction="In"		Value="${SelectedPlotPlan.LockoutTagoutPlan}" />
				<Parameter	Name="LockoutTagoutRequest"	Direction="In"		Value="${LockoutTagoutRequest}" />
				<Parameter	Name="Site"					Direction="In"		Value="${SelectedPlotPlan.Site}" />
			</Insert>
		</Transaction>

		<UserContent Name="Post" />
	</Execution>
</Workflow>