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

ActionField1005

Beschrijving: Create (and optionally plan) a ShiftLogLine from a MeetingTopic. Custom: Nee

Propertiesbewerken

Property Type Accessor
MeetingTopic MeetingTopic Root

Gerelateerde workflowsbewerken

Workflow Beschrijving
ShiftLogLine_ActionField1005_Dates Set dates for the created ShiftLogLine from a MeetingTopic.

XMLbewerken

<Workflow Name="ActionField1005" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create (and optionally plan) a ShiftLogLine from a MeetingTopic.</Description>
	<Properties>
		<Property	Name="MeetingTopic"								Type="MeetingTopic"			Accessor="Root"		Direction="In" />

		<Property	Name="Apostrophe"								Type="String"				Accessor="Internal"						Default="'" />
		<Property	Name="CreatedShiftLogLine"						Type="ShiftLogLine"			Accessor="Internal" />
		<Property	Name="EnteredShiftLogLineText"					Type="UltimoString"			Accessor="Internal" />
		<Property	Name="EquipmentContext"							Type="Context"				Accessor="Internal" />
		<Property	Name="Now"										Type="DateTime"				Accessor="Internal"						Default="#{Environment.CurrentDateTime}"	Comment="seconds are stripped off" />
		<Property	Name="SelectedShiftLogbook"						Type="ShiftLogbook"			Accessor="Internal" />
		<Property	Name="SelectedShiftLogEndDate"					Type="Date?"				Accessor="Internal" />
		<Property	Name="SelectedShiftLogEndWorkPeriod"			Type="WorkPeriod"			Accessor="Internal" />
		<Property	Name="SelectedShiftLogEndWorkPeriodEndTime"		Type="DateTime"				Accessor="Internal"																	Comment="composed of SelectedShiftLogEndDate combined with SelectedShiftLogEndWorkPeriod.EndTime" />
		<Property	Name="SelectedShiftLogEndWorkPeriodStartTime"	Type="DateTime"				Accessor="Internal"																	Comment="composed of SelectedShiftLogEndDate combined with SelectedShiftLogEndWorkPeriod.StartTime" />
		<Property	Name="SelectedShiftLogLineEquipment"			Type="Equipment"			Accessor="Internal" />
		<Property	Name="SelectedShiftLogLineType"					Type="ShiftLogLineType"		Accessor="Internal" />
		<Property	Name="SelectedShiftLogStartDate"				Type="Date?"				Accessor="Internal" />
		<Property	Name="SelectedShiftLogStartWorkPeriod"			Type="WorkPeriod"			Accessor="Internal" />
		<Property	Name="SelectedShiftLogStartWorkPeriodEndTime"	Type="DateTime"				Accessor="Internal"																	Comment="composed of SelectedShiftLogStartDate combined with SelectedShiftLogStartWorkPeriod.EndTime" />
		<Property	Name="SelectedShiftLogStartWorkPeriodStartTime"	Type="DateTime"				Accessor="Internal"																	Comment="composed of SelectedShiftLogStartDate combined with SelectedShiftLogStartWorkPeriod.StartTime" />
		<Property	Name="SqlWhereClause"							Type="UltimoString"			Accessor="Internal"																	Comment="to filter valid Equipment" />
		<Property	Name="Today"									Type="Date"					Accessor="Internal"						Default="${Now.Date}"						Comment="only using date component" />
		<Property	Name="WorkPeriodContext"						Type="Context"				Accessor="Internal" />
		<Property	Name="WorkPeriodIds"							Type="List[UltimoString]"	Accessor="Internal"																	Comment="to filter valid WorkPeriods" />
	</Properties>
	<Execution>
		<Comment><![CDATA[ This workflow is very similar to ShiftLogLine_Edit. Changes to this workflow should likely also be implemented in that workflow. ]]></Comment>

		<UserContent Name="Pre" />

		<Assign Name="Strip seconds from current date/time" Property="${Now}" Value="=#setdatetime(${Now},#gethours(${Now}),#getminutes(${Now}))" />

		<SystemDialog Name="DialogSelectMeeting" DialogName="SelectDomainObject">
			<Parameter	Name="EntityName"					Direction="In"		Value="ShiftLogbook" />
			<Parameter	Name="SelectionListConfiguration"	Direction="In"		Value="Default" />
			<Parameter	Name="SqlWhereClause"				Direction="In"		Value="ShlbContext = 1" />
			<Parameter	Name="DomainObject"					Direction="Out"								OutputProperty="${SelectedShiftLogbook}" />
		</SystemDialog>

		<When Name="WhenMeetingTopicHasEquipment" Condition="${MeetingTopic.Equipment} != Empty">
			<When Name="WhenSelectedShiftLogbookHasProcessFunction" Condition="${SelectedShiftLogbook.ProcessFunction} != Empty">
				<Validation Name="ValidateEquipmentOnMeetingTopicHasSameProcessFunctionAsOnSelectedShiftLogbook" Condition="${MeetingTopic.Equipment.ProcessFunction} == ${SelectedShiftLogbook.ProcessFunction}" MessageCode="1968">
					<Parameter	Name="Equipment"		Direction="In"		Value="${MeetingTopic.Equipment}" />
					<Parameter	Name="ProcessFunction"	Direction="In"		Value="${SelectedShiftLogbook.ProcessFunction}" />
					<Parameter	Name="ShiftLogbook"		Direction="In"		Value="${SelectedShiftLogbook}" />
				</Validation>
			</When>

			<When Name="WhenSelectedShiftLogbookHasDepartment" Condition="${SelectedShiftLogbook.Department} != Empty">
				<Validation Name="ValidateEquipmentOnMeetingTopicHasSameDepartmentAsOnSelectedShiftLogbook" Condition="${MeetingTopic.Equipment.Department} == ${SelectedShiftLogbook.Department}" MessageCode="1969">
					<Parameter	Name="Department"	Direction="In"		Value="${SelectedShiftLogbook.Department}" />
					<Parameter	Name="Equipment"	Direction="In"		Value="${MeetingTopic.Equipment}" />
					<Parameter	Name="ShiftLogbook"	Direction="In"		Value="${SelectedShiftLogbook}" />
				</Validation>
			</When>
		</When>

		<WorkflowCall Name="ShiftLogbook_GetAllWorkPeriods" WorkflowName="ShiftLogbook_GetAllWorkPeriods">
			<Parameter	Name="ShiftLogbook"			Direction="In"		Value="${SelectedShiftLogbook}" />
			<Parameter	Name="ValidationForCreate"	Direction="In"		Value="True" />
			<Parameter	Name="WorkPeriodIds"		Direction="Out"										OutputProperty="${WorkPeriodIds}" />
		</WorkflowCall>

		<Choose Name="Check if ProcessFunction or Department set on ShiftLogbook">
			<When Name="When ProcessFunction set" Condition="${SelectedShiftLogbook.ProcessFunction} != Empty">
				<Assign Name="Add ProcessFunction and Hierarchy to SqlWhereClause" Property="${SqlWhereClause}" Value="=#concat('EqmId IN (SELECT EqmId FROM dba.Equipment WHERE EqmPrfId IN (SELECT PrfhPrfId FROM dba.ProcessFunctionHierarchy WHERE PrfhPartOfPrfId = ', ${Apostrophe}, ${SelectedShiftLogbook.ProcessFunction.Id}, ${Apostrophe}, ')) OR EqmPrfId = ', ${Apostrophe}, ${SelectedShiftLogbook.ProcessFunction.Id}, ${Apostrophe})" />
			</When>


			<When Name="When Department set" Condition="${SelectedShiftLogbook.Department} != Empty">
				<Assign Name="Add Department to SqlWhereClause" Property="${SqlWhereClause}" Value="EqmDepId = '${SelectedShiftLogbook.Department.Id}'" />
			</When>
		</Choose>

		<Assign Name="Assign EquipmentContext" Property="${EquipmentContext}" Value="EquipmentContext.Installation" />
		<Assign Name="Assign WorkPeriodContext" Property="${WorkPeriodContext}" Value="WorkPeriodContext.ShiftHandover" />

		<Dialog Name="CreateShiftLogLineForShiftLogbookDialog" TitleCode="TOSHIFTLOGBOOK">
			<Container>
				<Container Border="True">
					<Html Name="ShiftLogLineText" Value="${MeetingTopic.Text}" OutputProperty="${EnteredShiftLogLineText}" Required="True" LabelCode="DESCRIPTION" TextAreaRows="4" />

					<ComboBox Name="ShiftLogLineType" Value="${SelectedShiftLogLineType}" OutputProperty="${SelectedShiftLogLineType}" ColumnName="ShlltId" LabelCode="SHIFTLOGLINETYPE" />

					<SelectionList Name="ShiftLogLineEquipment" Value="${MeetingTopic.Equipment}" OutputProperty="${SelectedShiftLogLineEquipment}" ColumnName="EqmId" LabelCode="EQUIPMENT" SqlWhereClause="${SqlWhereClause}" />
				</Container>

				<Container TitleCode="PLANSHIFTLOGLINE" Border="True">
					<Date Name="SelectedShiftLogStartDate" Value="${SelectedShiftLogStartDate}" OutputProperty="${SelectedShiftLogStartDate}" Required="=${SelectedShiftLogStartWorkPeriod} != Empty" LabelCode="STARTDATE" />

					<ComboBox Name="SelectedShiftLogStartWorkPeriod" Value="${SelectedShiftLogStartWorkPeriod}" OutputProperty="${SelectedShiftLogStartWorkPeriod}" Required="=${SelectedShiftLogStartDate} != Empty" LabelCode="WORKPERIOD" OrderDirection="Ascending" OrderBy="StartTime">
						<Filters>
							<InFilter PropertyName="Id" Values="${WorkPeriodIds}" />
							<PropertyFilter	PropertyName="Context"	Operator="="		PropertyValue="WorkPeriodContext.ShiftHandover" />
						</Filters>
					</ComboBox>

					<Date Name="SelectedShiftLogEndDate" Value="${SelectedShiftLogEndDate}" OutputProperty="${SelectedShiftLogEndDate}" Required="=${SelectedShiftLogEndWorkPeriod} != Empty" LabelCode="ENDDATE" />

					<ComboBox Name="SelectedShiftLogEndWorkPeriod" Value="${SelectedShiftLogEndWorkPeriod}" OutputProperty="${SelectedShiftLogEndWorkPeriod}" Required="=${SelectedShiftLogEndDate} != Empty" LabelCode="WORKPERIOD" OrderDirection="Ascending" OrderBy="StartTime">
						<Filters>
							<InFilter PropertyName="Id" Values="${WorkPeriodIds}" />
							<PropertyFilter	PropertyName="Context"	Operator="="		PropertyValue="WorkPeriodContext.ShiftHandover" />
						</Filters>
					</ComboBox>
				</Container>
			</Container>
		</Dialog>

		<Comment><![CDATA[ Set some internal variables to make validations better readable. These are composed by the selected date(s) and the time as set on the selected work period(s). ]]></Comment>

		<When Name="StartDate and StartWorkPeriod are both selected" Condition="${SelectedShiftLogStartDate} != Empty &amp;&amp; ${SelectedShiftLogStartWorkPeriod} != Empty">
			<WorkflowCall Name="ShiftLog_GetStartAndEndDateTimes" WorkflowName="ShiftLog_GetStartAndEndDateTimes">
				<Parameter	Name="StartDate"		Direction="In"		Value="${SelectedShiftLogStartDate}" />
				<Parameter	Name="WorkPeriod"		Direction="In"		Value="${SelectedShiftLogStartWorkPeriod}" />
				<Parameter	Name="EndDateTime"		Direction="Out"													OutputProperty="${SelectedShiftLogStartWorkPeriodEndTime}" />
				<Parameter	Name="StartDateTime"	Direction="Out"													OutputProperty="${SelectedShiftLogStartWorkPeriodStartTime}" />
			</WorkflowCall>
		</When>

		<When Name="EndDate and EndWorkPeriod are both selected" Condition="${SelectedShiftLogEndDate} != Empty &amp;&amp; ${SelectedShiftLogEndWorkPeriod} != Empty">
			<WorkflowCall Name="ShiftLog_GetStartAndEndDateTimes" WorkflowName="ShiftLog_GetStartAndEndDateTimes">
				<Parameter	Name="StartDate"		Direction="In"		Value="${SelectedShiftLogEndDate}" />
				<Parameter	Name="WorkPeriod"		Direction="In"		Value="${SelectedShiftLogEndWorkPeriod}" />
				<Parameter	Name="EndDateTime"		Direction="Out"													OutputProperty="${SelectedShiftLogEndWorkPeriodEndTime}" />
				<Parameter	Name="StartDateTime"	Direction="Out"													OutputProperty="${SelectedShiftLogEndWorkPeriodStartTime}" />
			</WorkflowCall>
		</When>

		<Transaction>
			<Insert Name="Insert a new ShiftLogLine" ObjectType="ShiftLogLine" OutputProperty="${CreatedShiftLogLine}">
				<Parameter	Name="Context"					Direction="In"		Value="ShiftLogLineContext.ShiftHandover" />
				<Parameter	Name="Status"					Direction="In"		Value="ShiftLogLineStatus.Open" />
				<Parameter	Name="CreatedFromMeetingTopic"	Direction="In"		Value="${MeetingTopic}" />
				<Parameter	Name="Department"				Direction="In"		Value="${SelectedShiftLogbook.Department}" />
				<Parameter	Name="Equipment"				Direction="In"		Value="${SelectedShiftLogLineEquipment}" />
				<Parameter	Name="ProcessFunction"			Direction="In"		Value="${SelectedShiftLogbook.ProcessFunction}" />
				<Parameter	Name="ShiftLogbook"				Direction="In"		Value="${SelectedShiftLogbook}" />
				<Parameter	Name="ShiftLogLineType"			Direction="In"		Value="${SelectedShiftLogLineType}" />
				<Parameter	Name="Text"						Direction="In"		Value="${EnteredShiftLogLineText}" />
			</Insert>

			<WorkflowCall Name="ShiftLogLine_ActionField1005_Dates" WorkflowName="ShiftLogLine_ActionField1005_Dates">
				<Parameter	Name="Now"										Direction="In"		Value="${Now}" />
				<Parameter	Name="SelectedShiftLogbook"						Direction="In"		Value="${SelectedShiftLogbook}" />
				<Parameter	Name="SelectedShiftLogEndDate"					Direction="In"		Value="${SelectedShiftLogEndDate}" />
				<Parameter	Name="SelectedShiftLogEndWorkPeriod"			Direction="In"		Value="${SelectedShiftLogEndWorkPeriod}" />
				<Parameter	Name="SelectedShiftLogEndWorkPeriodEndTime"		Direction="In"		Value="${SelectedShiftLogEndWorkPeriodEndTime}" />
				<Parameter	Name="SelectedShiftLogEndWorkPeriodStartTime"	Direction="In"		Value="${SelectedShiftLogEndWorkPeriodStartTime}" />
				<Parameter	Name="SelectedShiftLogStartDate"				Direction="In"		Value="${SelectedShiftLogStartDate}" />
				<Parameter	Name="SelectedShiftLogStartWorkPeriod"			Direction="In"		Value="${SelectedShiftLogStartWorkPeriod}" />
				<Parameter	Name="SelectedShiftLogStartWorkPeriodEndTime"	Direction="In"		Value="${SelectedShiftLogStartWorkPeriodEndTime}" />
				<Parameter	Name="SelectedShiftLogStartWorkPeriodStartTime"	Direction="In"		Value="${SelectedShiftLogStartWorkPeriodStartTime}" />
				<Parameter	Name="CreatedShiftLogLine"						Direction="InOut"	Value="${CreatedShiftLogLine}"						OutputProperty="${CreatedShiftLogLine}" />
			</WorkflowCall>

			<Choose Name="Check if MeetingTopic is created from a ShiftLogLine">
				<When Name="When created from a ShiftLogLine" Condition="${MeetingTopic.ShiftLogLine} != Empty">
					<Assign Name="Assign OriginShiftLogLine on ShiftLogLine on MeetingTopic as origin" Property="${CreatedShiftLogLine.OriginShiftLogLine}" Value="${MeetingTopic.ShiftLogLine.OriginShiftLogLine}" />
				</When>

				<Otherwise Name="Otherwise ShiftLogLine will become its own origin">
					<Assign Name="Assign ShiftLogLine itself as origin" Property="${CreatedShiftLogLine.OriginShiftLogLine}" Value="${CreatedShiftLogLine}" />
				</Otherwise>
			</Choose>
		</Transaction>

		<Message Name="MessageShiftLogLineCreatedOrPlanned" MessageCode="1944">
			<Parameter	Name="CreatedShiftLogLine"	Direction="In"		Value="${CreatedShiftLogLine}" />
		</Message>

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

