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

ActionField1010

Beschrijving: Create SafetyIncident (with ObjectDamage when ShiftLogLine has Equipment or ProcessFunction) for ShiftLogLine when ShiftLogLine has no SafetyIncident. Custom: Nee

Propertiesbewerken

Property Type Accessor
ShiftLogLine ShiftLogLine Root

XMLbewerken

<Workflow Name="ActionField1010" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create SafetyIncident (with ObjectDamage when ShiftLogLine has Equipment or ProcessFunction) for ShiftLogLine when ShiftLogLine has no SafetyIncident.</Description>
	<Properties>
		<Property	Name="ShiftLogLine"				Type="ShiftLogLine"		Accessor="Root"		Direction="In" />

		<Property	Name="CreatedObjectDamage"		Type="ObjectDamage"		Accessor="Internal" />
		<Property	Name="CreatedSafetyIncident"	Type="SafetyIncident"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="ValidateSafetyIncidentNotPresent" Condition="${ShiftLogLine.SafetyIncident} == Empty" MessageCode="1940">
			<Parameter	Name="ShiftLogLine"	Direction="In"		Value="${ShiftLogLine}" />
		</Validation>

		<Transaction>
			<Insert Name="InsertNewSafetyIncident" ObjectType="SafetyIncident" OutputProperty="${CreatedSafetyIncident}">
				<Parameter	Name="Status"		Direction="In"		Value="SafetyIncidentStatus.Created" />
				<Parameter	Name="ReportText"	Direction="In"		Value="#contextdescription_capital(${ShiftLogLine.ShiftLog}) ${ShiftLogLine.ShiftLog.Id} - ${ShiftLogLine.ShiftLog.Description}:#{SpecialCharacters.NewLine}${ShiftLogLine.Text}" />
			</Insert>

			<Choose Name="ChooseEquipmentIsEmptyOrNot">
				<When Name="WhenEquipmentIsEmpty" Condition="${ShiftLogLine.Equipment} == Empty">
					<When Name="WhenProcessFunctionOnShiftLogbookIsNotEmpty" Condition="${ShiftLogLine.ShiftLogbook.ProcessFunction?} != Empty">
						<Insert Name="InsertNewObjectDamageForSafetyIncidentAssigningProcessFunctionFromShiftLogbook" ObjectType="ObjectDamage" OutputProperty="${CreatedObjectDamage}">
							<Parameter	Name="ProcessFunction"	Direction="In"		Value="${ShiftLogLine.ShiftLogbook.ProcessFunction}" />
							<Parameter	Name="SafetyIncident"	Direction="In"		Value="${CreatedSafetyIncident}" />
						</Insert>
					</When>
				</When>

				<Otherwise Name="OtherwiseEquipmentIsNotEmpty">
					<Insert Name="InsertNewObjectDamageForSafetyIncidentAssigningEquipmentFromShiftLogLine" ObjectType="ObjectDamage" OutputProperty="${CreatedObjectDamage}">
						<Parameter	Name="Equipment"		Direction="In"		Value="${ShiftLogLine.Equipment}" />
						<Parameter	Name="SafetyIncident"	Direction="In"		Value="${CreatedSafetyIncident}" />
					</Insert>
				</Otherwise>
			</Choose>

			<Assign Name="Assign newly created SafetyIncident to ShiftLogLine" Property="${ShiftLogLine.SafetyIncident}" Value="${CreatedSafetyIncident}" />
		</Transaction>

		<UserContent Name="Post" />

		<View Name="OpenScreen" ViewName="DataEntryScreen">
			<Parameter	Name="DomainObject"			Direction="In"		Value="${CreatedSafetyIncident}" />
			<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${CreatedSafetyIncident.Description} == Empty" />
		</View>
	</Execution>
</Workflow>