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

ActionField1003

Beschrijving: Close a ShiftLog and optionally create the next ShiftLog with all relevant lines. Custom: Nee

Propertiesbewerken

Property Type Accessor
ShiftLog ShiftLog Root
AllowClosureBeforeStartCurrentShift Boolean Optional
DefaultAnswerForQuestionCreateShiftLogNextShift RequestResult? Optional
SuppressQuestionCreateShiftLogNextShift Boolean Optional

XMLbewerken

<Workflow Name="ActionField1003" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Close a ShiftLog and optionally create the next ShiftLog with all relevant lines.</Description>
	<Properties>
		<Property	Name="ShiftLog"											Type="ShiftLog"				Accessor="Root"		Direction="In" />

		<Property	Name="AllowClosureBeforeStartCurrentShift"				Type="Boolean"				Accessor="Optional"	Direction="In"		Default="False"																																		Comment="Use this to allow a ShiftLog to be closed before it starts" />
		<Property	Name="DefaultAnswerForQuestionCreateShiftLogNextShift"	Type="RequestResult?"		Accessor="Optional"	Direction="In"		Default="Empty"																																		Comment="If the question (1939) is suppressed, what is the default answer? (Yes/No)" />
		<Property	Name="SuppressQuestionCreateShiftLogNextShift"			Type="Boolean"				Accessor="Optional"	Direction="In"		Default="False"																																		Comment="Suppress the question (1939) whether a new ShiftLog should be created?" />

		<Property	Name="CreatedShiftLog"									Type="ShiftLog"				Accessor="Internal" />
		<Property	Name="CreatedShiftLogLine"								Type="ShiftLogLine"			Accessor="Internal" />
		<Property	Name="CurrentWorkPeriodEndTime"							Type="DateTime"				Accessor="Internal" />
		<Property	Name="CurrentWorkPeriodStartTime"						Type="DateTime"				Accessor="Internal"						Default="=#setdatetime(#{Environment.CurrentDateTime},#gethours(${ShiftLog.WorkPeriod.StartTime}),#getminutes(${ShiftLog.WorkPeriod.StartTime}))" />
		<Property	Name="InspectionTasksWithoutJobCount"					Type="Int64"				Accessor="Internal" />
		<Property	Name="NextShiftLogStartDate"							Type="Date"					Accessor="Internal" />
		<Property	Name="NextWorkPeriodEndTime"							Type="DateTime"				Accessor="Internal" />
		<Property	Name="NextWorkPeriodStartTime"							Type="DateTime"				Accessor="Internal" />
		<Property	Name="Now"												Type="DateTime"				Accessor="Internal"						Default="#{Environment.CurrentDateTime}"																											Comment="seconds are stripped off" />
		<Property	Name="ShiftLogLines"									Type="List[ShiftLogLine]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetCount Name="Number of autonomous maintenance inspection tasks reported as Not OK and without Job" Type="ShiftLogLine" OutputProperty="${InspectionTasksWithoutJobCount}">
				<Joins>
					<Join	Name="ShiftLogLineType"	Alias="shiftLogLineType"	Type="InnerJoin" />
				</Joins>
				<Filters>
					<PropertyFilter	PropertyName="ShiftLog"										Operator="="		PropertyValue="${ShiftLog}" />
					<PropertyFilter	PropertyName="Context"										Operator="="		PropertyValue="ShiftLogLineContext.AutonomousMaintenance" />
					<PropertyFilter	PropertyName="Status"										Operator="="		PropertyValue="ShiftLogLineStatus.Finished" />
					<PropertyFilter	PropertyName="shiftLogLineType.MaintenanceTaskProcessType"	Operator="="		PropertyValue="RegisterInspectionResultAndFinish" />
					<PropertyFilter	PropertyName="QualityNotOk"									Operator="="		PropertyValue="True" />
					<PropertyEmptyFilter PropertyName="Job" />
				</Filters>
			</GetCount>
		</Transaction>

		<When Name="Inspection tasks Not OK without job are found" Condition="${InspectionTasksWithoutJobCount} &gt; 0">
			<ContinuationQuestion Name="Continue closing shift log with inspection task without job?" MessageCode="3601" Default="No">
				<Parameter	Name="Count"	Direction="In"		Value="${InspectionTasksWithoutJobCount}" />
				<Parameter	Name="ShiftLog"	Direction="In"		Value="${ShiftLog}" />
			</ContinuationQuestion>
		</When>

		<WorkflowCall Name="Close a ShiftLog and optionally create the next ShiftLog with all relevant lines" WorkflowName="ShiftLog_CloseAndOptionallyCreateNext">
			<Parameter	Name="AllowClosureBeforeStartCurrentShift"				Direction="InOut"	Value="${AllowClosureBeforeStartCurrentShift}"				OutputProperty="${AllowClosureBeforeStartCurrentShift}" />
			<Parameter	Name="CreatedShiftLog"									Direction="InOut"	Value="${CreatedShiftLog}"									OutputProperty="${CreatedShiftLog}" />
			<Parameter	Name="CreatedShiftLogLine"								Direction="InOut"	Value="${CreatedShiftLogLine}"								OutputProperty="${CreatedShiftLogLine}" />
			<Parameter	Name="CurrentWorkPeriodEndTime"							Direction="InOut"	Value="${CurrentWorkPeriodEndTime}"							OutputProperty="${CurrentWorkPeriodEndTime}" />
			<Parameter	Name="CurrentWorkPeriodStartTime"						Direction="InOut"	Value="${CurrentWorkPeriodStartTime}"						OutputProperty="${CurrentWorkPeriodStartTime}" />
			<Parameter	Name="DefaultAnswerForQuestionCreateShiftLogNextShift"	Direction="InOut"	Value="${DefaultAnswerForQuestionCreateShiftLogNextShift}"	OutputProperty="${DefaultAnswerForQuestionCreateShiftLogNextShift}" />
			<Parameter	Name="InspectionTasksWithoutJobCount"					Direction="InOut"	Value="${InspectionTasksWithoutJobCount}"					OutputProperty="${InspectionTasksWithoutJobCount}" />
			<Parameter	Name="NextShiftLogStartDate"							Direction="InOut"	Value="${NextShiftLogStartDate}"							OutputProperty="${NextShiftLogStartDate}" />
			<Parameter	Name="NextWorkPeriodEndTime"							Direction="InOut"	Value="${NextWorkPeriodEndTime}"							OutputProperty="${NextWorkPeriodEndTime}" />
			<Parameter	Name="NextWorkPeriodStartTime"							Direction="InOut"	Value="${NextWorkPeriodStartTime}"							OutputProperty="${NextWorkPeriodStartTime}" />
			<Parameter	Name="Now"												Direction="InOut"	Value="${Now}"												OutputProperty="${Now}" />
			<Parameter	Name="ShiftLog"											Direction="InOut"	Value="${ShiftLog}"											OutputProperty="${ShiftLog}" />
			<Parameter	Name="ShiftLogLines"									Direction="InOut"	Value="${ShiftLogLines}"									OutputProperty="${ShiftLogLines}" />
			<Parameter	Name="SuppressQuestionCreateShiftLogNextShift"			Direction="InOut"	Value="${SuppressQuestionCreateShiftLogNextShift}"			OutputProperty="${SuppressQuestionCreateShiftLogNextShift}" />
		</WorkflowCall>

		<UserContent Name="Post" />

		<When Name="When DefaultAnswerQuestionCreateShiftLogNextShift is yes" Condition="${DefaultAnswerForQuestionCreateShiftLogNextShift} == Yes">
			<View Name="OpenScreen" ViewName="DataEntryScreen">
				<Parameter	Name="DomainObject"			Direction="In"		Value="${CreatedShiftLog}" />
				<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${CreatedShiftLog.Description} == Empty" />
			</View>
		</When>
	</Execution>
</Workflow>