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

ActionField397

Beschrijving: Change status of DepreciationMethod to Active. Custom: Nee

Propertiesbewerken

Property Type Accessor
DepreciationMethod DepreciationMethod Root

XMLbewerken

<Workflow Name="ActionField397" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Change status of DepreciationMethod to Active.</Description>
	<Properties>
		<Property	Name="DepreciationMethod"									Type="DepreciationMethod"	Accessor="Root"		Direction="In" />

		<Property	Name="DepreciationActiveResult"								Type="RequestResult"		Accessor="Internal"						Default="Yes" />
		<Property	Name="EquipmentCount"										Type="Int64"				Accessor="Internal" />
		<Property	Name="EquipmentsWithStartDateIsNotFirstDayOfMonth"			Type="QueryResult"			Accessor="Internal" />
		<Property	Name="FirstDayOfMonthAnswer"								Type="RequestResult"		Accessor="Internal" />
		<Property	Name="ProcessFunctionsWithStartDateIsNotFirstDayOfMonth"	Type="QueryResult"			Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetCount Name="Filter equipments" Type="Equipment" OutputProperty="${EquipmentCount}">
				<Filters>
					<PropertyFilter	PropertyName="DepreciationMethodTax"	Operator="="		PropertyValue="${DepreciationMethod}" />
				</Filters>
			</GetCount>
		</Transaction>

		<When Name="EquipmentsNotZero » EquipmentAvailable" Condition="${EquipmentCount} != 0">
			<Question Name="DepreciationDeactive" Type="YesNo" MessageCode="0803" Default="Yes" OutputProperty="${DepreciationActiveResult}">
				<Parameter	Name="DepreciationMethod"	Direction="In"		Value="${DepreciationMethod}" />
			</Question>
		</When>

		<When Name="DepreciationAnswer » Answer is no" Condition="${DepreciationActiveResult} != Yes">
			<Stop Name="Stop" Mode="Abort" />
		</When>

		<Transaction>
			<Query Name="GetEquipmentsWithStartDateIsNotFirstDayOfMonth" Type="Equipment" OrderBy="Id" OrderDirection="Ascending" Top="5" OutputProperty="${EquipmentsWithStartDateIsNotFirstDayOfMonth}">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationMethodTax"	Operator="="		PropertyValue="${DepreciationMethod}" />
						<DatePartFilter PropertyName="DepreciationStartDate" Operator="!=" PropertyValue="1" DatePart="Day" />
					</CombinedFilter>
				</Filters>
				<Properties>
					<Property Name="Id" Alias="Id" Type="Property" />
					<Property Name="Context" Alias="Context" Type="Property" />
				</Properties>
			</Query>

			<Query Name="GetProcessFunctionsWithStartDateIsNotFirstDayOfMonth" Type="ProcessFunction" OrderBy="Id" OrderDirection="Ascending" Top="5" OutputProperty="${ProcessFunctionsWithStartDateIsNotFirstDayOfMonth}">
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationMethodTax"	Operator="="		PropertyValue="${DepreciationMethod}" />
						<DatePartFilter PropertyName="DepreciationStartDate" Operator="!=" PropertyValue="1" DatePart="Day" />
					</CombinedFilter>
				</Filters>
				<Properties>
					<Property Name="Id" Alias="Id" Type="Property" />
					<Property Name="Context" Alias="Context" Type="Property" />
				</Properties>
			</Query>
		</Transaction>

		<When Name="AskQuestion?" Condition="${EquipmentsWithStartDateIsNotFirstDayOfMonth.Count} != 0 || ${ProcessFunctionsWithStartDateIsNotFirstDayOfMonth.Count} != 0">
			<Question Name="AskFirstDayOfMonth" Type="YesNo" MessageCode="1598" OutputProperty="${FirstDayOfMonthAnswer}">
				<Parameter	Name="EquipmentsWithStartDateIsNotFirstDayOfMonth"			Direction="In"		Value="${EquipmentsWithStartDateIsNotFirstDayOfMonth}" />
				<Parameter	Name="ProcessFunctionsWithStartDateIsNotFirstDayOfMonth"	Direction="In"		Value="${ProcessFunctionsWithStartDateIsNotFirstDayOfMonth}" />
			</Question>

			<When Name="FirstDayOfMonthAnswerNo » DoNotChangeStartDate" Condition="${FirstDayOfMonthAnswer} != Yes">
				<Stop Name="Stop" Mode="Abort" />
			</When>
		</When>

		<Transaction>
			<ChangeStatus Name="DepreciationMethod" DomainObject="${DepreciationMethod}" NewStatus="DepreciationMethodStatus.Active" />
		</Transaction>

		<Message Name="Message0912" MessageCode="0912">
			<Parameter	Name="DepreciationMethod"	Direction="In"		Value="${DepreciationMethod}" />
		</Message>

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