Sub-workflow XMLbewerken

ShiftLogLine_ActionField1005_Datesbewerken

Beschrijving: Set dates for the created ShiftLogLine from a MeetingTopic.

<Workflow Name="ShiftLogLine_ActionField1005_Dates" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Set dates for the created ShiftLogLine from a MeetingTopic.</Description>
	<Properties>
		<Property	Name="Now"										Type="DateTime"		Accessor="Optional"	Direction="In"		Default="#{Environment.CurrentDateTime}"	Comment="seconds are stripped off" />
		<Property	Name="SelectedShiftLogbook"						Type="ShiftLogbook"	Accessor="Optional"	Direction="In" />
		<Property	Name="SelectedShiftLogEndDate"					Type="Date?"		Accessor="Optional"	Direction="In" />
		<Property	Name="SelectedShiftLogEndWorkPeriod"			Type="WorkPeriod"	Accessor="Optional"	Direction="In" />
		<Property	Name="SelectedShiftLogEndWorkPeriodEndTime"		Type="DateTime"		Accessor="Optional"	Direction="In"													Comment="composed of SelectedShiftLogEndDate combined with SelectedShiftLogEndWorkPeriod.EndTime" />
		<Property	Name="SelectedShiftLogEndWorkPeriodStartTime"	Type="DateTime"		Accessor="Optional"	Direction="In"													Comment="composed of SelectedShiftLogEndDate combined with SelectedShiftLogEndWorkPeriod.StartTime" />
		<Property	Name="SelectedShiftLogStartDate"				Type="Date?"		Accessor="Optional"	Direction="In" />
		<Property	Name="SelectedShiftLogStartWorkPeriod"			Type="WorkPeriod"	Accessor="Optional"	Direction="In" />
		<Property	Name="SelectedShiftLogStartWorkPeriodEndTime"	Type="DateTime"		Accessor="Optional"	Direction="In"													Comment="composed of SelectedShiftLogStartDate combined with SelectedShiftLogStartWorkPeriod.EndTime" />
		<Property	Name="SelectedShiftLogStartWorkPeriodStartTime"	Type="DateTime"		Accessor="Optional"	Direction="In"													Comment="composed of SelectedShiftLogStartDate combined with SelectedShiftLogStartWorkPeriod.StartTime" />

		<Property	Name="CreatedShiftLogLine"						Type="ShiftLogLine"	Accessor="Root"		Direction="InOut" />

		<Property	Name="CreatedShiftLogLineToShiftLog"			Type="ShiftLogLine"	Accessor="Internal" />
		<Property	Name="ExistingShiftLog"							Type="ShiftLog"		Accessor="Internal" />
		<Property	Name="LastShiftLog"								Type="ShiftLog"		Accessor="Internal" />
		<Property	Name="LastShiftLogWorkPeriodEndTime"			Type="DateTime"		Accessor="Internal"																	Comment="composed of LastShiftLogDate combined with LastShiftLogWorkPeriod.EndTime" />
		<Property	Name="MaxShiftLogId"							Type="String"		Accessor="Internal" />
	</Properties>
	<Execution>
		<Comment><![CDATA[ This workflow is very similar to ShiftLogLine_Edit. Changes to this workflow should likely also be implemented in that workflow. ]]></Comment>

		<UserContent Name="Pre" />

		<Transaction>
			<Choose Name="Check if both StartDate and StartWorkPeriod were selected">
				<When Name="StartDate and StartWorkPeriod are both selected" Condition="${SelectedShiftLogStartDate} != Empty &amp;&amp; ${SelectedShiftLogStartWorkPeriod} != Empty">
					<GetItem Name="Get existing ShiftLog for selected StartDate and WorkPeriod if possible" Type="ShiftLog" OutputProperty="${ExistingShiftLog}" Comment="Try to query ShiftLog with selected StartDate and WorkPeriod">
						<Filters>
							<PropertyFilter	PropertyName="ShiftLogbook"	Operator="="		PropertyValue="${SelectedShiftLogbook}" />
							<PropertyFilter	PropertyName="StartDate"	Operator="="		PropertyValue="${SelectedShiftLogStartDate}" />
							<PropertyFilter	PropertyName="Status"		Operator="="		PropertyValue="ShiftLogStatus.Open" />
							<PropertyFilter	PropertyName="WorkPeriod"	Operator="="		PropertyValue="${SelectedShiftLogStartWorkPeriod}" />
						</Filters>
					</GetItem>

					<Choose Name="Check if a ShiftLog is already created for selected StartDate and WorkPeriod or not">
						<When Name="When not created yet" Condition="${ExistingShiftLog} == Empty">
							<Validation Name="ValidateDoNotPlanInPast" Condition="${SelectedShiftLogStartWorkPeriodStartTime} &gt; ${Now}" MessageCode="1938" Comment="Check if the StartTime of the shift log to be created is after the current date/time" />
						</When>

						<Otherwise Name="Otherwise, already created">
							<Validation Name="ValidateDoNotPlanInFinishedShiftLog" Condition="${SelectedShiftLogStartWorkPeriodEndTime} &gt; ${Now}" MessageCode="1945" Comment="Check if the EndTime of the existing shift log is after the current date/time" />
						</Otherwise>
					</Choose>

					<Assign Name="Assign SelectedShiftLogStartDate" Property="${CreatedShiftLogLine.ScheduledStartDate}" Value="${SelectedShiftLogStartWorkPeriodStartTime}" />
					<Assign Name="Assign SelectedShiftLogStartWorkPeriod" Property="${CreatedShiftLogLine.ScheduledStartWorkPeriod}" Value="${SelectedShiftLogStartWorkPeriod}" />

					<Choose Name="Check if both EndDate and EndWorkPeriod were selected">
						<When Name="EndDate and EndWorkPeriod are both selected" Condition="${SelectedShiftLogEndDate} != Empty &amp;&amp; ${SelectedShiftLogEndWorkPeriod} != Empty">
							<Validation Name="ValidateDoNotExpireBeforeStart" Condition="${SelectedShiftLogEndWorkPeriodStartTime} &gt;= ${SelectedShiftLogStartWorkPeriodEndTime}" MessageCode="1985" />

							<Assign Name="Assign SelectedShiftLogEndDate 1" Property="${CreatedShiftLogLine.ScheduledEndDate}" Value="${SelectedShiftLogEndWorkPeriodEndTime}" />
							<Assign Name="Assign SelectedShiftLogEndWorkPeriod" Property="${CreatedShiftLogLine.ScheduledEndWorkPeriod}" Value="${SelectedShiftLogEndWorkPeriod}" />
						</When>

						<Otherwise Name="EndDate and EndWorkPeriod are not both selected">
							<Validation Name="ValidateEndDateAndEndWorkPeriodAreBothUnselected" Condition="${SelectedShiftLogEndDate} == Empty &amp;&amp; ${SelectedShiftLogEndWorkPeriod} == Empty" MessageCode="1983" Comment="If not both selected as tested above, they should both be empty (enforced by dialog)">
								<Parameter	Name="Action"	Direction="In"		Value="Plan" />
							</Validation>
						</Otherwise>
					</Choose>

					<ChangeStatus Name="ChangeStatusShiftLogLine" DomainObject="${CreatedShiftLogLine}" NewStatus="ShiftLogLineStatus.Planned" />

					<When Name="When if a ShiftLog is already created" Condition="${ExistingShiftLog} != Empty">
						<WorkflowCall Name="ShiftLogLine_CopyShiftLogLine" WorkflowName="ShiftLogLine_CopyShiftLogLine">
							<Parameter	Name="ShiftLogLine"			Direction="In"		Value="${CreatedShiftLogLine}" />
							<Parameter	Name="CreatedShiftLogLine"	Direction="Out"										OutputProperty="${CreatedShiftLogLineToShiftLog}" />
						</WorkflowCall>

						<Assign Name="Assign this newest ShiftLogLine to the existing ShiftLog" Property="${CreatedShiftLogLineToShiftLog.ShiftLog}" Value="${ExistingShiftLog}" />

						<ChangeStatus Name="Change status of planned ShiftLogLine because it was immediately added to existing ShiftLog" DomainObject="${CreatedShiftLogLine}" NewStatus="ShiftLogLineStatus.ToShiftLog" />
					</When>
				</When>

				<Otherwise Name="StartDate and StartWorkPeriod are not both selected">
					<Validation Name="ValidateStartDateAndStartWorkPeriodAreBothUnselected" Condition="${SelectedShiftLogStartDate} == Empty &amp;&amp; ${SelectedShiftLogStartWorkPeriod} == Empty" MessageCode="1943" Comment="If not both selected as tested above, they should both be empty (enforced by dialog)" />

					<Choose Name="Check if both EndDate and EndWorkPeriod were selected">
						<When Name="EndDate and EndWorkPeriod are both selected" Condition="${SelectedShiftLogEndDate} != Empty &amp;&amp; ${SelectedShiftLogEndWorkPeriod} != Empty">
							<Validation Name="ValidateDoNotExpireInPast" Condition="${Now} &lt;= ${SelectedShiftLogEndWorkPeriodStartTime}" MessageCode="1984" />

							<GetMax Name="GetMaxShiftLogIdForThisShiftLogbook" Type="ShiftLog" OutputProperty="${MaxShiftLogId}" PropertyName="Id">
								<Filters>
									<PropertyFilter	PropertyName="ShiftLogbook"	Operator="="		PropertyValue="${SelectedShiftLogbook}" />
								</Filters>
							</GetMax>

							<GetItem Name="GetItemLastShiftLog" Type="ShiftLog" OutputProperty="${LastShiftLog}" Comment="ShiftLog with maximum Id is the last one">
								<Filters>
									<PropertyFilter	PropertyName="Id"	Operator="="		PropertyValue="${MaxShiftLogId}" />
								</Filters>
							</GetItem>

							<Assign Name="Assign LastShiftLogWorkPeriodEndTime" Property="${LastShiftLogWorkPeriodEndTime}" Value="=#setdatetime(#getyear(${LastShiftLog.StartDate}),#getmonth(${LastShiftLog.StartDate}),#getday(${LastShiftLog.StartDate}),#gethours(${LastShiftLog.WorkPeriod.EndTime}),#getminutes(${LastShiftLog.WorkPeriod.EndTime}))" />
							<Validation Name="ValidateSelectedEndWorkPeriodIsNotBeforeEndOfLastShift" Condition="${LastShiftLogWorkPeriodEndTime} &lt;= ${SelectedShiftLogEndWorkPeriodStartTime}" MessageCode="1992" />

							<Assign Name="Assign SelectedShiftLogEndDate 2" Property="${CreatedShiftLogLine.ScheduledEndDate}" Value="#setdatetime(${SelectedShiftLogEndDate}, 0, 0)" />
							<Assign Name="Assign SelectedShiftLogEndWorkPeriod" Property="${CreatedShiftLogLine.ScheduledEndWorkPeriod}" Value="${SelectedShiftLogEndWorkPeriod}" />
						</When>

						<Otherwise Name="EndDate and EndWorkPeriod are not both selected">
							<Validation Name="ValidateEndDateAndEndWorkPeriodAreBothUnselected" Condition="${SelectedShiftLogEndDate} == Empty &amp;&amp; ${SelectedShiftLogEndWorkPeriod} == Empty" MessageCode="1983" Comment="If not both selected as tested above, they should both be empty">
								<Parameter	Name="Action"	Direction="In"		Value="Create" />
							</Validation>
						</Otherwise>
					</Choose>
				</Otherwise>
			</Choose>
		</Transaction>

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