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

ActionField682

Beschrijving: Create a new YearPlan from a LongTermAsset Object (selected via dialog). Custom: Nee

Propertiesbewerken

Property Type Accessor
FormName UltimoString Optional
YearsInYearPlan Int32 Optional
YearsToCalculate Int32 Optional
Description String Optional
LongTermAsset LongTermAsset Optional

XMLbewerken

<Workflow Name="ActionField682" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create a new YearPlan from a LongTermAsset Object (selected via dialog).</Description>
	<Properties>
		<Property	Name="FormName"								Type="UltimoString"		Accessor="Optional"	Direction="In"		Default="yrp06"										Comment="Open this screen with the created YearPlan" />
		<Property	Name="YearsInYearPlan"						Type="Int32"			Accessor="Optional"	Direction="In"		Default="20"										Comment="Number of years in YearPlan" />
		<Property	Name="YearsToCalculate"						Type="Int32"			Accessor="Optional"	Direction="In"		Default="40"										Comment="Number of years to Calculate in YearPlan" />

		<Property	Name="Description"							Type="String"			Accessor="Optional"	Direction="Out" />
		<Property	Name="LongTermAsset"						Type="LongTermAsset"	Accessor="Optional"	Direction="Out" />

		<Property	Name="InsertYearPlan"						Type="YearPlan"			Accessor="Internal" />
		<Property	Name="IsOk"									Type="Boolean"			Accessor="Internal"						Default="False" />
		<Property	Name="LongTermAssetInYearPlanExistCount"	Type="Int64"			Accessor="Internal"						Default="0" />
		<Property	Name="Year"									Type="Int16"			Accessor="Internal"						Default="=#getyear(#{Environment.CurrentDateTime})" />
		<Property	Name="YearPlanCount"						Type="Int64"			Accessor="Internal" />
		<Property	Name="YearPlanExistCount"					Type="Int64"			Accessor="Internal"						Default="0" />
		<Property	Name="YearPlanFoundForChild"				Type="Boolean"			Accessor="Internal"						Default="False" />
		<Property	Name="YearPlanFoundForParent"				Type="Boolean"			Accessor="Internal"						Default="False" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<While Name="Continue showing dialog" Condition="${IsOk} == False">
			<Dialog Name="CreateLongTermAssetYearPlanDialog" TitleCode="CREATEYEARPLAN">
				<Container Border="True">
					<Number Name="YearField" Value="${Year}" OutputProperty="${Year}" ColumnName="YrpYear" LabelCode="YEAR" MinValue="1800" />

					<Text Name="DecriptionField" Value="${Description}" OutputProperty="${Description}" ColumnName="YrpDescr" LabelCode="DESCRIPTION" />

					<SelectionList Name="LongTermAsset" Value="${LongTermAsset}" OutputProperty="${LongTermAsset}" ColumnName="LtaId" ViewfieldConfiguration="Default" Required="true" />
				</Container>
			</Dialog>

			<Transaction>
				<GetCount Name="Get count yearplan by LongTermAsset and year" Type="YearPlan" OutputProperty="${YearPlanCount}">
					<Joins>
						<Join	Name="LongTermAsset"	Alias="longTermAsset"	Type="InnerJoin" />
					</Joins>
					<Filters>
						<PropertyFilter	PropertyName="LongTermAsset"	Operator="="		PropertyValue="${LongTermAsset}" />
						<PropertyFilter	PropertyName="Year"				Operator="="		PropertyValue="${Year}" />
					</Filters>
				</GetCount>
			</Transaction>

			<Choose Name="Check YearPlanCount">
				<When Name="Found" Condition="${YearPlanCount} &gt; 0">
					<Message Name="YearPlan already exists by year LongTermAsset/decomposition" MessageCode="2579">
						<Parameter	Name="Year"	Direction="In"		Value="${Year}" />
					</Message>

					<Assign Name="IsOk" Property="${IsOk}" Value="False" />
				</When>

				<Otherwise Name="Not found">
					<Assign Name="IsOk" Property="${IsOk}" Value="True" />
				</Otherwise>
			</Choose>

			<When Name="LongTermAsset has a parent" Condition="${IsOk} == True &amp;&amp; ${LongTermAsset.PartOfLongTermAsset} != Empty">
				<WorkflowCall Name="LongTermAsset_SearchForLongTermAssetAndDecomposition" WorkflowName="LongTermAsset_SearchForLongTermAssetAndDecomposition">
					<Parameter	Name="LongTermAsset"			Direction="In"		Value="${LongTermAsset.PartOfLongTermAsset}" />
					<Parameter	Name="Year"						Direction="In"		Value="${Year}" />
					<Parameter	Name="YearPlanFoundForParent"	Direction="InOut"	Value="${YearPlanFoundForParent}"				OutputProperty="${YearPlanFoundForParent}" />
				</WorkflowCall>

				<Choose Name="Check YearPlanFoundForParent">
					<When Name="Parent Found" Condition="${YearPlanFoundForParent} == True">
						<Message Name="YearPlan already exists by year LongTermAsset/decomposition for a parent" MessageCode="2580">
							<Parameter	Name="Year"	Direction="In"		Value="${Year}" />
						</Message>

						<Assign Name="IsOk" Property="${IsOk}" Value="False" />
					</When>

					<Otherwise Name="Not found">
						<Assign Name="IsOk" Property="${IsOk}" Value="True" />
					</Otherwise>
				</Choose>
			</When>

			<When Name="LongTermAsset has childrens" Condition="${IsOk} == True &amp;&amp; ${LongTermAsset.ContainedLongTermAssetList.Count} &gt; 0">
				<WorkflowCall Name="LongTermAsset_SearchDownForLongTermAssetAndDecomposition" WorkflowName="LongTermAsset_SearchDownForLongTermAssetAndDecomposition">
					<Parameter	Name="LongTermAsset"			Direction="In"		Value="${LongTermAsset}" />
					<Parameter	Name="Year"						Direction="In"		Value="${Year}" />
					<Parameter	Name="YearPlanFoundForChild"	Direction="InOut"	Value="${YearPlanFoundForChild}"	OutputProperty="${YearPlanFoundForChild}" />
				</WorkflowCall>

				<Choose Name="Check YearPlanFoundForChild">
					<When Name="Child Found" Condition="${YearPlanFoundForChild} == True">
						<Message Name="YearPlan already exists by year LongTermAsset/decomposition for a child" MessageCode="2581">
							<Parameter	Name="Year"	Direction="In"		Value="${Year}" />
						</Message>

						<Assign Name="IsOk" Property="${IsOk}" Value="False" />
					</When>

					<Otherwise Name="Not found">
						<Assign Name="IsOk" Property="${IsOk}" Value="True" />
					</Otherwise>
				</Choose>
			</When>
		</While>

		<Transaction>
			<GetCount Name="GetCountYearPlanExists" Type="YearPlan" OutputProperty="${YearPlanExistCount}">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="Year"	Operator="&gt;="	PropertyValue="${Year}" />
						<WhenFilter Condition="${LongTermAsset} != Empty">
							<PropertyFilter	PropertyName="LongTermAsset"	Operator="="		PropertyValue="${LongTermAsset}" />
						</WhenFilter>
					</CombinedFilter>
				</Filters>
			</GetCount>

			<When Name="WhenBuildingToUseNotEmpty" Condition="${LongTermAsset} != Empty">
				<GetCount Name="GetCountLongTermAssetInYearPlanExist" Type="YearPlan" OutputProperty="${LongTermAssetInYearPlanExistCount}">
					<Filters>
						<CombinedFilter FilterOperator="And">
							<PropertyFilter	PropertyName="Year"				Operator="&gt;="	PropertyValue="${Year}" />
							<PropertyFilter	PropertyName="LongTermAsset"	Operator="="		PropertyValue="${LongTermAsset}" />
							<PropertyFilter	PropertyName="Context"			Operator="="		PropertyValue="YearPlanContext.LongTermAssetPlan" />
							<NotFilter>
								<PropertyFilter	PropertyName="Status"		Operator="="		PropertyValue="YearPlanStatus.Concept" />
							</NotFilter>
						</CombinedFilter>
					</Filters>
				</GetCount>
			</When>

			<Validation Name="ValidationYearPlanExists" Condition="${YearPlanExistCount} == 0 &amp;&amp; ${LongTermAssetInYearPlanExistCount} == 0" MessageCode="1180">
				<Parameter	Name="DomainObject"		Direction="In"		Value="${LongTermAsset}" />
				<Parameter	Name="YearPlanContext"	Direction="In"		Value="YearPlanContext.LongTermAssetPlan" />
			</Validation>

			<When Name="WhenYearPlanExistCount" Condition="${YearPlanExistCount} == 0 &amp;&amp; ${LongTermAssetInYearPlanExistCount} == 0">
				<Insert Name="InsertYearPlanNow" ObjectType="YearPlan" OutputProperty="${InsertYearPlan}">
					<Parameter	Name="Context"					Direction="In"		Value="YearPlanContext.LongTermAssetPlan" />
					<Parameter	Name="Status"					Direction="In"		Value="YearPlanStatus.Concept" />
					<Parameter	Name="Description"				Direction="In"		Value="${Description}" />
					<Parameter	Name="LongTermAsset"			Direction="In"		Value="${LongTermAsset}" />
					<Parameter	Name="NumberOfYearsToCalculate"	Direction="In"		Value="${YearsToCalculate}" />
					<Parameter	Name="Year"						Direction="In"		Value="${Year}" />
					<Parameter	Name="YearsInYearPlan"			Direction="In"		Value="${YearsInYearPlan}" />
				</Insert>
			</When>
		</Transaction>

		<UserContent Name="Post" />

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