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

ActionField170

Beschrijving: Create YearPlanScenario. Custom: Nee

Propertiesbewerken

Property Type Accessor
YearPlan YearPlan Root

XMLbewerken

<Workflow Name="ActionField170" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create YearPlanScenario.</Description>
	<Properties>
		<Property	Name="YearPlan"					Type="YearPlan"			Accessor="Root"		Direction="In" />

		<Property	Name="ScenarioDescription"		Type="String"			Accessor="Internal" />
		<Property	Name="YearPlanCount"			Type="Int64"			Accessor="Internal" />
		<Property	Name="YearPlanScenario"			Type="YearPlanScenario"	Accessor="Internal" />
		<Property	Name="YearPlanScenarioContext"	Type="Context"			Accessor="Internal" />
		<Property	Name="YearPlanScenarioTest"		Type="YearPlanScenario"	Accessor="Internal" />
		<Property	Name="YearPlanTest"				Type="YearPlan"			Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Choose Name="DetermineContext">
			<When Name="WhenYearPlanContextIsLtap" Condition="${YearPlan.Context} == YearPlanContext.LongTermAssetPlan">
				<Assign Name="LtapContext" Property="${YearPlanScenarioContext}" Value="YearPlanScenarioContext.LongTermAssetPlan" />
			</When>


			<When Name="WhenYearPlanContextIsMultipleYearMaintenancePlanning" Condition="${YearPlan.Context} == YearPlanContext.LongTermMaintenancePlan">
				<Assign Name="StandardContext" Property="${YearPlanScenarioContext}" Value="YearPlanScenarioContext.LongTermMaintenancePlan" />
			</When>
		</Choose>

		<Transaction>
			<GetItem Name="CheckForExistingScenario" Type="YearPlanScenario" OutputProperty="${YearPlanScenarioTest}">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="Id.YearPlan"	Operator="="		PropertyValue="${YearPlan}" />
						<InFilter PropertyName="Status" Values="YearPlanScenarioStatus.Updatable,YearPlanScenarioStatus.Definitive" />
					</CombinedFilter>
				</Filters>
			</GetItem>
		</Transaction>

		<When Name="CheckYearPlanScenario » IfYearPlanScenarioIsNotEmptyThrowMessage" Condition="${YearPlanScenarioTest} != Empty">
			<Message Name="NoScenarioCreatedScenarioWithStatusDefinitiveOrUpdatableAlreadyExists" MessageCode="1024" />

			<Stop Name="Stop" Mode="EndCurrent" Comment="End Workflow" />
		</When>

		<Transaction>
			<Insert Name="AddScenario" ObjectType="YearPlanScenario" OutputProperty="${YearPlanScenario}">
				<Parameter	Name="Id.YearPlan"	Direction="In"		Value="${YearPlan}" />
				<Parameter	Name="Context"		Direction="In"		Value="${YearPlanScenarioContext}" />
				<Parameter	Name="Status"		Direction="In"		Value="YearPlanScenarioStatus.Concept" />
			</Insert>

			<FormatText Name="CreateScenarioDescription" TextCode="SCENARIODCR" OutputProperty="${ScenarioDescription}">
				<Parameters>
					<Parameter	Name="LineId"	Direction="In"		Value="${YearPlanScenario.Id.LineId}" />
				</Parameters>
			</FormatText>

			<Assign Name="SetDescription" Property="${YearPlanScenario.Description}" Value="${ScenarioDescription}" />

			<Choose Name="MjoPlannerOrVvPlanner">
				<When Name="MjoPlanner" Condition="${YearPlan.Context} == YearPlanContext.LongTermMaintenancePlan">
					<Assign Name="SetContext" Property="${YearPlanScenario.Context}" Value="YearPlanScenarioContext.LongTermMaintenancePlan" />
					<Assign Name="SetPercentage" Property="${YearPlanScenario.IndexPercentage}" Value="#{Company.IndexPercentage}" />
				</When>


				<When Name="LtapPlanner" Condition="${YearPlan.Context} == YearPlanContext.LongTermAssetPlan">
					<Assign Name="SetContext" Property="${YearPlanScenario.Context}" Value="YearPlanScenarioContext.LongTermAssetPlan" />
					<Assign Name="SetPercentage" Property="${YearPlanScenario.IndexPercentage}" Value="#{Company.IndexLongTermAssetPercentage}" />
				</When>

				<Otherwise Name="VvPlanner">
					<Assign Name="SetContext" Property="${YearPlanScenario.Context}" Value="YearPlanScenarioContext.Standard" />
					<Assign Name="SetPercentage" Property="${YearPlanScenario.IndexPercentage}" Value="#{Company.IndexReplacementPlanning}" />
				</Otherwise>
			</Choose>
		</Transaction>

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