<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="24" zv="Cache for Windows (x86-64) 2010.1 (Build 413U)" ts="2011-06-26 16:35:18">
<Class name="Alliance.Common.KAL.Code.MessageSenderType">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61836,29400.968</TimeChanged>
<TimeCreated>61802,59061.765</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<Parameter name="Alliance">
<Default>100</Default>
</Parameter>

<Parameter name="AgrisM">
<Default>200</Default>
</Parameter>

<Parameter name="AgrisMExtranet">
<Default>250</Default>
</Parameter>

<Parameter name="AgrisL">
<Default>300</Default>
</Parameter>

<Parameter name="AgrisLExtranet">
<Default>350</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//	=====	Class Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Instance Creation	---------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Common.KAL.Code.MessageSenderType).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	do ..new(..#Alliance, "Alliance",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisM, "AgrisM",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisMExtranet, "AgrisM Extranet",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisL, "AgrisL",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisLExtranet, "AgrisL Extranet",,, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="Alliance">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#Alliance)
]]></Implementation>
</Method>

<Method name="AgrisM">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisM)
]]></Implementation>
</Method>

<Method name="AgrisMExtranet">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisMExtranet)
]]></Implementation>
</Method>

<Method name="AgrisL">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisL)
]]></Implementation>
</Method>

<Method name="AgrisLExtranet">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisLExtranet)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	=====	Instance Methods	===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Inquiring		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isAlliance">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#Alliance)
]]></Implementation>
</Method>

<Method name="isAgrisM">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisM)
]]></Implementation>
</Method>

<Method name="isAgrisMExtranet">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisMExtranet)
]]></Implementation>
</Method>

<Method name="isAgrisL">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisL)
]]></Implementation>
</Method>

<Method name="isAgrisLExtranet">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisLExtranet)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.Code.MessageSeverity">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61817,39207</TimeChanged>
<TimeCreated>61815,55392.828</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Common.KAL.Code.MessageSeverity).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	set type = ..new("100", "Info",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("200", "Warning",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("300", "Error",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("400", "Fatal",,, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="Info">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSeverity</ReturnType>
<Implementation><![CDATA[	quit ..get("100")
]]></Implementation>
</Method>

<Method name="Warning">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSeverity</ReturnType>
<Implementation><![CDATA[	quit ..get("200")
]]></Implementation>
</Method>

<Method name="Error">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSeverity</ReturnType>
<Implementation><![CDATA[	quit ..get("300")
]]></Implementation>
</Method>

<Method name="Fatal">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSeverity</ReturnType>
<Implementation><![CDATA[	quit ..get("400")
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Methods	-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isInfo">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "100")
]]></Implementation>
</Method>

<Method name="isWarning">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "200")
]]></Implementation>
</Method>

<Method name="isError">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "300")
]]></Implementation>
</Method>

<Method name="isFatal">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "400")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.Code.MessageSubType">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61836,30761.046</TimeChanged>
<TimeCreated>61802,59244.406</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Common.KAL.Code.MessageSubType).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	//	Lieferung

	do ..new("100", "Lieferant hat Angebot erfasst","Ein Lieferant hat ein Angebot abgegeben",, .status)
	quit:($$$ISERR(status)) status

	do ..new("200", "Bestellung von COOP in Alliance angekommen","Eine Bestellung von Coop ist in Alliance eingetroffen",, .status)
	quit:($$$ISERR(status)) status

	do ..new("250", "Bestellung von COOP in AgrisM angekommen","Eine Bestellung von Coop ist in AgrisM eingetroffen",, .status)
	quit:($$$ISERR(status)) status

	do ..new("300", "Bestellung in AgrisM gesplittet","Die Bestellung wurde in AgrisM in Teilbestellungen aufgeteilt",, .status)
	quit:($$$ISERR(status)) status

	do ..new("400", "Lieferant hat prov. Teilbestellung erhalten","Lieferant hat eine provisorische Teilbestellung erhalten",, .status)
	quit:($$$ISERR(status)) status

	do ..new("500", "Lieferant hat prov. Liefermengen erfasst","Lieferant hat die provisorische Liefermenge erfasst",, .status)
	quit:($$$ISERR(status)) status

	do ..new("600", "Definitive Teilbestellung in Agris erfasst","In AgrisM wurden die definitiven Teilbestellungen berechnet",, .status)
	quit:($$$ISERR(status)) status

	do ..new("700", "Lieferant hat def. Teilbestellung erhalten","Lieferant hat eine definitive Teilbestellung erhalten",, .status)
	quit:($$$ISERR(status)) status

	do ..new("800", "Lieferant hat def. Liefermengen bestätigt","Ein Lieferant hat eine definitive Teilbestellung bestätigt",, .status)
	quit:($$$ISERR(status)) status

	//	Despatch Advice

	do ..new("900", "Despatch Advice in AgrisM erstellt","In AgrisM ist der Despatch Advice erstellt worden",, .status)
	quit:($$$ISERR(status)) status

	do ..new("930", "Despatch Advice in Alliance angekommen","Der Despatch Advice ist in Alliance angekommen",, .status)
	quit:($$$ISERR(status)) status

	do ..new("960", "Despatch Advice an COOP gesendet","Der Despatch Advice wurde durch Alliance an COOP gesendet",, .status)
	quit:($$$ISERR(status)) status

	//	Invoice

	do ..new("1000", "Invoice in Agris erstellt","In AgrisM ist die Invoice erstellt worden",, .status)
	quit:($$$ISERR(status)) status

	do ..new("1030", "Invoice in Alliance angekommen","Die Invoice ist in Alliance angekommen",, .status)
	quit:($$$ISERR(status)) status

	do ..new("1060", "Invoice an COOP gesendet","Die Invoice wurde durch Alliance an COOP gesendet",, .status)
	quit:($$$ISERR(status)) status

	do ..new("9999", "Information","Information",, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="AngebotErfasst">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("100")
]]></Implementation>
</Method>

<Method name="BestellungInAllianceAngekommen">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("200")
]]></Implementation>
</Method>

<Method name="BestellungInAgrisAngekommen">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("250")
]]></Implementation>
</Method>

<Method name="BestellungGesplittet">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("300")
]]></Implementation>
</Method>

<Method name="ProvTeilbestellungErhalten">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("400")
]]></Implementation>
</Method>

<Method name="ProvLiefermengenErfasst">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("500")
]]></Implementation>
</Method>

<Method name="DefinTeilbestellungErfasst">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("600")
]]></Implementation>
</Method>

<Method name="DefinTeilbestellungErhalten">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("700")
]]></Implementation>
</Method>

<Method name="DefinLiefermengenBestätigt">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("800")
]]></Implementation>
</Method>

<Method name="DespatchAdviceErstellt">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("900")
]]></Implementation>
</Method>

<Method name="DespatchAdviceInAllianceAngek">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("930")
]]></Implementation>
</Method>

<Method name="DespatchAdviceAnCoopGesendet">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("960")
]]></Implementation>
</Method>

<Method name="InvoiceErstellt">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("1000")
]]></Implementation>
</Method>

<Method name="InvoiceInAllianceAngekommen">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("1030")
]]></Implementation>
</Method>

<Method name="InvoiceAnCoopGesendet">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("1060")
]]></Implementation>
</Method>

<Method name="Information">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ..get("9999")
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Methods	-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isAngebotErfasst">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "100")
]]></Implementation>
</Method>

<Method name="isBestellungInAllianceAngek">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "200")
]]></Implementation>
</Method>

<Method name="isBestellungInAgrisAngekommen">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "250")
]]></Implementation>
</Method>

<Method name="isBestellungGesplittet">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "300")
]]></Implementation>
</Method>

<Method name="isProvTeilbestellungErhalten">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "400")
]]></Implementation>
</Method>

<Method name="isProvLiefermengenErfasst">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "500")
]]></Implementation>
</Method>

<Method name="isDefinTeilbestellungErfasst">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "600")
]]></Implementation>
</Method>

<Method name="isDefinTeilbestellungErhalten">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "700")
]]></Implementation>
</Method>

<Method name="isDefinLiefermengenBestätigt">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "800")
]]></Implementation>
</Method>

<Method name="isDespatchAdviceErstellt">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "900")
]]></Implementation>
</Method>

<Method name="isDespatchAdviceInAllianceAngek">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "930")
]]></Implementation>
</Method>

<Method name="isDespatchAdviceAnCoopGesendet">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "960")
]]></Implementation>
</Method>

<Method name="isInvoiceErstellt">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "1000")
]]></Implementation>
</Method>

<Method name="isInvoiceInAllianceAngekommen">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "1030")
]]></Implementation>
</Method>

<Method name="isInvoiceAnCoopGesendet">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "1060")
]]></Implementation>
</Method>

<Method name="isInformation">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "9999")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.Code.MessageType">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61828,44543.468</TimeChanged>
<TimeCreated>61802,59140.156</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Common.KAL.Code.MessageType).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	set type = ..new("100", "Lieferung",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("200", "Despatch Advice",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("300", "Invoice",,, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="Lieferung">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageType</ReturnType>
<Implementation><![CDATA[	quit ..get("100")
]]></Implementation>
</Method>

<Method name="DespatchAdvice">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageType</ReturnType>
<Implementation><![CDATA[	quit ..get("200")
]]></Implementation>
</Method>

<Method name="Invoice">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.MessageType</ReturnType>
<Implementation><![CDATA[	quit ..get("300")
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Methods	-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isLieferung">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "100")
]]></Implementation>
</Method>

<Method name="isDespatchAdvice">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "200")
]]></Implementation>
</Method>

<Method name="isInvoice">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "300")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.Code.SystemType">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61836,29261.25</TimeChanged>
<TimeCreated>61823,30845.515</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<Parameter name="Alliance">
<Default>100</Default>
</Parameter>

<Parameter name="AgrisM">
<Default>200</Default>
</Parameter>

<Parameter name="AgrisL">
<Default>300</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//	=====	Class Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Instance Creation	---------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Common.KAL.Code.SystemType).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	do ..new(..#Alliance, "Alliance",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisM, "AgrisM",,, .status)
	quit:($$$ISERR(status)) status

	do ..new(..#AgrisL, "AgrisL",,, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="Alliance">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.SystemType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#Alliance)
]]></Implementation>
</Method>

<Method name="AgrisM">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.SystemType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisM)
]]></Implementation>
</Method>

<Method name="AgrisL">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Common.KAL.Code.SystemType</ReturnType>
<Implementation><![CDATA[	quit ..get(..#AgrisL)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	=====	Instance Methods	===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Inquiring		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isAlliance">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#Alliance)
]]></Implementation>
</Method>

<Method name="isAgrisM">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisM)
]]></Implementation>
</Method>

<Method name="isAgrisL">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = ..#AgrisL)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.CommunicationParams">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61828,56233.765</TimeChanged>
<TimeCreated>61817,50901.359</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Properties			===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Queries				===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Class Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Instance Creation	---------------------------------------

]]></Content>
</UDLText>

<Method name="setAllParameters">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String,type:%String,name:%String,serverURL:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = ..setClientId(id)
	quit:($$$ISERR(status)) status

	set status = ..setClientType(type)
	quit:($$$ISERR(status)) status

	set status = ..setClientName(name)
	quit:($$$ISERR(status)) status

	set status = ..setServerURL(serverURL)
	quit:($$$ISERR(status)) status
	
	quit status
]]></Implementation>
</Method>

<Method name="setClientId">
<ClassMethod>1</ClassMethod>
<FormalSpec>value</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK
	do ..new("ClientId", value, "The unique ID of this client instance",, .status)
	quit status
]]></Implementation>
</Method>

<Method name="setClientType">
<ClassMethod>1</ClassMethod>
<FormalSpec>value</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK
	do ..new("ClientType", value, "The client type",, .status)
	quit status
]]></Implementation>
</Method>

<Method name="setClientName">
<ClassMethod>1</ClassMethod>
<FormalSpec>value</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK
	do ..new("ClientName", value, "The name of this client instance",, .status)
	quit status
]]></Implementation>
</Method>

<Method name="setServerURL">
<ClassMethod>1</ClassMethod>
<FormalSpec>value</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK
	do ..new("ServerURL", value, "The URL of the server, used for sending KAL messages to",, .status)
	quit status
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<Method name="getClientId">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit ..get("ClientId").value
]]></Implementation>
</Method>

<Method name="getClientType">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit ..get("ClientType").value
]]></Implementation>
</Method>

<Method name="getClientName">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit ..get("ClientName").value
]]></Implementation>
</Method>

<Method name="getServerURL">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit ..get("ServerURL").value
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	=====	Instance Methods	===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Inquiring		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Business Logic	-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Support			-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	===========================================================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Private Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<Method name="test">
<Description>
write ##class(Alliance.Common.KAL.CommunicationParams).test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[	quit ..setAllParameters("42", "Human", "Lemberger", "www.apple.com")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.KeepAliveTask">
<Description>
This Task is used by the Keep-Alive framework and is supposed to
trigger the system to send notifications to the central Alliance
server.
</Description>
<Super>%SYS.Task.Definition</Super>
<TimeChanged>61817,48165.359</TimeChanged>
<TimeCreated>61751,40709.299918</TimeCreated>

<Property name="WaitTime">
<Type>%Integer</Type>
</Property>

<Property name="Iterations">
<Description>
How many transmissions should be triggered upon calling this task?</Description>
<Type>%Integer</Type>
</Property>

<Method name="OnTask">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK
	
	for i=1:1:..Iterations
	{
		set status = ##class(Alliance.Common.KAL.WSClientMessageSender).sendUnprocessedMessages()

		//	Avoid hang on last iteration:
		quit:(i = ..Iterations)

		// Wait as requested:
		hang ..WaitTime
	}

	//	Always return OK, otherwise the taks breaks and stops when an error occurs.
	quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.Message">
<Description>
	Instances of this class are used to announce activities of different external systems to the central alliance system.

		Last change: 13.04.2010 by Lem
</Description>
<Super>%Persistent,%XML.Adaptor,Base.Support</Super>
<TimeChanged>62031,34922.079124</TimeChanged>
<TimeCreated>61790,63990.89</TimeCreated>
<Inheritance>right</Inheritance>

<UDLText name="T">
<Content><![CDATA[
//	-----	Parameters			-----------------------------------------------

]]></Content>
</UDLText>

<Parameter name="ToStringDelimiter">
<Default>:</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//	-----	Properties			-----------------------------------------------

]]></Content>
</UDLText>

<Property name="typKey">
<Description>
	Message Type: key and value of KAL.Code.MessageType</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="typValue">
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="subTypKey">
<Description>
	Message SubType: key and value of KAL.Code.MessageSubType</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="subTypValue">
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="senderTypKey">
<Description>
	Sender Type: key and value of KAL.Code.MessageSenderType</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="senderTypValue">
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="severityKey">
<Description>
	Message Severity: key and value of KAL.Code.MessageSeverity</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="severityValue">
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="datum">
<Type>%Date</Type>
<Required>1</Required>
</Property>

<Property name="clientId">
<Description>
	Id of sending system (taken from Alliance.Common.KAL.CommunicationParams (clientId))</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="clientName">
<Description>
	Name of sending system (taken from Alliance.Common.KAL.CommunicationParams (clientName))</Description>
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="30"/>
</Property>

<Property name="vzId">
<Type>%Integer</Type>
</Property>

<Property name="vzName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="vzOrt">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="lieferantId">
<Type>%Integer</Type>
</Property>

<Property name="lieferantName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="lieferantOrt">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="bestellId">
<Type>%Integer</Type>
</Property>

<Property name="bestellNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="additionalText">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
</Property>

<Property name="isProcessed">
<Type>%Boolean</Type>
<InitialExpression>$$$NO</InitialExpression>
<Required>1</Required>
</Property>

<Property name="timeStampCreated">
<Type>%TimeStamp</Type>
<InitialExpression>$zdatetime($zutil(188),3, 1, 6)</InitialExpression>
<Required>1</Required>
</Property>

<Property name="timeStampTransmitted">
<Type>%TimeStamp</Type>
</Property>

<UDLText name="T">
<Content><![CDATA[
//	-----	SQL Queries			-----------------------------------------------

]]></Content>
</UDLText>

<Query name="unprocessedMessages">
<Type>%SQLQuery</Type>
<SqlQuery>	select	ID
	from	Alliance_Common_KAL.Message
	where	isProcessed = 0
	order by timeStampCreated</SqlQuery>
</Query>

<Query name="processedMessagesDesc">
<Type>%SQLQuery</Type>
<SqlQuery>	select	ID
	from	Alliance_Common_KAL.Message
	where	isProcessed = 1
	order by timeStampCreated desc</SqlQuery>
</Query>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="new">
<Description>
Create a new message and make it available for KAL-processing</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&status:%Status,typ:Alliance.Common.KAL.Code.MessageType,subTyp:Alliance.Common.KAL.Code.MessageSubType,senderTyp:Alliance.Common.KAL.Code.MessageSenderType,severity:Alliance.Common.KAL.Code.MessageSeverity,datum:%Date,vzId:%String="",lieferantId:%String="",bestellId:%String="",additionalText:%String=""]]></FormalSpec>
<ReturnType>Alliance.Common.KAL.Message</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK

	set message = ..%New()

	if (typ = $$$NULLOREF)
	{
		set status = $$$ERROR("Ungültiger Typ")
		quit $$$NULLOREF
	}
	set message.typKey = typ.key
	set message.typValue = typ.value

	if (subTyp = $$$NULLOREF)
	{
		set status = $$$ERROR("Ungültiger SubTyp")
		quit $$$NULLOREF
	}
	set message.subTypKey = subTyp.key
	set message.subTypValue = subTyp.value

	if (senderTyp = $$$NULLOREF)
	{
		set status = $$$ERROR("Ungültiger SenderTyp")
		quit $$$NULLOREF
	}
	set message.senderTypKey = senderTyp.key
	set message.senderTypValue = senderTyp.value

	if (severity = $$$NULLOREF)
	{
		set status = $$$ERROR("Ungültige Severity")
		quit $$$NULLOREF
	}
	set message.severityKey = severity.key
	set message.severityValue = severity.value

	set message.clientId = ##class(Alliance.Common.KAL.CommunicationParams).getClientId()
	set message.clientName = ##class(Alliance.Common.KAL.CommunicationParams).getClientName()

	set message.datum = datum
	set message.additionalText = additionalText

	//
	//	vzId is optional: if it is a number, interpret it as a VZ-Nr. Otherwise treat it as the vzName:
	if ($inumber(vzId, "", "") = "")
	{
		set message.vzName = vzId
	}
	else
	{
		set vz = ##class(DBDebiKredi.Debitor).%OpenId(vzId)
		if (vz = $$$NULLOREF)
			{
				set status = $$$ERROR("Ungültiges VZ mit Nr. " _ vzId)
				quit $$$NULLOREF
			}
		set message.vzId = vzId
		set message.vzName = vz.Adresse.Name
		set message.vzOrt = vz.Adresse.Ort
	}

	//	lieferantId is optional: if it is a number, interpret it as a lieferant-Nr. Otherwise treat it as the lieferantName:
	if ($inumber(lieferantId, "", "") = "")
	{
		set message.lieferantName = lieferantId
	}
	else
	{
		set lieferant = ##class(DBDebiKredi.Kreditor).%OpenId(lieferantId)
		if (lieferant = $$$NULLOREF)
		{
			set status = $$$ERROR("Ungültiger Lieferant mit Nr. " _ lieferantId)
			quit $$$NULLOREF
		}
		set message.lieferantId = lieferantId
		set message.lieferantName = lieferant.Adresse.Name
		set message.lieferantOrt = lieferant.Adresse.Ort
	}

	//	bestellId is optional: if it is a number, interpret it as a bestell-Id. Otherwise treat it as the bestellNr:
	//	(I expect bestellNr to be numerical. So to treat bestellId as a bestellNr, enclose it in single or double quotes)
	if ($inumber(bestellId, "", "") = "")
	{
		set message.bestellNr = $translate(bestellId, """'", "")
	}
	else
	{
		set bestellung = ##class(DBPlattform.BestKopf).%OpenId(bestellId)
		if (bestellung = $$$NULLOREF)
		{
			set status = $$$ERROR("Ungültige Bestellung mit Nr. " _ bestellId)
			quit $$$NULLOREF
		}
		set message.bestellId = bestellId
		set message.bestellNr = bestellung.BestellNr
	}

	//
	set status = message.%Save()
	if ($$$ISERR(status))		quit $$$NULLOREF

	quit message
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<Method name="getTyp">
<ReturnType>Alliance.Common.KAL.Code.MessageType</ReturnType>
<Implementation><![CDATA[	quit ##class(Alliance.Common.KAL.Code.MessageType).get(..typKey)
]]></Implementation>
</Method>

<Method name="getSubTyp">
<ReturnType>Alliance.Common.KAL.Code.MessageSubType</ReturnType>
<Implementation><![CDATA[	quit ##class(Alliance.Common.KAL.Code.MessageSubType).get(..subTypKey)
]]></Implementation>
</Method>

<Method name="getSenderTyp">
<ReturnType>Alliance.Common.KAL.Code.MessageSenderType</ReturnType>
<Implementation><![CDATA[	quit ##class(Alliance.Common.KAL.Code.MessageSenderType).get(..senderTypKey)
]]></Implementation>
</Method>

<Method name="getSeverity">
<ReturnType>Alliance.Common.KAL.Code.MessageSeverity</ReturnType>
<Implementation><![CDATA[	quit ##class(Alliance.Common.KAL.Code.MessageSeverity).get(..severityKey)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Support				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="toString">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	quit "[KALMessage" _ ..#ToStringDelimiter _
			..isProcessed _ ..#ToStringDelimiter _
			..typValue _ ..#ToStringDelimiter _
			..subTypValue _ ..#ToStringDelimiter _
			..senderTypValue _ ..#ToStringDelimiter _
			..severityValue _ ..#ToStringDelimiter _
			..datum _ ..#ToStringDelimiter _
			..clientName _ ..#ToStringDelimiter _
			..vzName _ ..#ToStringDelimiter _
			..lieferantName _ ..#ToStringDelimiter _
			..bestellNr _ ..#ToStringDelimiter _
			..additionalText _ ..#ToStringDelimiter _
			..timeStampCreated _
		"]"
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Test				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="test">
<Description>
	do ##class(Alliance.Common.KAL.Message).test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	do ..%DeleteExtent()

	set status = $$$OK

	set typ = ##class(Alliance.Common.KAL.Code.MessageType).Lieferung()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).AngebotErfasst()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).AgrisMExtranet()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5, 3, 50, "Zusätzlicher Text")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5, 3, 50)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5, 3)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5,, 50)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, "VZName", "LieferantName", "BestellNr", "Zusätzlicher Text")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, "VZName", "LieferantName", "BestellNr")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, "VZName", "LieferantName")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, "VZName",, "BestellNr")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, "VZName")
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH)
	do message.write()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH,,, "'1234567890'")
	do message.write()

	write !, "Done"
]]></Implementation>
</Method>

<Method name="DefinTeilbestellungErfasst">
<Description>
	do ##class(Alliance.Common.KAL.Message).DefinTeilbestellungErfasst()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = $$$OK

	set typ = ##class(Alliance.Common.KAL.Code.MessageType).Lieferung()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).DefinTeilbestellungErfasst()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).AgrisM()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()
	set bestellId = "Alliance||40"

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH, 5, 3, 50, bestellId)
	do message.write()

	write !, "Done"
]]></Implementation>
</Method>

<Method name="BestellungInAllianceAngekommen">
<Description>
	do ##class(Alliance.Common.KAL.Message).BestellungInAllianceAngekommen()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = $$$OK

	set typ = ##class(Alliance.Common.KAL.Code.MessageType).Lieferung()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).BestellungInAllianceAngekommen()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).Alliance()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH,,,, "Additional Text")
	do message.write()

	write !, "Done"
]]></Implementation>
</Method>

<Method name="DespatchAdviceErstellt">
<Description>
	do ##class(Alliance.Common.KAL.Message).DespatchAdviceErstellt()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = $$$OK

	set typ = ##class(Alliance.Common.KAL.Code.MessageType).DespatchAdvice()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).DespatchAdviceErstellt()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).AgrisM()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ..new(.status, typ, subTyp, senderTyp, severity, todayH,,,, "AgrisM||12")
	do message.write()

	write !, "Done"
]]></Implementation>
</Method>

<Method name="Information">
<Description>
	do ##class(Alliance.Common.KAL.Message).Information("Test")</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String</FormalSpec>
<Implementation><![CDATA[
	set typ = ##class(Alliance.Common.KAL.Code.MessageType).DespatchAdvice()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).Information()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).AgrisM()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Warning()
	set todayH = ##class(Base.DateTime).today().toHorolog()
	set message = ##class(Alliance.Common.KAL.Message).new(.status, typ, subTyp, senderTyp, severity, todayH,,,, id)

	write status
	do message.write()
]]></Implementation>
</Method>

<Query name="processAllFields">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT TOP 200 %ID,isProcessed, severityValue, timeStampCreated, senderTypValue, typValue,
       subTypValue, lieferantName, lieferantOrt, vzName, vzOrt, datum, bestellNr, additionalText
FROM Message
ORDER BY timeStampCreated DESC</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<DataLocation>^Alliance.Common.KAL.MessageD</DataLocation>
<DefaultData>MessageDefaultData</DefaultData>
<IdLocation>^Alliance.Common.KAL.MessageD</IdLocation>
<IndexLocation>^Alliance.Common.KAL.MessageI</IndexLocation>
<State>MessageState</State>
<StreamLocation>^Alliance.Common.KAL.MessageS</StreamLocation>
<Data name="MessageDefaultData">
<Structure>listnode</Structure>
<Subscript>"1"</Subscript>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>subTyp</Value>
</Value>
<Value name="3">
<Value>processed</Value>
</Value>
<Value name="4">
<Value>isProcessed</Value>
</Value>
<Value name="5">
<Value>timeStamp</Value>
</Value>
<Value name="6">
<Value>senderId</Value>
</Value>
<Value name="7">
<Value>senderName</Value>
</Value>
<Value name="8">
<Value>typKey</Value>
</Value>
<Value name="9">
<Value>subTypKey</Value>
</Value>
<Value name="10">
<Value>senderKey</Value>
</Value>
<Value name="11">
<Value>senderTypKey</Value>
</Value>
<Value name="12">
<Value>timeStampCreated</Value>
</Value>
<Value name="13">
<Value>timeStampReceived</Value>
</Value>
<Value name="14">
<Value>timeStampTransmitted</Value>
</Value>
<Value name="15">
<Value>datum</Value>
</Value>
<Value name="16">
<Value>typValue</Value>
</Value>
<Value name="17">
<Value>subTypValue</Value>
</Value>
<Value name="18">
<Value>senderTypValue</Value>
</Value>
<Value name="19">
<Value>severityKey</Value>
</Value>
<Value name="20">
<Value>severityValue</Value>
</Value>
<Value name="21">
<Value>textMessage</Value>
</Value>
<Value name="22">
<Value>additionalText</Value>
</Value>
<Value name="23">
<Value>clientId</Value>
</Value>
<Value name="24">
<Value>clientName</Value>
</Value>
</Data>
<Data name="MessageState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>typ</Value>
</Value>
<Value name="2">
<Value>sender</Value>
</Value>
<Value name="3">
<Value>bestellId</Value>
</Value>
<Value name="4">
<Value>bestellNr</Value>
</Value>
<Value name="5">
<Value>lieferantId</Value>
</Value>
<Value name="6">
<Value>lieferantName</Value>
</Value>
<Value name="7">
<Value>lieferantOrt</Value>
</Value>
<Value name="8">
<Value>vzId</Value>
</Value>
<Value name="9">
<Value>vzName</Value>
</Value>
<Value name="10">
<Value>vzOrt</Value>
</Value>
<Value name="11">
<Value>bestellDatum</Value>
</Value>
<Value name="12">
<Value>timestamp</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.MessagesUnprocessed">
<Description>
	Instances of this class are used to collect the unprocessed messages and send them to the central alliance system.

		Last change: 17.03.2010 by Lem
</Description>
<Super>%RegisteredObject,%XML.Adaptor</Super>
<TimeChanged>61828,56647.375</TimeChanged>
<TimeCreated>61796,44578.859</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="senderId">
<Type>%String</Type>
<Parameter name="MAXLEN" value="10"/>
</Property>

<Property name="messages">
<Type>Alliance.Common.KAL.Message</Type>
<Collection>list</Collection>
</Property>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<Method name="new">
<Description>
Create a new messagesUnprocessed object and make it available for KAL-processing</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&status:%Status]]></FormalSpec>
<ReturnType>Alliance.Common.KAL.MessagesUnprocessed</ReturnType>
<Implementation><![CDATA[
	set messages = ..%New()
	set messages.senderId = ##class(Alliance.Common.KAL.CommunicationParams).getClientId()

	set resultSet = ##class(%ResultSet).%New("Alliance.Common.KAL.Message:unprocessedMessages")
	set status = resultSet.Execute()
	while (resultSet.Next())
	{
		set messageId = $get(resultSet.Data("ID"))
		set message = ##class(Alliance.Common.KAL.Message).%OpenId(messageId)
		if (message = $$$NULLOREF)
		{
			set status = $$$ERROR("Could not load message with ID=" _ messageId)
			quit
		}

		do messages.messages.Insert(message)
	}

	quit messages
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Processing			-----------------------------------------------

]]></Content>
</UDLText>

<Method name="markAsProcessed">
<Description>
Mark all my messages as being processed</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK

	set hasTX = $$$NO
	set doRollback = $$$NO

	try
	{
		&sql(
			START TRANSACTION
				%COMMITMODE EXPLICIT
				ISOLATION LEVEL READ COMMITTED
		)
		set hasTX = $$$YES

		for i=1:1:..messages.Count()
		{
			set message = ..messages.GetAt(i)
			set message.timeStampTransmitted = $zdatetime($zutil(188),3, 1, 6)
			set message.isProcessed = $$$YES
			set status = message.%Save()
		}
	}
	catch (error)
	{
		set doRollback = $$$YES
	}

	if ($$$ISERR(status))		set doRollback = $$$YES

	if ((hasTX = $$$YES) && ($TLevel > 0))
	{
		if (doRollback = $$$YES)
		{
			&sql(ROLLBACK)
		}
		else
		{
			&sql(COMMIT)
		}
	}

	quit status
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Support				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="toString">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set string = "[KALUnprocessedMessages:" _ ..senderId

	for i=1:1:..messages.Count()
	{
		set string = string _ ##class(Base.String).crLf() _ ##class(Base.String).space(4) _ ..messages.GetAt(i).toString()
	}

	set string = string _ ##class(Base.String).crLf() _ "]"

	quit string
]]></Implementation>
</Method>

<Method name="write">
<Implementation><![CDATA[	write !, ..toString()
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Test				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="test">
<Description>
	do ##class(Alliance.Common.KAL.MessagesUnprocessed).test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = $$$OK

	do ##class(Alliance.Common.KAL.Message).test()

	set messages = ..new(.status)
	do messages.write()
	do messages.markAsProcessed()
	do messages.write()
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CoF67.MessagesUnp1E00D</DataLocation>
<DefaultData>MessagesUnprocessedDefaultData</DefaultData>
<IdLocation>^Alliance.CoF67.MessagesUnp1E00D</IdLocation>
<IndexLocation>^Alliance.CoF67.MessagesUnp1E00I</IndexLocation>
<StreamLocation>^Alliance.CoF67.MessagesUnp1E00S</StreamLocation>
<Data name="MessagesUnprocessedDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ClientID</Value>
</Value>
<Value name="3">
<Value>Messages</Value>
</Value>
<Value name="4">
<Value>clientID</Value>
</Value>
<Value name="5">
<Value>messages</Value>
</Value>
<Value name="6">
<Value>isProcessed</Value>
</Value>
<Value name="7">
<Value>timeStamp</Value>
</Value>
<Value name="8">
<Value>senderId</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.KAL.WSClientMessageSender">
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61828,56657.859</TimeChanged>
<TimeCreated>61748,52243.308916</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://localhost:1980/Alliance.Ens.Service.KALPickupService.cls</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/kal/1.0</Default>
</Parameter>

<Parameter name="OUTPUTTYPEATTRIBUTE">
<Description>
Use xsi:type attribute for literal types.</Description>
<Default>1</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>KALPickupService</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//	Send the unprocessed messages to the WebServer

]]></Content>
</UDLText>

<Method name="sendMessages">
<Final>1</Final>
<FormalSpec>messages:Alliance.Common.KAL.MessagesUnprocessed</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%xsd.base64Binary</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[	quit ..WebMethod("sendMessages").Invoke(##this, ..#NAMESPACE _ "/Alliance.Ens.Service.KALPickupService.receiveMessages", .messages)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Processing			-----------------------------------------------

]]></Content>
</UDLText>

<Method name="sendUnprocessedMessages">
<Description>
	Send all unprocessed messages. On success, mark all of these messages as "processed"
		write ##class(Alliance.Common.KAL.ServerClient).sendUnprocessedMessages()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK

	set messages = ##class(Alliance.Common.KAL.MessagesUnprocessed).new(.status)
	if ($$$ISERR(status))		quit status

	try
	{
		set webClient = ..%New()
		set webClient.Location = ##class(Alliance.Common.KAL.CommunicationParams).getServerURL()

		set status = webClient.sendMessages(messages)
	}
	catch ex
	{
		set status = $$$ERROR("Exception caught in KAL.KeepAliveTask: " _ ex.Name)
	}

	//	If an error occurred, don't mark messages as processed!
	if ($$$ISERR(status))		quit status

	quit messages.markAsProcessed()
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Common.KAL.WSClientMessageSender.sendMessages">
<Description>
This class is generated by the Alliance.Common.KAL.WSClientMessageSender Web Service Client class.
This class should not be edited or modified in any way.</Description>
<Import>Alliance.Common.KAL</Import>
<IncludeCode>%occInclude,%soap</IncludeCode>
<ProcedureBlock>0</ProcedureBlock>
<Super>%SOAP.ProxyDescriptor</Super>
<TimeChanged>62033,60861.562855</TimeChanged>
<TimeCreated>62033,60861.560054</TimeCreated>
<GeneratedBy>Alliance.Common.KAL.WSClientMessageSender.CLS</GeneratedBy>

<Method name="Invoke">
<FormalSpec>%Client,%Action,messages:Alliance.Common.KAL.MessagesUnprocessed</FormalSpec>
<ReturnType>%xsd.base64Binary</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
 Set ..messages=$get(messages)
 Do %Client.InvokeClient($this,"sendMessages",%Action)
 Quit ..%Result
]]></Implementation>
</Method>

<Method name="Reset">
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[ Quit
]]></Implementation>
</Method>

<Parameter name="NAMESPACE">
<Default>http://www.alliance.ch/kal/1.0</Default>
</Parameter>

<Parameter name="SOAPBINDINGSTYLE">
<Default>document</Default>
</Parameter>

<Parameter name="SOAPBODYUSE">
<Default>literal</Default>
</Parameter>

<Parameter name="SUPPRESSDOCUMENTATION">
<Default>1</Default>
</Parameter>

<Parameter name="TYPENAMESPACE">
<Default>http://www.alliance.ch/kal/1.0</Default>
</Parameter>

<Parameter name="XMLDEFAULTREFERENCE">
<Default>complete</Default>
</Parameter>

<Parameter name="XMLIMPORTNAMESPACE">
<Default>http://www.alliance.ch/kal/1.0</Default>
</Parameter>

<Parameter name="XMLRESULTNAME">
<Default>%Result</Default>
</Parameter>

<Property name="%Result">
<Type>%xsd.base64Binary</Type>
<Parameter name="XMLIO" value="IN"/>
<Parameter name="XMLNAME" value="sendMessagesResult"/>
</Property>

<Property name="messages">
<Type>Alliance.Common.KAL.MessagesUnprocessed</Type>
<Parameter name="XMLIO" value="OUT"/>
</Property>
</Class>


<Class name="Alliance.Common.Model.Core.ObjectHeader">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61688.889548</TimeChanged>
<TimeCreated>61748,62192.699876</TimeCreated>
<Inheritance>right</Inheritance>

<Index name="Ident">
<IdKey>1</IdKey>
<Properties>CreatedOnSystem,ItemID</Properties>
<Unique>1</Unique>
</Index>

<Property name="MasterID">
<Type>%String</Type>
</Property>

<Property name="Status">
<Description>
1000 New Order
1050 Order passed to AGRIS/M
1100 Order Splitted
1200 Order Dispatched
9000 Invalid Order: No Order lines
9001 Invalid Order: ???</Description>
<Type>%Integer</Type>
</Property>

<Property name="ObjectType">
<Description>
100 Order
110 Supplier Order</Description>
<Type>%Integer</Type>
<InitialExpression>100</InitialExpression>
</Property>

<Property name="StatusChanged">
<Type>%TimeStamp</Type>
</Property>

<Property name="Created">
<Type>%TimeStamp</Type>
<InitialExpression>$ZDT($ZUTIL(188),3)</InitialExpression>
</Property>

<Property name="CreatedOnSystem">
<Type>%String</Type>
</Property>

<Property name="ItemID">
<Type>%String</Type>
</Property>

<Property name="ParentID">
<Type>%String</Type>
</Property>

<Method name="GenerateMasterID">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit $I(^Alliance.MasterID("ID"))
]]></Implementation>
</Method>

<Method name="GenerateItemID">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit $I(^Alliance.ItemID("ID"))
]]></Implementation>
</Method>

<Method name="%OnAddToSaveSet">
<Description><![CDATA[
This callback method is invoked when the current object is added to the SaveSet,
either because %Save() was invoked on this object or on an object that references this object.
%OnAddToSaveSet can modify the current object. It can also add other objects to the current
SaveSet by invoking %AddToSaveSet or remove objects by calling %RemoveFromSaveSet.

<P>If this method returns an error status then %Save() will fail and the transaction
will be rolled back.]]></Description>
<FormalSpec>depth:%Integer=3,insert:%Integer=0,callcount:%Integer=0</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	if (insert) {
		if (..MasterID = "") {
			set ..MasterID = ..GenerateMasterID()
			set ..ItemID = ..MasterID
		}
		if (..CreatedOnSystem = "") {
			set ..CreatedOnSystem = ##class(Alliance.Common.KAL.CommunicationParams).getClientId()
		}
		if (..ItemID = "") {
			set ..ItemID = ..GenerateItemID()
		}
	}
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.Comm4735.ObjectHeaderD</DataLocation>
<DefaultData>ObjectHeaderDefaultData</DefaultData>
<IdLocation>^Alliance.Comm4735.ObjectHeaderD</IdLocation>
<IndexLocation>^Alliance.Comm4735.ObjectHeaderI</IndexLocation>
<StreamLocation>^Alliance.Comm4735.ObjectHeaderS</StreamLocation>
<Data name="ObjectHeaderDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>MasterID</Value>
</Value>
<Value name="3">
<Value>ParentObj</Value>
</Value>
<Value name="4">
<Value>Status</Value>
</Value>
<Value name="5">
<Value>StatusChanged</Value>
</Value>
<Value name="6">
<Value>Created</Value>
</Value>
<Value name="7">
<Value>ObjectType</Value>
</Value>
<Value name="8">
<Value>CreatedSystem</Value>
</Value>
<Value name="9">
<Value>ItemID</Value>
</Value>
<Value name="10">
<Value>ParentID</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.DespatchAdvice">
<Super>Alliance.Common.Model.Core.ObjectHeader</Super>
<TimeChanged>61822,42874</TimeChanged>
<TimeCreated>61759,42514.503437</TimeCreated>

<Property name="EDIHeader">
<Type>Alliance.Common.Model.DespatchAdvice.EDIHeader</Type>
</Property>

<Property name="MsgTimestamp">
<Description>
DTM.C507.2005 = 137</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="ShpDocName">
<Description>
///// Shipping Data
BGM C002.1001
351 = Shipping Data</Description>
<Type>%String</Type>
<InitialExpression>"351"</InitialExpression>
</Property>

<Property name="ShpCodeListAgy">
<Description>
BGM C002.3055
Code List Agency
9 = EAN</Description>
<Type>%String</Type>
<InitialExpression>"9"</InitialExpression>
</Property>

<Property name="ShpNo">
<Description>
BGM C002.1004
ShippingNo</Description>
<Type>%String</Type>
</Property>

<Property name="ShpMsgFnct">
<Description>
BGM C002.1004
Message Function
9 = Original</Description>
<Type>%String</Type>
<InitialExpression>"9"</InitialExpression>
</Property>

<Property name="DeliveryTime">
<Description>
DTM.C507.2005 = 191</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="OrderNo">
<Description>
SG1(1).RFF(1).1153 = ON
Order No Buyer</Description>
<Type>%String</Type>
</Property>

<Property name="OrderNoType">
<Description>
SG1(1).RFF(2).1153 = VN
VN = Order No Supplier
ON = Order No Buyer</Description>
<Type>%String</Type>
</Property>

<Property name="SAPBusCase">
<Description>
SG1(2).RFF(1).1153 = ABO
SAP Business Case
G = Global
X = Crossdocking
D = Direct delivery
J = Rackjobbing</Description>
<Type>%String</Type>
</Property>

<Property name="BuyerInfo">
<Description>
SG2-Info where SG2(x).NAD.3025 = "BY"</Description>
<Type>Alliance.Common.Model.DespatchAdvice.PartyInfo</Type>
</Property>

<Property name="SupplierInfo">
<Description>
SG2-Info where SG2(x).NAD.3025 = "SU"</Description>
<Type>Alliance.Common.Model.DespatchAdvice.PartyInfo</Type>
</Property>

<Property name="DeliveryPartyInfo">
<Description>
SG2-Info where SG2(x).NAD.3025 = "DP"</Description>
<Type>Alliance.Common.Model.DespatchAdvice.PartyInfo</Type>
</Property>

<Property name="StoreNumberInfo">
<Description>
SG2-Info where SG2(x).NAD.3025 = "SN"</Description>
<Type>Alliance.Common.Model.DespatchAdvice.PartyInfo</Type>
</Property>

<Property name="TransportDetails">
<Description>
SG6(1).TDT Information</Description>
<Type>Alliance.Common.Model.DespatchAdvice.TransportDetails</Type>
</Property>

<Property name="PackageInfos">
<Description>
SG10.SG11</Description>
<Type>PackageInfo</Type>
<Collection>list</Collection>
</Property>

<Method name="%OnNew">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%New</METHOD> method to 
provide notification that a new instance of an object is being created.

<P>If this method returns an error then the object will not be created.
<p>It is passed the arguments provided in the %New call.
When customizing this method, override the arguments with whatever variables and types you expect to receive from %New().
For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
<p>Method %OnNew(dob as %Date = "", name as %Name = "") as %Status]]></Description>
<FormalSpec>initvalue:%CacheString</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set ..ObjectType = 200
	set ..Status = 1000
	set ..StatusChanged = $ZDT($ZUTIL(188),3)
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>DespatchAdviceDefaultData</DefaultData>
<Data name="DespatchAdviceDefaultData">
<Structure>listnode</Structure>
<Subscript>"DespatchAdvice"</Subscript>
<Value name="1">
<Value>EDIHeader</Value>
</Value>
<Value name="2">
<Value>MsgTimestamp</Value>
</Value>
<Value name="3">
<Value>ShpDocName</Value>
</Value>
<Value name="4">
<Value>ShpCodeListAgy</Value>
</Value>
<Value name="5">
<Value>ShpNo</Value>
</Value>
<Value name="6">
<Value>ShpMsgFnct</Value>
</Value>
<Value name="7">
<Value>DeliveryTime</Value>
</Value>
<Value name="8">
<Value>OrderNo</Value>
</Value>
<Value name="9">
<Value>OrderNoType</Value>
</Value>
<Value name="10">
<Value>SAPBusCase</Value>
</Value>
<Value name="11">
<Value>BuyerInfo</Value>
</Value>
<Value name="12">
<Value>SupplierInfo</Value>
</Value>
<Value name="13">
<Value>DeliveryPartyInfo</Value>
</Value>
<Value name="14">
<Value>StoreNumberInfo</Value>
</Value>
<Value name="15">
<Value>TransportDetails</Value>
</Value>
<Value name="16">
<Value>PackageInfos</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.EDIHeader">
<Description>
Collects data for UNB and UNH Segments</Description>
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61689.011388</TimeChanged>
<TimeCreated>61759,42683.720523</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="SyntaxId">
<Description>
/////////////////// UNB
UNB 0001</Description>
<Type>%String</Type>
<InitialExpression>"UNOC"</InitialExpression>
</Property>

<Property name="SyntaxVer">
<Description>
UNB 0002</Description>
<Type>%String</Type>
<InitialExpression>"3"</InitialExpression>
</Property>

<Property name="SenderId">
<Description>
UNB S002.0004
Global Location Number (GLN) of technical sender</Description>
<Type>%String</Type>
</Property>

<Property name="SenderIdCodeQual">
<Description>
UNB S002.0007</Description>
<Type>%String</Type>
<InitialExpression>"14"</InitialExpression>
</Property>

<Property name="RecipientId">
<Description>
UNB S003.0010
Global Location Number (GLN) of technical recipient</Description>
<Type>%String</Type>
</Property>

<Property name="RecipientIdCodeQual">
<Description>
UNB S003.0007</Description>
<Type>%String</Type>
<InitialExpression>"14"</InitialExpression>
</Property>

<Property name="RoutingAdr">
<Description>
UNB S003.0014
Routing Adress. GLN of supplier</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeDate">
<Description>
UNB S004.0017
Date of interchange prep (Format YYMMDD)</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeTime">
<Description>
UNB S004.0019
Time of interchange prep (Format HHMM)</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeCtrlRef">
<Description>
UNB S004.0020
Continuous Number of the interchange given by the sender</Description>
<Type>%String</Type>
</Property>

<Property name="ApplicationRef">
<Description>
UNB S005.0026
Application Reference</Description>
<Type>%String</Type>
</Property>

<Property name="CommunicationAgrmt">
<Description>
UNB S005.0032</Description>
<Type>%String</Type>
</Property>

<Property name="TestIndicator">
<Description>
UNB S005.0035
"1" means Test submission</Description>
<Type>%String</Type>
</Property>

<Property name="MsgRefNo">
<Description>
/////////////////// UNH
UNH 0062</Description>
<Type>%String</Type>
</Property>

<Property name="MsgTypeId">
<Description>
UNH S009.0065</Description>
<Type>%String</Type>
<InitialExpression>"DESADV"</InitialExpression>
</Property>

<Property name="MsgTypeVerNo">
<Description>
UNH S009.0052
Message TYpe Version Number. 
D = Draft</Description>
<Type>%String</Type>
<InitialExpression>"D"</InitialExpression>
</Property>

<Property name="MsgTypeReleaseNo">
<Description>
UNH S009.0054
Message TYpe Release Number. </Description>
<Type>%String</Type>
<InitialExpression>"96A"</InitialExpression>
</Property>

<Property name="CntrlAcy">
<Description>
UNH S009.0051
Controlling Agency </Description>
<Type>%String</Type>
<InitialExpression>"UN"</InitialExpression>
</Property>

<Property name="AssocAssCode">
<Description>
UNH S009.0057
Association assigned code
EAN006 = EAN Version Control  Number </Description>
<Type>%String</Type>
<InitialExpression>"EAN006"</InitialExpression>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonCA57.EDIHeaderD</DataLocation>
<DefaultData>EDIHeaderDefaultData</DefaultData>
<IdLocation>^Alliance.CommonCA57.EDIHeaderD</IdLocation>
<IndexLocation>^Alliance.CommonCA57.EDIHeaderI</IndexLocation>
<StreamLocation>^Alliance.CommonCA57.EDIHeaderS</StreamLocation>
<Data name="EDIHeaderDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>SyntaxId</Value>
</Value>
<Value name="3">
<Value>SyntaxVer</Value>
</Value>
<Value name="4">
<Value>SenderId</Value>
</Value>
<Value name="5">
<Value>SenderIdCodeQual</Value>
</Value>
<Value name="6">
<Value>RecipientId</Value>
</Value>
<Value name="7">
<Value>RecipientIdCodeQual</Value>
</Value>
<Value name="8">
<Value>RoutingAdr</Value>
</Value>
<Value name="9">
<Value>InterchangeDate</Value>
</Value>
<Value name="10">
<Value>InterchangeTime</Value>
</Value>
<Value name="11">
<Value>InterchangeCtrlRef</Value>
</Value>
<Value name="12">
<Value>ApplicationRef</Value>
</Value>
<Value name="13">
<Value>CommunicationAgrmt</Value>
</Value>
<Value name="14">
<Value>TestIndicator</Value>
</Value>
<Value name="15">
<Value>MsgRefNo</Value>
</Value>
<Value name="16">
<Value>MsgTypeId</Value>
</Value>
<Value name="17">
<Value>MsgTypeVerNo</Value>
</Value>
<Value name="18">
<Value>MsgTypeReleaseNo</Value>
</Value>
<Value name="19">
<Value>CntrlAcy</Value>
</Value>
<Value name="20">
<Value>AssocAssCode</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.ItemDetails">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61700.400223</TimeChanged>
<TimeCreated>61759,42716.537318</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="LineNo">
<Description>
SG10.SG16.LIN.1082</Description>
<Type>%String</Type>
</Property>

<Property name="ItemNo">
<Description>
SG10.SG16.LIN.7140</Description>
<Type>%String</Type>
</Property>

<Property name="ItemNoType">
<Description>
SG10.SG16.LIN.7143
"EN" = EAN</Description>
<Type>%String</Type>
<InitialExpression>"EN"</InitialExpression>
</Property>

<Property name="Subline">
<Description>
SG10.SG16.LIN.C829.5495
1 = Is subline</Description>
<Type>%String</Type>
</Property>

<Property name="LineNoRef">
<Description>
SG10.SG16.LIN.C829.1082
Reference to lead Line No of sub line no (only wehen subline)</Description>
<Type>%String</Type>
</Property>

<Property name="Configuration">
<Description>
SG10.SG15.LIN.C829.7083
Configuration Code
I = Included in the configuration</Description>
<Type>%String</Type>
</Property>

<Property name="SAPItemNo">
<Description>
SG10.SG15.PIA Structure
Additional Article Identification</Description>
<Type>%String</Type>
</Property>

<Property name="Quantity">
<Description>
SG10.SG15.QTY.6060
Quantity</Description>
<Type>%String</Type>
</Property>

<Property name="QuantityQual">
<Description>
SG10.SG15.QTY.6063
Quantity Qualifier
11 = delivery quantity
12 = partial delivery quantity</Description>
<Type>%String</Type>
</Property>

<Property name="QuantityUoM">
<Description>
SG10.SG15.QTY.6411
Quantity Unit Of Measure
PCE = Piece</Description>
<Type>%String</Type>
</Property>

<Property name="BestBefore">
<Description>
SG10.SG15.DTM</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="OrderItemNo">
<Description>
SG10.SG15.SG16.RFF
Itemnumber in Order</Description>
<Type>%String</Type>
</Property>

<Property name="MarkingInstruction">
<Description>
SG10.SG15.SG20.PCI
Itemnumber in Order</Description>
<Type>%String</Type>
<InitialExpression>"10"</InitialExpression>
</Property>

<Property name="BatchNo">
<Description>
SG10.SG15.SG20.SG21.GIN
Itemnumber in Order</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommoCA57.ItemDetailsD</DataLocation>
<DefaultData>ItemDetailsDefaultData</DefaultData>
<IdLocation>^Alliance.CommoCA57.ItemDetailsD</IdLocation>
<IndexLocation>^Alliance.CommoCA57.ItemDetailsI</IndexLocation>
<StreamLocation>^Alliance.CommoCA57.ItemDetailsS</StreamLocation>
<Data name="ItemDetailsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>LineNo</Value>
</Value>
<Value name="3">
<Value>ItemNo</Value>
</Value>
<Value name="4">
<Value>ItemNoType</Value>
</Value>
<Value name="5">
<Value>Subline</Value>
</Value>
<Value name="6">
<Value>LineNoRef</Value>
</Value>
<Value name="7">
<Value>Configuration</Value>
</Value>
<Value name="8">
<Value>SAPItemNo</Value>
</Value>
<Value name="9">
<Value>Quantity</Value>
</Value>
<Value name="10">
<Value>QuantityQual</Value>
</Value>
<Value name="11">
<Value>QuantityUoM</Value>
</Value>
<Value name="12">
<Value>BestBefore</Value>
</Value>
<Value name="13">
<Value>OrderItemNo</Value>
</Value>
<Value name="14">
<Value>MarkingInstruction</Value>
</Value>
<Value name="15">
<Value>BatchNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.PackageInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61689.129909</TimeChanged>
<TimeCreated>61759,42764.25361</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="HierarchyNo">
<Description>
SG10.CPS.7164</Description>
<Type>%String</Type>
</Property>

<Property name="ParentHryNo">
<Description>
SG10.CPS.7166</Description>
<Type>%String</Type>
</Property>

<Property name="PackageUnits">
<Description>
SG10.SG11s</Description>
<Type>PackageUnit</Type>
<Collection>list</Collection>
</Property>

<Property name="Items">
<Description>
SG10.SG15</Description>
<Type>ItemDetails</Type>
<Collection>list</Collection>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommoCA57.PackageInfoD</DataLocation>
<DefaultData>PackageInfoDefaultData</DefaultData>
<IdLocation>^Alliance.CommoCA57.PackageInfoD</IdLocation>
<IndexLocation>^Alliance.CommoCA57.PackageInfoI</IndexLocation>
<StreamLocation>^Alliance.CommoCA57.PackageInfoS</StreamLocation>
<Data name="PackageInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>HierarchyNo</Value>
</Value>
<Value name="3">
<Value>ParentHryNo</Value>
</Value>
<Value name="4">
<Value>PackageUnits</Value>
</Value>
<Value name="5">
<Value>Items</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.PackageUnit">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61689.237235</TimeChanged>
<TimeCreated>61759,42800.582993</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Count">
<Description>
SG10.SG11.PAC.7224
Number of packages</Description>
<Type>%String</Type>
</Property>

<Property name="Level">
<Description>
SG10.SG11.PAC.7075
Packaging level code
1 = inner packaging level
3 = outer packaging level</Description>
<Type>%String</Type>
</Property>

<Property name="Type">
<Description>
SG10.SG11.PAC.7065
Package type
08 = Palette</Description>
<Type>%String</Type>
</Property>

<Property name="HeightValue">
<Description>
Value of SG10.SG11.MEA.6314 where 6311 = "PD" and 6313 = "HT"</Description>
<Type>%String</Type>
</Property>

<Property name="HeightUnit">
<Description>
Value of SG10.SG11.MEA.6411 where 6311 = "PD" and 6313 = "HT"</Description>
<Type>%String</Type>
</Property>

<Property name="LengthValue">
<Description>
Value of SG10.SG11.MEA.6314 where 6311 = "PD" and 6313 = "LN"</Description>
<Type>%String</Type>
</Property>

<Property name="LengthUnit">
<Description>
Value of SG10.SG11.MEA.6411 where 6311 = "PD" and 6313 = "LN"</Description>
<Type>%String</Type>
</Property>

<Property name="WidthValue">
<Description>
Value of SG10.SG11.MEA.6314 where 6311 = "PD" and 6313 = "WD"</Description>
<Type>%String</Type>
</Property>

<Property name="WidthUnit">
<Description>
Value of SG10.SG11.MEA.6411 where 6311 = "PD" and 6313 = "WD"</Description>
<Type>%String</Type>
</Property>

<Property name="VolumeValue">
<Description>
Value of SG10.SG11.MEA.6314 where 6311 = "PD" and 6313 = "AAW"</Description>
<Type>%String</Type>
</Property>

<Property name="VolumeUnit">
<Description>
Value of SG10.SG11.MEA.6411 where 6311 = "PD" and 6313 = "AAW"</Description>
<Type>%String</Type>
</Property>

<Property name="GrossWeightValue">
<Description>
Value of SG10.SG11.MEA.6314 where 6311 = "PD" and 6313 = "AAW"</Description>
<Type>%String</Type>
</Property>

<Property name="GrossWeightUnit">
<Description>
Value of SG10.SG11.MEA.6411 where 6311 = "PD" and 6313 = "AAW"</Description>
<Type>%String</Type>
</Property>

<Property name="SSCCNo">
<Description>
Value of SG10.SG11.SG13(1) Structure</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommoCA57.PackageUnitD</DataLocation>
<DefaultData>PackageUnitDefaultData</DefaultData>
<IdLocation>^Alliance.CommoCA57.PackageUnitD</IdLocation>
<IndexLocation>^Alliance.CommoCA57.PackageUnitI</IndexLocation>
<StreamLocation>^Alliance.CommoCA57.PackageUnitS</StreamLocation>
<Data name="PackageUnitDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Count</Value>
</Value>
<Value name="3">
<Value>Level</Value>
</Value>
<Value name="4">
<Value>Type</Value>
</Value>
<Value name="5">
<Value>HeightValue</Value>
</Value>
<Value name="6">
<Value>HeightUnit</Value>
</Value>
<Value name="7">
<Value>LengthValue</Value>
</Value>
<Value name="8">
<Value>LengthUnit</Value>
</Value>
<Value name="9">
<Value>WidthValue</Value>
</Value>
<Value name="10">
<Value>WidthUnit</Value>
</Value>
<Value name="11">
<Value>VolumeValue</Value>
</Value>
<Value name="12">
<Value>VolumeUnit</Value>
</Value>
<Value name="13">
<Value>GrossWeightValue</Value>
</Value>
<Value name="14">
<Value>GrossWeightUnit</Value>
</Value>
<Value name="15">
<Value>SSCCNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.PartyInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61689.406419</TimeChanged>
<TimeCreated>61759,42837.93414</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Type">
<Description>
Party Type
BY = Buyer
SU = Suplier
DP = Delivery Party
SN = Store Number</Description>
<Type>%String</Type>
</Property>

<Property name="PartyID">
<Description>
SG2.NAD.3039
GLN of BY, SU, DP or Store</Description>
<Type>%String</Type>
</Property>

<Property name="CodeListRespAgy">
<Description>
SG2.NAD.3055
CodeListResponsibleAgency
9 = EAN</Description>
<Type>%String</Type>
<InitialExpression>"9"</InitialExpression>
</Property>

<Property name="RefQual">
<Description>
SG2.SG3(1).RFF.1153
ReferenceQualifier</Description>
<Type>%String</Type>
</Property>

<Property name="RefNo">
<Description>
SG2.SG3(1).RFF.1153
ReferenceNumber</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonCA57.PartyInfoD</DataLocation>
<DefaultData>PartyInfoDefaultData</DefaultData>
<IdLocation>^Alliance.CommonCA57.PartyInfoD</IdLocation>
<IndexLocation>^Alliance.CommonCA57.PartyInfoI</IndexLocation>
<StreamLocation>^Alliance.CommonCA57.PartyInfoS</StreamLocation>
<Data name="PartyInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>PartyID</Value>
</Value>
<Value name="4">
<Value>CodeListRespAgy</Value>
</Value>
<Value name="5">
<Value>RefQual</Value>
</Value>
<Value name="6">
<Value>RefNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.DespatchAdvice.TransportDetails">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61689.492096</TimeChanged>
<TimeCreated>61759,43146.387017</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="TransportStage">
<Description>
SG6(1).TDT.8051
20 = Main mode of Transport</Description>
<Type>%String</Type>
<InitialExpression>"20"</InitialExpression>
</Property>

<Property name="Mode">
<Description>
SG6(1).TDT.8067
Mode of Transport
10 = Sea
20 = Train
30 = Road
40 = Air
50 = Post
60 = Combined MoT
100 = Courier</Description>
<Type>%String</Type>
</Property>

<Property name="TypeOfTransport">
<Description>
SG6(1).TDT.8179
Code for Details of Mode, i.e. 12 = Ship Tanker</Description>
<Type>%String</Type>
</Property>

<Property name="IdentOfTransport">
<Description>
SG6(1).TDT.8212
Identification of Transport, i.e. Identification Number of vehicle</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CCA57.TransportDeEB83D</DataLocation>
<DefaultData>TransportDetailsDefaultData</DefaultData>
<IdLocation>^Alliance.CCA57.TransportDeEB83D</IdLocation>
<IndexLocation>^Alliance.CCA57.TransportDeEB83I</IndexLocation>
<StreamLocation>^Alliance.CCA57.TransportDeEB83S</StreamLocation>
<Data name="TransportDetailsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>TransportStage</Value>
</Value>
<Value name="3">
<Value>Mode</Value>
</Value>
<Value name="4">
<Value>TypeOfTransport</Value>
</Value>
<Value name="5">
<Value>IdentOfTransport</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.AllowanceOrCharge">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56802.317775</TimeChanged>
<TimeCreated>61759,44336.474497</TimeCreated>

<Property name="AllowOrCharge">
<Description>
SG26.SG39.ALC.5463
A Allowance
C Charge</Description>
<Type>%String</Type>
</Property>

<Property name="Number">
<Description>
SG26.SG39.ALC.C552.1230
Allowance or Charge number/identifier</Description>
<Type>%String</Type>
</Property>

<Property name="SpecialService">
<Description>
SG26.SG39.ALC.C214.7161
Special Service Description</Description>
<Type>%String</Type>
</Property>

<Property name="PercentType">
<Description>
SG26.SG39.SG41.PCD.5245
Percentage type
1 Allowance
2 Charge
3 Allowance or charge</Description>
<Type>%String</Type>
</Property>

<Property name="PercentValue">
<Description>
SG26.SG39.SG41.PCD.5482
Percent value</Description>
<Type>%String</Type>
</Property>

<Property name="AmountType">
<Description>
SG26.SG39.SG42.MOA.5245
Monetary Amount type
23 Charge amount
204 Allowance amount</Description>
<Type>%String</Type>
</Property>

<Property name="AmountValue">
<Description>
SG26.SG39.SG42.MOA.5482
Monetary Amount value</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CF042.AllowanceOrA405D</DataLocation>
<DefaultData>AllowanceOrChargeDefaultData</DefaultData>
<IdLocation>^Alliance.CF042.AllowanceOrA405D</IdLocation>
<IndexLocation>^Alliance.CF042.AllowanceOrA405I</IndexLocation>
<StreamLocation>^Alliance.CF042.AllowanceOrA405S</StreamLocation>
<Data name="AllowanceOrChargeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AllowOrCharge</Value>
</Value>
<Value name="3">
<Value>Number</Value>
</Value>
<Value name="4">
<Value>SpecialService</Value>
</Value>
<Value name="5">
<Value>PercentType</Value>
</Value>
<Value name="6">
<Value>PercentValue</Value>
</Value>
<Value name="7">
<Value>AmountType</Value>
</Value>
<Value name="8">
<Value>AmountValue</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.EDIHeader">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56239.173017</TimeChanged>
<TimeCreated>61759,44364.45292</TimeCreated>

<Property name="SyntaxId">
<Description>
/////////////////// UNB
UNB 0001</Description>
<Type>%String</Type>
<InitialExpression>"UNOC"</InitialExpression>
</Property>

<Property name="SyntaxVer">
<Description>
UNB 0002</Description>
<Type>%String</Type>
<InitialExpression>"4"</InitialExpression>
</Property>

<Property name="SenderId">
<Description>
UNB S002.0004
Global Location Number (GLN) of technical sender</Description>
<Type>%String</Type>
</Property>

<Property name="SenderIdCodeQual">
<Description>
UNB S002.0007</Description>
<Type>%String</Type>
<InitialExpression>"14"</InitialExpression>
</Property>

<Property name="RecipientId">
<Description>
UNB S003.0010
Global Location Number (GLN) of technical recipient</Description>
<Type>%String</Type>
</Property>

<Property name="RecipientIdCodeQual">
<Description>
UNB S003.0007</Description>
<Type>%String</Type>
<InitialExpression>"14"</InitialExpression>
</Property>

<Property name="RoutingAdr">
<Description>
UNB S003.0014
Routing Adress. GLN of supplier</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeDate">
<Description>
UNB S004.0017
Date of interchange prep (Format YYMMDD)</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeTime">
<Description>
UNB S004.0019
Time of interchange prep (Format HHMM)</Description>
<Type>%String</Type>
</Property>

<Property name="InterchangeCtrlRef">
<Description>
UNB S004.0020
Continuous Number of the interchange given by the sender</Description>
<Type>%String</Type>
</Property>

<Property name="ApplicationRef">
<Description>
UNB S005.0026
Application Reference</Description>
<Type>%String</Type>
</Property>

<Property name="CommunicationAgrmt">
<Description>
UNB S005.0032</Description>
<Type>%String</Type>
</Property>

<Property name="TestIndicator">
<Description>
UNB S005.0035
"1" means Test submission</Description>
<Type>%String</Type>
</Property>

<Property name="MsgRefNo">
<Description>
///////////////////////////UNH
UNH 0062</Description>
<Type>%String</Type>
</Property>

<Property name="MsgTypeId">
<Description>
UNH S009.0065</Description>
<Type>%String</Type>
<InitialExpression>"INVOIC"</InitialExpression>
</Property>

<Property name="MsgTypeVerNo">
<Description>
UNH S009.0052
Message TYpe Version Number. 
D = Draft</Description>
<Type>%String</Type>
<InitialExpression>"D"</InitialExpression>
</Property>

<Property name="MsgTypeReleaseNo">
<Description>
UNH S009.0054
Message TYpe Release Number. </Description>
<Type>%String</Type>
<InitialExpression>"01B"</InitialExpression>
</Property>

<Property name="CntrlAcy">
<Description>
UNH S009.0051
Controlling Agency </Description>
<Type>%String</Type>
<InitialExpression>"UN"</InitialExpression>
</Property>

<Property name="AssocAssCode">
<Description>
UNH S009.0057
Association assigned code
EAN010 = Indicating EANCOM version 010 of UNSM Invoice </Description>
<Type>%String</Type>
<InitialExpression>"EAN010"</InitialExpression>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonF042.EDIHeaderD</DataLocation>
<DefaultData>EDIHeaderDefaultData</DefaultData>
<IdLocation>^Alliance.CommonF042.EDIHeaderD</IdLocation>
<IndexLocation>^Alliance.CommonF042.EDIHeaderI</IndexLocation>
<StreamLocation>^Alliance.CommonF042.EDIHeaderS</StreamLocation>
<Data name="EDIHeaderDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>MsgRefNo</Value>
</Value>
<Value name="3">
<Value>MsgTypeId</Value>
</Value>
<Value name="4">
<Value>MsgTypeVerNo</Value>
</Value>
<Value name="5">
<Value>MsgTypeReleaseNo</Value>
</Value>
<Value name="6">
<Value>CntrlAcy</Value>
</Value>
<Value name="7">
<Value>AssocAssCode</Value>
</Value>
<Value name="8">
<Value>SyntaxId</Value>
</Value>
<Value name="9">
<Value>SyntaxVer</Value>
</Value>
<Value name="10">
<Value>SenderId</Value>
</Value>
<Value name="11">
<Value>SenderIdCodeQual</Value>
</Value>
<Value name="12">
<Value>RecipientId</Value>
</Value>
<Value name="13">
<Value>RecipientIdCodeQual</Value>
</Value>
<Value name="14">
<Value>RoutingAdr</Value>
</Value>
<Value name="15">
<Value>InterchangeDate</Value>
</Value>
<Value name="16">
<Value>InterchangeTime</Value>
</Value>
<Value name="17">
<Value>InterchangeCtrlRef</Value>
</Value>
<Value name="18">
<Value>ApplicationRef</Value>
</Value>
<Value name="19">
<Value>CommunicationAgrmt</Value>
</Value>
<Value name="20">
<Value>TestIndicator</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.Invoice">
<Super>Alliance.Common.Model.Core.ObjectHeader</Super>
<TimeChanged>61822,42896</TimeChanged>
<TimeCreated>61759,44393.070112</TimeCreated>

<Property name="EDIHeader">
<Type>Alliance.Common.Model.Invoice.EDIHeader</Type>
</Property>

<Property name="DocumentType">
<Description>
BGM.C002.1001
380 = Commercial Invoice
381 = Credit Note (Gutschrift)
383 = Debit note (Nachbelastung)</Description>
<Type>%String</Type>
<InitialExpression>"380"</InitialExpression>
</Property>

<Property name="InvoiceNo">
<Description>
BGM.C106.104</Description>
<Type>%String</Type>
</Property>

<Property name="MsgType">
<Description>
BGM.1225
1 = Cancellation
9 = Original
55 = Notification only</Description>
<Type>%String</Type>
<InitialExpression>"9"</InitialExpression>
</Property>

<Property name="RespType">
<Description>
BGM.4343
AC = Acknowledge
'' = No Ack</Description>
<Type>%String</Type>
</Property>

<Property name="MsgTimestamp">
<Description>
DTM.C507.2005 = 137</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="DeliveryDate">
<Description>
DTM.C507.2005 = 35</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="InvoicingPeriod">
<Description>
DTM.C507.2005 = 263</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="InvDateApplication">
<Description>
DTM.C507.2005 = 454</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="InvMessage">
<Description>
FTX.4451 = 'ZZZ'
Free text, i.e. Reason for creadit advice (Gutschrift)</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="512"/>
</Property>

<Property name="RefInfos">
<Description>
 SG1 Items. Info about referenced documents</Description>
<Type>ReferenceInfo</Type>
<Collection>list</Collection>
</Property>

<Property name="PartyInfos">
<Description>
 SG2 Items. Info about parties</Description>
<Type>PartyInformation</Type>
<Collection>list</Collection>
</Property>

<Property name="Currency">
<Description>
 SG7.CUX
Invoice currency in ISO 4217 (3-alpha)</Description>
<Type>%String</Type>
</Property>

<Property name="PaymentTerms">
<Description>
 SG8 Items. Info about Payment Terms</Description>
<Type>PaymentTerms</Type>
<Collection>list</Collection>
</Property>

<Property name="InvoiceLines">
<Description>
 SG26 Items. Info about InvoiceLines</Description>
<Type>InvoiceLine</Type>
<Collection>list</Collection>
</Property>

<Property name="UNSSeperator">
<Description>
UNS</Description>
<Type>%String</Type>
<InitialExpression>"S"</InitialExpression>
</Property>

<Property name="LineCount">
<Description>
CNT</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
</Property>

<Method name="LineCountGet">
<ReturnType>%Integer</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	if (..InvoiceLines = "") {
		quit 0
	}
	quit ..InvoiceLines.Count()
]]></Implementation>
</Method>

<Property name="MonetaryDetails">
<Description>
SG50
Monetary Details</Description>
<Type>MonetaryDetail</Type>
<Collection>list</Collection>
</Property>

<Property name="TAXDetails">
<Description>
SG52</Description>
<Type>TaxDetail</Type>
<Collection>list</Collection>
</Property>

<Method name="%OnNew">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%New</METHOD> method to 
provide notification that a new instance of an object is being created.

<P>If this method returns an error then the object will not be created.
<p>It is passed the arguments provided in the %New call.
When customizing this method, override the arguments with whatever variables and types you expect to receive from %New().
For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
<p>Method %OnNew(dob as %Date = "", name as %Name = "") as %Status]]></Description>
<FormalSpec>initvalue:%CacheString</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set ..ObjectType = 300
	set ..Status = 1000
	set ..StatusChanged = $ZDT($ZUTIL(188),3)
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>InvoiceDefaultData</DefaultData>
<Data name="InvoiceDefaultData">
<Subscript>"Invoice"</Subscript>
<Value name="1">
<Value>EDIHeader</Value>
</Value>
<Value name="2">
<Value>DocumentType</Value>
</Value>
<Value name="3">
<Value>InvoiceNo</Value>
</Value>
<Value name="4">
<Value>MsgType</Value>
</Value>
<Value name="5">
<Value>RespType</Value>
</Value>
<Value name="6">
<Value>MsgTimestamp</Value>
</Value>
<Value name="7">
<Value>DeliveryDate</Value>
</Value>
<Value name="8">
<Value>InvoicingPeriod</Value>
</Value>
<Value name="9">
<Value>InvDateApplication</Value>
</Value>
<Value name="10">
<Value>InvMessage</Value>
</Value>
<Value name="11">
<Value>RefInfos</Value>
</Value>
<Value name="12">
<Value>PartyInfos</Value>
</Value>
<Value name="13">
<Value>Currency</Value>
</Value>
<Value name="14">
<Value>PaymentTerms</Value>
</Value>
<Value name="15">
<Value>InvoiceLines</Value>
</Value>
<Value name="16">
<Value>UNSSeperator</Value>
</Value>
<Value name="17">
<Value>MonetaryDetails</Value>
</Value>
<Value name="18">
<Value>TAXDetails</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.InvoiceLine">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56809.418643</TimeChanged>
<TimeCreated>61759,44427.418524</TimeCreated>

<Property name="ItemID">
<Type>%String</Type>
</Property>

<Property name="ItemNo">
<Type>%String</Type>
</Property>

<Property name="ItemTypeId">
<Type>%String</Type>
</Property>

<Property name="SublineIndicator">
<Type>%String</Type>
</Property>

<Property name="LineNoRef">
<Description>
Reference to lead Line No of sub line no (only wehen subline)</Description>
<Type>%String</Type>
</Property>

<Property name="ProductIds">
<Description>
SG26.PIA</Description>
<Type>ProductId</Type>
<Collection>list</Collection>
</Property>

<Property name="ItemDescriptions">
<Description>
 SG26.IMD. Info about Payment Terms</Description>
<Type>ItemDescription</Type>
<Collection>list</Collection>
</Property>

<Property name="Quantities">
<Description>
Quantity information. Must contain one element with QuantityInfo.Type = 46 </Description>
<Type>QuantityInfo</Type>
<Collection>list</Collection>
</Property>

<Property name="DeliveryDate">
<Description>
SG26.DTM
type = 35
TODO: Are the other date types 1, 263 also required?</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="MonetaryAmount">
<Description>
SG26.SG27.MOA</Description>
<Type>%String</Type>
</Property>

<Property name="LinePaymentTerms">
<Description>
SG26.SG28.PAT
5 Discount not applicable</Description>
<Type>%String</Type>
</Property>

<Property name="PriceDetails">
<Description>
SG26.SG29.PRI</Description>
<Type>PriceInfo</Type>
<Collection>list</Collection>
</Property>

<UDLText name="T">
<Content><![CDATA[
//Property OrderNoBuyer As %String;

]]></Content>
</UDLText>

<Property name="OrderRefs">
<Description>
SG26.SG30.RFF.1154, SG26.SG30.RFF.1153="ON"</Description>
<Type>ReferenceInfo</Type>
<Collection>list</Collection>
</Property>

<UDLText name="T">
<Content><![CDATA[
//Property OrderNoSupplier As %String;

]]></Content>
</UDLText>

<Property name="VATPercent">
<Description>
SG26.SG34.TAX.C243.5278, SG26.SG34.TAX.C241.5153 = "VAT"</Description>
<Type>%String</Type>
</Property>

<Property name="TaxDueAmount">
<Description>
SG26.SG34.MOA.C516.5004, SG26.SG34.MOA.C516.5025 = "124"</Description>
<Type>%String</Type>
</Property>

<Property name="TaxableAmount">
<Description>
SG26.SG34.MOA.C516.5004, SG26.SG34.MOA.C516.5025 = "125"</Description>
<Type>%String</Type>
</Property>

<Property name="AllowancesOrCharges">
<Description>
SG26.SG34</Description>
<Type>AllowanceOrCharge</Type>
<Collection>list</Collection>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommoF042.InvoiceLineD</DataLocation>
<DefaultData>InvoiceLineDefaultData</DefaultData>
<IdLocation>^Alliance.CommoF042.InvoiceLineD</IdLocation>
<IndexLocation>^Alliance.CommoF042.InvoiceLineI</IndexLocation>
<StreamLocation>^Alliance.CommoF042.InvoiceLineS</StreamLocation>
<Data name="InvoiceLineDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ItemID</Value>
</Value>
<Value name="3">
<Value>ItemNo</Value>
</Value>
<Value name="4">
<Value>ItemTypeId</Value>
</Value>
<Value name="5">
<Value>SublineIndicator</Value>
</Value>
<Value name="6">
<Value>LineNoRef</Value>
</Value>
<Value name="7">
<Value>ProductIds</Value>
</Value>
<Value name="8">
<Value>ItemDescriptions</Value>
</Value>
<Value name="9">
<Value>Quantities</Value>
</Value>
<Value name="10">
<Value>DeliveryDate</Value>
</Value>
<Value name="11">
<Value>MonetaryAmount</Value>
</Value>
<Value name="12">
<Value>LinePaymentTerms</Value>
</Value>
<Value name="13">
<Value>PriceDetails</Value>
</Value>
<Value name="14">
<Value>OrderNoBuyer</Value>
</Value>
<Value name="15">
<Value>OrderNoSupplier</Value>
</Value>
<Value name="16">
<Value>VATPercent</Value>
</Value>
<Value name="17">
<Value>TaxDueAmount</Value>
</Value>
<Value name="18">
<Value>TaxableAmount</Value>
</Value>
<Value name="19">
<Value>AllowancesOrCharges</Value>
</Value>
<Value name="20">
<Value>OrderRefs</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.ItemDescription">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56812.500553</TimeChanged>
<TimeCreated>61759,44451.820137</TimeCreated>

<Property name="Type">
<Description>
IMD.7077
E = Free-form short description
F = Free-form
C = Code</Description>
<Type>%String</Type>
</Property>

<Property name="Ident">
<Description>
IMD.7009
CU = Customer unit
STM1 = Alternative Unit of Measure
PAC = Price Display required</Description>
<Type>%String</Type>
</Property>

<Property name="RespAgcy">
<Description>
IMD.3055
9 EAN</Description>
<Type>%String</Type>
</Property>

<Property name="Textline1">
<Description>
IMD.7008</Description>
<Type>%String</Type>
</Property>

<Property name="Textline2">
<Description>
IMD.70082</Description>
<Type>%String</Type>
</Property>

<Property name="LanguageCode">
<Description>
IMD.3453</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CF042.ItemDescripE104D</DataLocation>
<DefaultData>ItemDescriptionDefaultData</DefaultData>
<IdLocation>^Alliance.CF042.ItemDescripE104D</IdLocation>
<IndexLocation>^Alliance.CF042.ItemDescripE104I</IndexLocation>
<StreamLocation>^Alliance.CF042.ItemDescripE104S</StreamLocation>
<Data name="ItemDescriptionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>Ident</Value>
</Value>
<Value name="4">
<Value>RespAgcy</Value>
</Value>
<Value name="5">
<Value>Textline1</Value>
</Value>
<Value name="6">
<Value>Textline2</Value>
</Value>
<Value name="7">
<Value>LanguageCode</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.MonetaryDetail">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56815.358289</TimeChanged>
<TimeCreated>61759,44473.883853</TimeCreated>

<Property name="Type">
<Description>
SG50.MOA.C516.5025
77 Invoice amount
79 Total line items amount
86 Message total monetary amount
129 Total amount subject to payment discount
131 Total charges/allowances
176 Message total duty/tax/fee amount</Description>
<Type>%String</Type>
</Property>

<Property name="Amount">
<Description>
SG50.MOA.C516.5004</Description>
<Type>%String</Type>
</Property>

<Property name="Referencetype">
<Description>
SG50.SG51.RFF.C506.1153
PQ Payment reference</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceNo">
<Description>
SG50.SG51.RFF.C506.1154</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CoF042.MonetaryDetailD</DataLocation>
<DefaultData>MonetaryDetailDefaultData</DefaultData>
<IdLocation>^Alliance.CoF042.MonetaryDetailD</IdLocation>
<IndexLocation>^Alliance.CoF042.MonetaryDetailI</IndexLocation>
<StreamLocation>^Alliance.CoF042.MonetaryDetailS</StreamLocation>
<Data name="MonetaryDetailDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>Amount</Value>
</Value>
<Value name="4">
<Value>Referencetype</Value>
</Value>
<Value name="5">
<Value>ReferenceNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.PartyInformation">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56818.502655</TimeChanged>
<TimeCreated>61759,44504.430067</TimeCreated>

<Property name="Type">
<Description>
Party Type
BY Buyer
DP Delivery party
II Issuer of invoice
IV Invoicee
PE Payee
SU Supplier
UC Ultimate consignee (Endempfänger)</Description>
<Type>%String</Type>
</Property>

<Property name="PartyID">
<Description>
SG2.NAD.3039
GLN of BY, SU, DP, etc.</Description>
<Type>%String</Type>
</Property>

<Property name="CodeListRespAgy">
<Description>
SG2.NAD.3055
CodeListResponsibleAgency
9 = EAN</Description>
<Type>%String</Type>
<InitialExpression>"9"</InitialExpression>
</Property>

<Property name="Name">
<Description>
SG2.NAD.C080.3036(1)
Name </Description>
<Type>%String</Type>
</Property>

<Property name="Name2">
<Description>
SG2.NAD.C080.3036(2)
Name Line 2</Description>
<Type>%String</Type>
</Property>

<Property name="Street">
<Description>
SG2.NAD.C059.3042(1)
Street and No </Description>
<Type>%String</Type>
</Property>

<Property name="Street2">
<Description>
SG2.NAD.C059.3042(2)
Street and No Line 2</Description>
<Type>%String</Type>
</Property>

<Property name="City">
<Description>
SG2.NAD.3164
Street and No Line 2</Description>
<Type>%String</Type>
</Property>

<Property name="ZIPCode">
<Description>
SG2.NAD.3251
ZIPCode</Description>
<Type>%String</Type>
</Property>

<Property name="Country">
<Description>
SG2.NAD.3207
Country</Description>
<Type>%String</Type>
</Property>

<Property name="VATRegNo">
<Description>
SG2.SG3.RFF.1154
VAT Registration Number</Description>
<Type>%String</Type>
</Property>

<Property name="ContactName">
<Description>
SG2.SG5.CTA.3412
Name of Contact Person</Description>
<Type>%String</Type>
</Property>

<Property name="ContactDep">
<Description>
SG2.SG5.CTA.3413
Contact Department</Description>
<Type>%String</Type>
</Property>

<Property name="ContactPhone">
<Description>
SG2.SG5.COM.3148, SG2.SG5.COM.3155 = 'TE'
Contact Phone Number</Description>
<Type>%String</Type>
</Property>

<Property name="ContactFax">
<Description>
SG2.SG5.COM.3148, SG2.SG5.COM.3155 = 'FX'
Contact Fax Number</Description>
<Type>%String</Type>
</Property>

<Property name="ContactEMail">
<Description>
SG2.SG5.COM.3148, SG2.SG5.COM.3155 = 'EM'
Contact E-Mail Address</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CF042.PartyInformEF5FD</DataLocation>
<DefaultData>PartyInformationDefaultData</DefaultData>
<IdLocation>^Alliance.CF042.PartyInformEF5FD</IdLocation>
<IndexLocation>^Alliance.CF042.PartyInformEF5FI</IndexLocation>
<StreamLocation>^Alliance.CF042.PartyInformEF5FS</StreamLocation>
<Data name="PartyInformationDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>PartyID</Value>
</Value>
<Value name="4">
<Value>CodeListRespAgy</Value>
</Value>
<Value name="5">
<Value>Name</Value>
</Value>
<Value name="6">
<Value>Name2</Value>
</Value>
<Value name="7">
<Value>Street</Value>
</Value>
<Value name="8">
<Value>Street2</Value>
</Value>
<Value name="9">
<Value>City</Value>
</Value>
<Value name="10">
<Value>ZIPCode</Value>
</Value>
<Value name="11">
<Value>Country</Value>
</Value>
<Value name="12">
<Value>VATRegNo</Value>
</Value>
<Value name="13">
<Value>ContactName</Value>
</Value>
<Value name="14">
<Value>ContactDep</Value>
</Value>
<Value name="15">
<Value>ContactPhone</Value>
</Value>
<Value name="16">
<Value>ContactFax</Value>
</Value>
<Value name="17">
<Value>ContactEMail</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.PaymentTerms">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56821.520654</TimeChanged>
<TimeCreated>61759,44525.436766</TimeCreated>

<Property name="Type">
<Description>
SG8.PAT.4279
1 Basic
3 Fixed date
22 Discount</Description>
<Type>%String</Type>
</Property>

<Property name="TimeRef">
<Description>
SG8.PAT.C112.2475
5 Date of Invoice</Description>
<Type>%String</Type>
</Property>

<Property name="TimeRelation">
<Description>
SG8.PAT.C112.2009
3 After reference</Description>
<Type>%String</Type>
</Property>

<Property name="PeriodType">
<Description>
SG8.PAT.C112.2151
D Day</Description>
<Type>%String</Type>
</Property>

<Property name="PeriodCount">
<Description>
SG8.PAT.C112.2152</Description>
<Type>%String</Type>
</Property>

<Property name="DiscountDue">
<Description>
SG8.DTM.C507.2380</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="NetDue">
<Description>
SG8.DTM.C507.2380</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="Percent">
<Description>
SG8.PCD.C501.5482</Description>
<Type>%String</Type>
</Property>

<Property name="PercentType">
<Description>
SG8.PCD.C501.5245
7 Percent of Invoice
12 Discount (Skonto)</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommF042.PaymentTermsD</DataLocation>
<DefaultData>PaymentTermsDefaultData</DefaultData>
<IdLocation>^Alliance.CommF042.PaymentTermsD</IdLocation>
<IndexLocation>^Alliance.CommF042.PaymentTermsI</IndexLocation>
<StreamLocation>^Alliance.CommF042.PaymentTermsS</StreamLocation>
<Data name="PaymentTermsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>TimeRef</Value>
</Value>
<Value name="4">
<Value>TimeRelation</Value>
</Value>
<Value name="5">
<Value>PeriodType</Value>
</Value>
<Value name="6">
<Value>PeriodCount</Value>
</Value>
<Value name="7">
<Value>DiscountDue</Value>
</Value>
<Value name="8">
<Value>NetDue</Value>
</Value>
<Value name="9">
<Value>Percent</Value>
</Value>
<Value name="10">
<Value>PercentType</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.PriceInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56824.915366</TimeChanged>
<TimeCreated>61759,44544.589399</TimeCreated>

<Property name="PriceCode">
<Description>
Field: SG26().SG29().PRI.5125
AAA = Calculation Net (Netto-Einstandspreis exkl. MWST)
INF = Information (Detail-Preis inkl. MWST)</Description>
<Type>%String</Type>
</Property>

<Property name="PriceAmount">
<Description>
Field: SG26().SG29().PRI.5118</Description>
<Type>%String</Type>
</Property>

<Property name="PriceType">
<Description>
Field: SG26().SG29().PRI.5375</Description>
<Type>%String</Type>
</Property>

<Property name="PriceSpec">
<Description>
Field:SG26().SG29().PRI.5387</Description>
<Type>%String</Type>
</Property>

<Property name="UnitPriceBase">
<Description>
Field: SG26().SG29().PRI.5284</Description>
<Type>%String</Type>
</Property>

<Property name="UnitOfMeasure">
<Description>
Field: SG26().SG29().PRI.6411</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonF042.PriceInfoD</DataLocation>
<DefaultData>PriceInfoDefaultData</DefaultData>
<IdLocation>^Alliance.CommonF042.PriceInfoD</IdLocation>
<IndexLocation>^Alliance.CommonF042.PriceInfoI</IndexLocation>
<StreamLocation>^Alliance.CommonF042.PriceInfoS</StreamLocation>
<Data name="PriceInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>TimeRef</Value>
</Value>
<Value name="4">
<Value>TimeRelation</Value>
</Value>
<Value name="5">
<Value>PeriodType</Value>
</Value>
<Value name="6">
<Value>PeriodCount</Value>
</Value>
<Value name="7">
<Value>DiscountDue</Value>
</Value>
<Value name="8">
<Value>NetDue</Value>
</Value>
<Value name="9">
<Value>Percent</Value>
</Value>
<Value name="10">
<Value>PercentType</Value>
</Value>
<Value name="11">
<Value>Qualifier</Value>
</Value>
<Value name="12">
<Value>Price</Value>
</Value>
<Value name="13">
<Value>UnitPriceBase</Value>
</Value>
<Value name="14">
<Value>UnitOfMeasure</Value>
</Value>
<Value name="15">
<Value>PriceCode</Value>
</Value>
<Value name="16">
<Value>PriceAmount</Value>
</Value>
<Value name="17">
<Value>PriceType</Value>
</Value>
<Value name="18">
<Value>PriceSpec</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.ProductId">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56828.267683</TimeChanged>
<TimeCreated>61759,44604.069358</TimeCreated>

<Property name="NumberType">
<Description>
1 Additional Identification
5 Product Identification</Description>
<Type>%String</Type>
</Property>

<Property name="ProductNo">
<Description>
The Product Number</Description>
<Type>%String</Type>
</Property>

<Property name="NumberOwner">
<Description>
SA Supplier's article Number 
IN Buyer's article Number </Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonF042.ProductIdD</DataLocation>
<DefaultData>ProductIdDefaultData</DefaultData>
<IdLocation>^Alliance.CommonF042.ProductIdD</IdLocation>
<IndexLocation>^Alliance.CommonF042.ProductIdI</IndexLocation>
<StreamLocation>^Alliance.CommonF042.ProductIdS</StreamLocation>
<Data name="ProductIdDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>NumberType</Value>
</Value>
<Value name="3">
<Value>ProductNo</Value>
</Value>
<Value name="4">
<Value>NumberOwner</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.QuantityInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56831.456464</TimeChanged>
<TimeCreated>61759,44633.820706</TimeCreated>

<Property name="Type">
<Description>
SG26.QTY.C186.6063
46 Delivered quantity
47 Invoiced quantity /Fakturierte Menge
59 Number of consumer units in the tradedunit </Description>
<Type>%String</Type>
</Property>

<Property name="Quantity">
<Description>
SG26.QTY.C186.6060</Description>
<Type>%String</Type>
</Property>

<Property name="UnitOfMeasure">
<Description>
SG26.QTY.C186.6411</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommF042.QuantityInfoD</DataLocation>
<DefaultData>QuantityInfoDefaultData</DefaultData>
<IdLocation>^Alliance.CommF042.QuantityInfoD</IdLocation>
<IndexLocation>^Alliance.CommF042.QuantityInfoI</IndexLocation>
<StreamLocation>^Alliance.CommF042.QuantityInfoS</StreamLocation>
<Data name="QuantityInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>Quantity</Value>
</Value>
<Value name="4">
<Value>UnitOfMeasure</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.ReferenceInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56833.785144</TimeChanged>
<TimeCreated>61759,44672.961503</TimeCreated>

<Property name="ReferenceType">
<Description>
SG1().RFF.C506.1153
AAK Despatch advice number
ACE Related document number
AIZ Consolidated invoice number
ALO Receiving advice number
CD Credit note number
DL Debit note number
DQ Delivery note number
IV Invoice number
ON Order number (buyer)
VN Order number (supplier)</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceNo">
<Description>
SG1().RFF.C506.1154
The number of the reference, i.e. Order Number if type = "ON"</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceDate">
<Description>
SG1().DTM
SG1().DTM.C507.2005 must be '171'</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="LineNo">
<Description>
SG26().SG30().RFF.C506.1156, i.e. LineNo of Order = "100"</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.ComF042.ReferenceInfoD</DataLocation>
<DefaultData>ReferenceInfoDefaultData</DefaultData>
<IdLocation>^Alliance.ComF042.ReferenceInfoD</IdLocation>
<IndexLocation>^Alliance.ComF042.ReferenceInfoI</IndexLocation>
<StreamLocation>^Alliance.ComF042.ReferenceInfoS</StreamLocation>
<Data name="ReferenceInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ReferenceType</Value>
</Value>
<Value name="3">
<Value>ReferenceNo</Value>
</Value>
<Value name="4">
<Value>ReferenceDate</Value>
</Value>
<Value name="5">
<Value>LineNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Invoice.TaxDetail">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62033,56837.638046</TimeChanged>
<TimeCreated>61759,44695.478034</TimeCreated>

<Property name="FnType">
<Description>
SG52.TAX.5283
7 Tax</Description>
<Type>%String</Type>
</Property>

<Property name="TaxType">
<Description>
SG52.TAX.C241.5153
VAT Value added tax</Description>
<Type>%String</Type>
</Property>

<Property name="Percent">
<Description>
SG52.TAX.C243.5278</Description>
<Type>%String</Type>
</Property>

<Property name="PartyTaxIdent">
<Description>
SG52.TAX.3446</Description>
<Type>%String</Type>
</Property>

<Property name="TaxAmount">
<Description>
SG52.MOA</Description>
<Type>%String</Type>
</Property>

<Property name="TaxableAmount">
<Description>
SG52.MOA</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.CommonF042.TaxDetailD</DataLocation>
<DefaultData>TaxDetailDefaultData</DefaultData>
<IdLocation>^Alliance.CommonF042.TaxDetailD</IdLocation>
<IndexLocation>^Alliance.CommonF042.TaxDetailI</IndexLocation>
<StreamLocation>^Alliance.CommonF042.TaxDetailS</StreamLocation>
<Data name="TaxDetailDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>FnType</Value>
</Value>
<Value name="3">
<Value>TaxType</Value>
</Value>
<Value name="4">
<Value>Percent</Value>
</Value>
<Value name="5">
<Value>PartyTaxIdent</Value>
</Value>
<Value name="6">
<Value>TaxAmount</Value>
</Value>
<Value name="7">
<Value>TaxableAmount</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.Buyer">
<Super>Alliance.Common.Model.Order.PartyInformation</Super>
<TimeChanged>61828,49884.90904</TimeChanged>
<TimeCreated>61747,62932.831085</TimeCreated>

<Property name="ContactName">
<Description>
SG2.SG5.NTA.3412</Description>
<Type>%String</Type>
</Property>

<Property name="ContactTel">
<Description>
if (SG2.SG5.COM.3155 = "TE") then value of SG2.SG5.COM.3148</Description>
<Type>%String</Type>
</Property>

<Property name="ContactFax">
<Description>
if (SG2.SG5.COM.3155 = "FX") then value of SG2.SG5.COM.3148</Description>
<Type>%String</Type>
</Property>

<Property name="ContactEMail">
<Description>
if (SG2.SG5.COM.3155 = "EM") then value of SG2.SG5.COM.3148</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceQual">
<Description>
SG2.SG3.RFF.1153
Reference Qualifier. YA1 Additional party identification (EAN Code)</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceNo">
<Description>
SG2.SG3.RFF.1154
Reference Number/COOP Supplier No</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceTradingEmpty">
<Description>
SG2.SG3.RFF.1156
Reference not specified - is empty</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceTradingGood">
<Description>
SG2.SG3.RFF.4000
Reference not specified - contains trading goods</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>BuyerDefaultData</DefaultData>
<Data name="BuyerDefaultData">
<Structure>listnode</Structure>
<Subscript>"Buyer"</Subscript>
<Value name="1">
<Value>ContactName</Value>
</Value>
<Value name="2">
<Value>ContactTel</Value>
</Value>
<Value name="3">
<Value>ContactFax</Value>
</Value>
<Value name="4">
<Value>ContactEMail</Value>
</Value>
<Value name="5">
<Value>ReferenceQual</Value>
</Value>
<Value name="6">
<Value>ReferenceNo</Value>
</Value>
<Value name="7">
<Value>ReferenceTradingGood</Value>
</Value>
<Value name="8">
<Value>ReferenceTradingEmpty</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.CurrencyDetails">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61690.151674</TimeChanged>
<TimeCreated>61747,62992.820159</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="DetailsQualifier">
<Description>
SG7(1).CUX(1).6347
2 = Reference Currency</Description>
<Type>%String</Type>
</Property>

<Property name="CurrencyCoded">
<Description>
SG7(1).CUX(1).6345
Currency Code in ISO 4217 (Three alpha)
CHF = Schweizer Franken, EUR = Euro</Description>
<Type>%String</Type>
</Property>

<Property name="CurrencyQualifier">
<Description>
SG7(1).CUX(1).6343
Meaning of currency
9 = Order currency</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.C9BF0.CurrencyDet8B9FD</DataLocation>
<DefaultData>CurrencyDetailsDefaultData</DefaultData>
<IdLocation>^Alliance.C9BF0.CurrencyDet8B9FD</IdLocation>
<IndexLocation>^Alliance.C9BF0.CurrencyDet8B9FI</IndexLocation>
<StreamLocation>^Alliance.C9BF0.CurrencyDet8B9FS</StreamLocation>
<Data name="CurrencyDetailsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>DetailsQualifier</Value>
</Value>
<Value name="3">
<Value>CurrencyCoded</Value>
</Value>
<Value name="4">
<Value>CurrencyQualifier</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.DeliveryParty">
<Super>Alliance.Common.Model.Order.PartyInformation</Super>
<TimeChanged>61747,63450</TimeChanged>
<TimeCreated>61747,63029.013138</TimeCreated>

<Property name="Name1">
<Description>
SG2.NAD1.3036</Description>
<Type>%String</Type>
</Property>

<Property name="Name2">
<Description>
SG2.NAD1.3036</Description>
<Type>%String</Type>
</Property>

<Property name="Telephone">
<Description>
SG2.NAD1.3036</Description>
<Type>%String</Type>
</Property>

<Property name="Street">
<Description>
SG2.NAD1.3042</Description>
<Type>%String</Type>
</Property>

<Property name="POBox">
<Description>
SG2.NAD1.3042</Description>
<Type>%String</Type>
</Property>

<Property name="Station">
<Description>
SG2.NAD1.3042
"Bahnstation"</Description>
<Type>%String</Type>
</Property>

<Property name="City">
<Description>
SG2.NAD1.3164</Description>
<Type>%String</Type>
</Property>

<Property name="ZIPCode">
<Description>
SG2.NAD1.3251</Description>
<Type>%String</Type>
</Property>

<Property name="CountryCode">
<Description>
SG2.NAD1.3207</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>DeliveryPartyDefaultData</DefaultData>
<Data name="DeliveryPartyDefaultData">
<Structure>listnode</Structure>
<Subscript>"DeliveryParty"</Subscript>
<Value name="1">
<Value>Name1</Value>
</Value>
<Value name="2">
<Value>Name2</Value>
</Value>
<Value name="3">
<Value>Telephone</Value>
</Value>
<Value name="4">
<Value>Street</Value>
</Value>
<Value name="5">
<Value>POBox</Value>
</Value>
<Value name="6">
<Value>Station</Value>
</Value>
<Value name="7">
<Value>City</Value>
</Value>
<Value name="8">
<Value>ZIPCode</Value>
</Value>
<Value name="9">
<Value>CountryCode</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.DeliveryTerms">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61690.228446</TimeChanged>
<TimeCreated>61747,63079.297784</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="TermsOfDel">
<Description>
SG11(1).TOD(1).4055
4 = Pick-up by Customer
6 = Terms of Delivery</Description>
<Type>%String</Type>
</Property>

<Property name="TermsOfDelCode">
<Description>
SG11(1).TOD(1).C100.4053
INCOTERMS 2000 Coded	</Description>
<Type>%String</Type>
</Property>

<Property name="TermsOfDelPlace">
<Description>
SG11(1).TOD(1).C100.4052
Terms of Delivery: Location	</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.Com9BF0.DeliveryTermsD</DataLocation>
<DefaultData>DeliveryTermsDefaultData</DefaultData>
<IdLocation>^Alliance.Com9BF0.DeliveryTermsD</IdLocation>
<IndexLocation>^Alliance.Com9BF0.DeliveryTermsI</IndexLocation>
<StreamLocation>^Alliance.Com9BF0.DeliveryTermsS</StreamLocation>
<Data name="DeliveryTermsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>TermsOfDel</Value>
</Value>
<Value name="3">
<Value>TermsOfDelCode</Value>
</Value>
<Value name="4">
<Value>TermsOfDelPlace</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.EDIDTM">
<Super>%SerialObject,%XML.Adaptor</Super>
<TimeChanged>61831,51261.093</TimeChanged>
<TimeCreated>61747,63128.005759</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="DTType">
<Description>
DTM 2005
137 = Document/Message Date and Time 
282 = Latest Confirmation Date for Order Response (ORDRSP) 
2 = Delivery Date/Time (Data = 000000 means unknown)
200 = Pick-Up Date
15 = Promotion Startdate
16 = Promotion Enddate
191 = Delivery Date and Time
361 = Best before date
35 = Delivery date/time
263 = Invoicing Period
454 = Invoice date from application
171 = Reference (document) date/time
12 = Terms discount due date/time (Skonto Verfalldatum)
13 = Terms net due date (Faelligkeit)</Description>
<Type>%String</Type>
</Property>

<Property name="Data">
<Description>
DTM 2380
Stored Date/Time as-is </Description>
<Type>%String</Type>
</Property>

<Property name="Format">
<Description>
DTM 2379
The date/time format pattern of date stored in data
204 = YYYYMMDDHHMMSS 
102 = YYYYMMDD
718 = YYYYMMDD-YYYYMMDD</Description>
<Type>%String</Type>
</Property>

<Property name="Date">
<Type>%Library.Date</Type>
<Calculated>1</Calculated>
<ReadOnly>1</ReadOnly>
</Property>

<Method name="DateGet">
<ReturnType>%Library.Date</ReturnType>
<Implementation><![CDATA[
	try {
		set result = $ZDateH($Extract(..Data,1,8), 8)
	}
	catch ex {
		set result = 0
	}

	quit result
]]></Implementation>
</Method>

<Property name="Time">
<Type>%Library.Time</Type>
<Calculated>1</Calculated>
<ReadOnly>1</ReadOnly>
</Property>

<Method name="TimeGet">
<ReturnType>%Library.Time</ReturnType>
<Implementation><![CDATA[
	try {
		set result = $ZTIMEH($Extract(..Data,1,2)_":"_$Extract(..Data,3,4)_":"_$Extract(..Data,5,6),1)
	}
	catch ex {
		set result = 0
	}

	quit result
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>EDIDTMState</State>
<StreamLocation>^Alliance.Common.Mod9BF0.EDIDTMS</StreamLocation>
<Data name="EDIDTMState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>DTType</Value>
</Value>
<Value name="2">
<Value>Data</Value>
</Value>
<Value name="3">
<Value>Format</Value>
</Value>
<Value name="4">
<Value>Date</Value>
</Value>
<Value name="5">
<Value>Time</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.EDIFTX">
<Super>%SerialObject,%XML.Adaptor</Super>
<TimeChanged>62045,35779.180866</TimeChanged>
<TimeCreated>61747,63163.923066</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Subject">
<Description>
FTX 4451
"DIN" = Delivery Instructions
"ADK" = Promotion Information Text</Description>
<Type>%String</Type>
</Property>

<Property name="Line1">
<Description>
FTX 4440</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="70"/>
</Property>

<Property name="Line2">
<Description>
FTX 44402</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="70"/>
</Property>

<Property name="Line3">
<Description>
FTX 44403</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="70"/>
</Property>

<Property name="Line4">
<Description>
FTX 44404</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="70"/>
</Property>

<Property name="Line5">
<Description>
FTX 44405</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="70"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>EDIFTXState</State>
<StreamLocation>^Alliance.Common.Mod9BF0.EDIFTXS</StreamLocation>
<Data name="EDIFTXState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Subject</Value>
</Value>
<Value name="2">
<Value>Line1</Value>
</Value>
<Value name="3">
<Value>Line2</Value>
</Value>
<Value name="4">
<Value>Line3</Value>
</Value>
<Value name="5">
<Value>Line4</Value>
</Value>
<Value name="6">
<Value>Line5</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.EDIInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61690.398681</TimeChanged>
<TimeCreated>61747,63188.393681</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="MsgRefNo">
<Description>
UNH 0062</Description>
<Type>%String</Type>
</Property>

<Property name="MsgTypeIdent">
<Description>
UNH 0065</Description>
<Type>%String</Type>
</Property>

<Property name="MsgTypeVerNo">
<Description>
UNH 0052</Description>
<Type>%String</Type>
</Property>

<Property name="MsgRefRelNo">
<Description>
UNH 0054</Description>
<Type>%String</Type>
</Property>

<Property name="CntrlAcy">
<Description>
UNH 0051</Description>
<Type>%String</Type>
</Property>

<Property name="AssocCode">
<Description>
UNH 0057</Description>
<Type>%String</Type>
</Property>

<Property name="LineCountCheck">
<Description>
CNT: Value of 6066 where 6069 = "2"
Number of LIN Elements in EDIFACT for control</Description>
<Type>%String</Type>
</Property>

<Property name="SegementCountCheck">
<Description>
UNT 0074</Description>
<Type>%String</Type>
</Property>

<Property name="MsgRefNoCheck">
<Description>
UNT 0062</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.Common.Mo9BF0.EDIInfoD</DataLocation>
<DefaultData>EDIInfoDefaultData</DefaultData>
<IdLocation>^Alliance.Common.Mo9BF0.EDIInfoD</IdLocation>
<IndexLocation>^Alliance.Common.Mo9BF0.EDIInfoI</IndexLocation>
<StreamLocation>^Alliance.Common.Mo9BF0.EDIInfoS</StreamLocation>
<Data name="EDIInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>MsgRefNo</Value>
</Value>
<Value name="3">
<Value>MsgTypeIdent</Value>
</Value>
<Value name="4">
<Value>MsgTypeVerNo</Value>
</Value>
<Value name="5">
<Value>MsgRefRelNo</Value>
</Value>
<Value name="6">
<Value>CntrlAcy</Value>
</Value>
<Value name="7">
<Value>AssocCode</Value>
</Value>
<Value name="8">
<Value>LineCountCheck</Value>
</Value>
<Value name="9">
<Value>SegementCountCheck</Value>
</Value>
<Value name="10">
<Value>MsgRefNoCheck</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.ItemDescription">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61690.489213</TimeChanged>
<TimeCreated>61747,63219.246866</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Type">
<Description>
IMD.7077
E = Free-form short description
F = Free-form
C = Code</Description>
<Type>%String</Type>
</Property>

<Property name="Ident">
<Description>
IMD.7009
CU = Customer unit
STM1 = Alternative Unit of Measure
PAC = Price Display required</Description>
<Type>%String</Type>
</Property>

<Property name="Textline1">
<Description>
IMD.7008</Description>
<Type>%String</Type>
</Property>

<Property name="Textline2">
<Description>
IMD.70082</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.C9BF0.ItemDescripE104D</DataLocation>
<DefaultData>ItemDescriptionDefaultData</DefaultData>
<IdLocation>^Alliance.C9BF0.ItemDescripE104D</IdLocation>
<IndexLocation>^Alliance.C9BF0.ItemDescripE104I</IndexLocation>
<StreamLocation>^Alliance.C9BF0.ItemDescripE104S</StreamLocation>
<Data name="ItemDescriptionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>Ident</Value>
</Value>
<Value name="4">
<Value>Textline1</Value>
</Value>
<Value name="5">
<Value>Textline2</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.Order">
<Super>Alliance.Common.Model.Core.ObjectHeader</Super>
<TimeChanged>61832,64744.14</TimeChanged>
<TimeCreated>61747,62019.170908</TimeCreated>

<Property name="EDIInfo">
<Type>Alliance.Common.Model.Order.EDIInfo</Type>
</Property>

<Property name="OrderNo">
<Description>
BGM 1004. Alphanumeric 10 chars</Description>
<Type>%String</Type>
</Property>

<Property name="Type">
<Description>
BGM 1001. Value should always be 220 for Order</Description>
<Type>%String</Type>
</Property>

<Property name="CodeListAgcy">
<Description>
BGM 3055. Should be 9 for EAN</Description>
<Type>%String</Type>
</Property>

<Property name="MsgFunction">
<Description>
BGM 1225. 9 original, 31 copy</Description>
<Type>%String</Type>
</Property>

<Property name="RespType">
<Description>
BGM 4343. </Description>
<Type>%String</Type>
</Property>

<Property name="DocumentDateTime">
<Description>
DTM 2005 = 137</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="LatestConfirmDate">
<Description>
DTM 2005 = 282</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="ReqDeliveryDate">
<Description>
DTM 2005 = 2</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="PickUpDate">
<Description>
DTM 2005 = 200</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="PromotionStart">
<Description>
DTM 2005 = 15</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="PromotionEnd">
<Description>
DTM 2005 = 16</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="DeliveryInstr">
<Description>
FTX 4551 = "DIN"</Description>
<Type>Alliance.Common.Model.Order.EDIFTX</Type>
</Property>

<Property name="PromotionInfo">
<Description>
FTX 4551 = "ADK"</Description>
<Type>Alliance.Common.Model.Order.EDIFTX</Type>
</Property>

<Property name="OriginatorRefCode">
<Description>
if SegmentGroup1 1153 = "ABO", then value of 1154
Originator's (Auftraggeber) Reference Code</Description>
<Type>%String</Type>
</Property>

<Property name="PromotionalDealNo">
<Description>
if SegmentGroup1 1153 = "PD", then value of 1154</Description>
<Type>%String</Type>
</Property>

<Property name="Buyer">
<Description>
The Buyer Information from SegmentGroup2</Description>
<Type>Alliance.Common.Model.Order.Buyer</Type>
</Property>

<Property name="Supplier">
<Description>
The Supplier Information from SegmentGroup2</Description>
<Type>Alliance.Common.Model.Order.Supplier</Type>
</Property>

<Property name="DeliveryParty">
<Description>
The DeliveryParty Information from SegmentGroup2</Description>
<Type>Alliance.Common.Model.Order.DeliveryParty</Type>
</Property>

<Property name="Invoicee">
<Description>
The Invoicee Information from SegmentGroup2</Description>
<Type>Alliance.Common.Model.Order.PartyInformation</Type>
</Property>

<Property name="StoreNumber">
<Description>
The StoreNumber Information from SegmentGroup2</Description>
<Type>Alliance.Common.Model.Order.PartyInformation</Type>
</Property>

<Property name="CurrencyInfo">
<Description>
The Currency Information SG7</Description>
<Type>Alliance.Common.Model.Order.CurrencyDetails</Type>
</Property>

<Property name="PaymentTerms">
<Description>
The Currency Information SG8.PAT</Description>
<Type>Alliance.Common.Model.Order.PaymentTerms</Type>
</Property>

<Property name="ModeOfTransport">
<Description>
Mode of Transport
Value of SG9.TDT.8067 where (SG9.TDT.8051 = "20" Main-carrier transport)
10 = See, 20 = Bahn, 30 = Strasse, 40 = Luft, 50 = Post, 60 = Kombiniert, 100 = Kurrier</Description>
<Type>%String</Type>
</Property>

<Property name="DeliveryTerms">
<Description>
SG11(1).TOD(1)</Description>
<Type>Alliance.Common.Model.Order.DeliveryTerms</Type>
</Property>

<Property name="OrderLines">
<Description>
Reference to the order lines</Description>
<Type>Alliance.Common.Model.Order.OrderLine</Type>
<Cardinality>children</Cardinality>
<Collection>list</Collection>
<Inverse>Order</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="%OnNew">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%New</METHOD> method to 
provide notification that a new instance of an object is being created.

<P>If this method returns an error then the object will not be created.
<p>It is passed the arguments provided in the %New call.
When customizing this method, override the arguments with whatever variables and types you expect to receive from %New().
For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
<p>Method %OnNew(dob as %Date = "", name as %Name = "") as %Status]]></Description>
<FormalSpec>initvalue:%CacheString</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set ..Status = 1000
	set ..StatusChanged = $ZDT($ZUTIL(188),3)
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>OrderDefaultData</DefaultData>
<Data name="OrderDefaultData">
<Subscript>"Order"</Subscript>
<Value name="1">
<Value>EDIInfo</Value>
</Value>
<Value name="2">
<Value>OrderNo</Value>
</Value>
<Value name="3">
<Value>Type</Value>
</Value>
<Value name="4">
<Value>CodeListAgcy</Value>
</Value>
<Value name="5">
<Value>MsgFunction</Value>
</Value>
<Value name="6">
<Value>RespType</Value>
</Value>
<Value name="7">
<Value>DocumentDateTime</Value>
</Value>
<Value name="8">
<Value>LatestConfirmDate</Value>
</Value>
<Value name="9">
<Value>ReqDeliveryDate</Value>
</Value>
<Value name="10">
<Value>PickUpDate</Value>
</Value>
<Value name="11">
<Value>PromotionStart</Value>
</Value>
<Value name="12">
<Value>PromotionEnd</Value>
</Value>
<Value name="13">
<Value>DeliveryInstr</Value>
</Value>
<Value name="14">
<Value>PromotionInfo</Value>
</Value>
<Value name="15">
<Value>OriginatorRefCode</Value>
</Value>
<Value name="16">
<Value>PromotionalDealNo</Value>
</Value>
<Value name="17">
<Value>Buyer</Value>
</Value>
<Value name="18">
<Value>Supplier</Value>
</Value>
<Value name="19">
<Value>DeliveryParty</Value>
</Value>
<Value name="20">
<Value>Invoicee</Value>
</Value>
<Value name="21">
<Value>StoreNumber</Value>
</Value>
<Value name="22">
<Value>CurrencyInfo</Value>
</Value>
<Value name="23">
<Value>PaymentTerms</Value>
</Value>
<Value name="24">
<Value>ModeOfTransport</Value>
</Value>
<Value name="25">
<Value>DeliveryTerms</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.OrderLine">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61690.910063</TimeChanged>
<TimeCreated>61747,63290.600743</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="LineNo">
<Description>
SG25().LIN.1082</Description>
<Type>%String</Type>
</Property>

<Property name="ItemNo">
<Description>
SG25().LIN.C212.7140</Description>
<Type>%String</Type>
</Property>

<Property name="ItemNoType">
<Description>
SG25().LIN.C212.7143</Description>
<Type>%String</Type>
</Property>

<Property name="SubLineIndicator">
<Description>
SG25().LIN.C829.5495</Description>
<Type>%String</Type>
</Property>

<Property name="LineNoRef">
<Description>
SG25().LIN.C829.1082
Reference to lead Line No of sub line no (only wehen subline)</Description>
<Type>%String</Type>
</Property>

<Property name="Configuration">
<Description>
SG25().LIN.C829.1082
I=Included in the configuration (only wehen subline)</Description>
<Type>%String</Type>
</Property>

<Property name="GTINNo">
<Description>
Additional article identification number GTIN CU
PIA: Value of 7140 when 7143 = "EN"</Description>
<Type>%String</Type>
</Property>

<Property name="GTINNoType">
<Description>
PIA: Value of 3055 when 7143 = "EN"
9 = EAN</Description>
<Type>%String</Type>
</Property>

<Property name="BuyerArticleNo">
<Description>
Additional article identification number of Buyer
PIA: Value of 7140 when 7143 = "IN"</Description>
<Type>%String</Type>
</Property>

<Property name="SupplierArticleNo">
<Description>
Additional article identification number of Supplier
PIA: Value of 7140 when 7143 = "SA"</Description>
<Type>%String</Type>
</Property>

<Property name="ProductCategory">
<Description>
Additional article information for product category
PIA: Value of 7140 when 7143 = "GU"</Description>
<Type>%String</Type>
</Property>

<Property name="Order">
<Type>Alliance.Common.Model.Order.Order</Type>
<Cardinality>parent</Cardinality>
<Inverse>OrderLines</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ItemDescriptions">
<Description>
Reference to the parent order
Item Descriptions. Key is ItemDescription Type</Description>
<Type>ItemDescription</Type>
<Collection>array</Collection>
</Property>

<Property name="OrderedQty">
<Description>
SG25().QTY(). Value of 6060 where 6063 = "21"
Ordered Quantity</Description>
<Type>%String</Type>
</Property>

<Property name="OrderedQtyUoM">
<Description>
SG25().QTY(): Value of 6411 where 6063 = "21"
Unit of Measure of Ordered Quantity</Description>
<Type>%String</Type>
</Property>

<Property name="BatchNo">
<Description>
SG25().GIN(): Value of 7402 where 7405 = "BX"
Batch Number</Description>
<Type>%String</Type>
</Property>

<Property name="MKSTextLines">
<Description>
SG25().FTX(): Value of 4400-44005 where 4451 = "MKS"
Additional Marks/numbers Information</Description>
<Type>%String</Type>
<Collection>list</Collection>
</Property>

<Property name="ADKText">
<Description>
SG25().FTX(): Value of 4400 where 4451 = "ADK"
Additional Marks/numbers Information</Description>
<Type>%String</Type>
</Property>

<Property name="PriceNet">
<Description>
SG25().SG28() Element where PRI.5125 = "AAA"
Calculation Net Price with currency information</Description>
<Type>Alliance.Common.Model.Order.PriceInformation</Type>
</Property>

<Property name="PriceGross">
<Description>
SG25().SG28() Element where PRI.5125 = "INF"
Detail Gross Price inkl VAT with currency information</Description>
<Type>Alliance.Common.Model.Order.PriceInformation</Type>
</Property>

<Property name="DocumentRefNo">
<Description>
SG25().SG29(): Value of RFF.1154, where RFF.1153 = "CT"
Document Reference Number (Beleg Nr)</Description>
<Type>%String</Type>
</Property>

<Property name="DocumentRefPos">
<Description>
SG25().SG29(): Value of RFF.1156, where RFF.1153 = "CT"
Position in Reference Document (Positions Nr)</Description>
<Type>%String</Type>
</Property>

<Property name="PromotionNo">
<Description>
SG25().SG29(): Value of RFF.1156, where RFF.1153 = "PD"
Promotion Number (Aktions-Nr)</Description>
<Type>%String</Type>
</Property>

<Property name="PromotionStart">
<Description>
SG25().SG29(): Value of DTM, where DTM.2005 = "15"
Promotion Start Date</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Property name="PromotionEnd">
<Description>
SG25().SG29(): Value of DTM, where DTM.2005 = "16"
Promotion End Date</Description>
<Type>Alliance.Common.Model.Order.EDIDTM</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("OrderLines")</DataLocation>
<DefaultData>OrderLineDefaultData</DefaultData>
<IdLocation>^Alliance.Common.Mode9BF0.OrderC("OrderLines")</IdLocation>
<IndexLocation>^Alliance.Common9BF0.OrderLineI</IndexLocation>
<StreamLocation>^Alliance.Common9BF0.OrderLineS</StreamLocation>
<Data name="ItemDescriptions">
<Attribute>ItemDescriptions</Attribute>
<Structure>subnode</Structure>
<Subscript>"ItemDescriptions"</Subscript>
</Data>
<Data name="OrderLineDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>LineNo</Value>
</Value>
<Value name="3">
<Value>ItemNo</Value>
</Value>
<Value name="4">
<Value>ItemNoType</Value>
</Value>
<Value name="5">
<Value>SubLineIndicator</Value>
</Value>
<Value name="6">
<Value>LineNoRef</Value>
</Value>
<Value name="7">
<Value>Configuration</Value>
</Value>
<Value name="8">
<Value>GTINNo</Value>
</Value>
<Value name="9">
<Value>GTINNoType</Value>
</Value>
<Value name="10">
<Value>BuyerArticleNo</Value>
</Value>
<Value name="11">
<Value>SupplierArticleNo</Value>
</Value>
<Value name="12">
<Value>ProductCategory</Value>
</Value>
<Value name="13">
<Value>OrderedQty</Value>
</Value>
<Value name="14">
<Value>OrderedQtyUoM</Value>
</Value>
<Value name="15">
<Value>BatchNo</Value>
</Value>
<Value name="16">
<Value>MKSTextLines</Value>
</Value>
<Value name="17">
<Value>ADKText</Value>
</Value>
<Value name="18">
<Value>PriceNet</Value>
</Value>
<Value name="19">
<Value>PriceGross</Value>
</Value>
<Value name="20">
<Value>DocumentRefNo</Value>
</Value>
<Value name="21">
<Value>DocumentRefPos</Value>
</Value>
<Value name="22">
<Value>PromotionNo</Value>
</Value>
<Value name="23">
<Value>PromotionStart</Value>
</Value>
<Value name="24">
<Value>PromotionEnd</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.PartyInformation">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61691.052989</TimeChanged>
<TimeCreated>61747,63352.352308</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Type">
<Description>
SG2.NAD.3035
"BY" = Buyer</Description>
<Type>%String</Type>
</Property>

<Property name="PartyId">
<Description>
SG2.NAD.3039
Party identifying number</Description>
<Type>%String</Type>
</Property>

<Property name="CodeListResp">
<Description>
SG2.NAD.3055
9 = EAN</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.C9BF0.PartyInformEF5FD</DataLocation>
<DefaultData>PartyInformationDefaultData</DefaultData>
<IdLocation>^Alliance.C9BF0.PartyInformEF5FD</IdLocation>
<IndexLocation>^Alliance.C9BF0.PartyInformEF5FI</IndexLocation>
<StreamLocation>^Alliance.C9BF0.PartyInformEF5FS</StreamLocation>
<Data name="PartyInformationDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>PartyId</Value>
</Value>
<Value name="4">
<Value>CodeListResp</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.PaymentTerms">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61691.134061</TimeChanged>
<TimeCreated>61747,63376.650965</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="TermsType">
<Description>
SG8(1).PAT.4279
1 = Basic</Description>
<Type>%String</Type>
</Property>

<Property name="PaymentTime">
<Description>
SG8(1).PAT.C112.2475
8= Date of confirmation of order received (Gegen Versandbestaetigung)
21= ??? (Nach Wareneingang)
ZZZ= ??? (Bei Sicht)</Description>
<Type>%String</Type>
</Property>

<Property name="TimeRelation">
<Description>
SG8(1).PAT.C112.2009
3 = After reference</Description>
<Type>%String</Type>
</Property>

<Property name="PeriodType">
<Description>
SG8(1).PAT.C112.2151
D = Day</Description>
<Type>%String</Type>
</Property>

<Property name="PeriodNr">
<Description>
SG8(1).PAT.4279
Numer of PeriodType (i.e. days) until Payment</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.Comm9BF0.PaymentTermsD</DataLocation>
<DefaultData>PaymentTermsDefaultData</DefaultData>
<IdLocation>^Alliance.Comm9BF0.PaymentTermsD</IdLocation>
<IndexLocation>^Alliance.Comm9BF0.PaymentTermsI</IndexLocation>
<StreamLocation>^Alliance.Comm9BF0.PaymentTermsS</StreamLocation>
<Data name="PaymentTermsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>TermsType</Value>
</Value>
<Value name="3">
<Value>PaymentTime</Value>
</Value>
<Value name="4">
<Value>TimeRelation</Value>
</Value>
<Value name="5">
<Value>PeriodType</Value>
</Value>
<Value name="6">
<Value>PeriodNr</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.PriceInformation">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61691.22479</TimeChanged>
<TimeCreated>61747,63421.554822</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Qualifier">
<Description>
Field: SG25().SG28().PRI.5125
AAA = Calculation Net (Netto-Einstandspreis exkl. MWST)
INF = Information (Detail-Preis inkl. MWST)</Description>
<Type>%String</Type>
</Property>

<Property name="Price">
<Description>
Field: SG25().SG28().PRI.5118</Description>
<Type>%String</Type>
</Property>

<Property name="Type">
<Description>
Field: SG25().SG28().PRI.5387</Description>
<Type>%String</Type>
</Property>

<Property name="UnitPriceBase">
<Description>
Field: SG25().SG28().PRI.5284</Description>
<Type>%String</Type>
</Property>

<Property name="UnitOfMeasure">
<Description>
Field: SG25().SG28().PRI.6411</Description>
<Type>%String</Type>
</Property>

<Property name="CurrencyDetails">
<Description>
Field: SG25().SG28().CUX.6347
2 = Reference Currency</Description>
<Type>%String</Type>
</Property>

<Property name="CurrencyCode">
<Description>
Field: SG25().SG28().CUX.6345
ISO 4217</Description>
<Type>%String</Type>
</Property>

<Property name="CurrencyQual">
<Description>
Field: SG25().SG28().CUX.6345
Currency Qualifier
9 = Order currency</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.C9BF0.PriceInformC1F3D</DataLocation>
<DefaultData>PriceInformationDefaultData</DefaultData>
<IdLocation>^Alliance.C9BF0.PriceInformC1F3D</IdLocation>
<IndexLocation>^Alliance.C9BF0.PriceInformC1F3I</IndexLocation>
<StreamLocation>^Alliance.C9BF0.PriceInformC1F3S</StreamLocation>
<Data name="PriceInformationDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Qualifier</Value>
</Value>
<Value name="3">
<Value>Price</Value>
</Value>
<Value name="4">
<Value>Type</Value>
</Value>
<Value name="5">
<Value>UnitPriceBase</Value>
</Value>
<Value name="6">
<Value>UnitOfMeasure</Value>
</Value>
<Value name="7">
<Value>CurrencyDetails</Value>
</Value>
<Value name="8">
<Value>CurrencyCode</Value>
</Value>
<Value name="9">
<Value>CurrencyQual</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Common.Model.Order.Supplier">
<Super>Alliance.Common.Model.Order.PartyInformation</Super>
<TimeChanged>61747,63445</TimeChanged>
<TimeCreated>61747,63445.627017</TimeCreated>

<Property name="ReferenceQual">
<Description>
SG2.SG3.RFF.1153
Reference Qualifier. YC1 Additional party identification (EAN Code)</Description>
<Type>%String</Type>
</Property>

<Property name="ReferenceNo">
<Description>
SG2.SG3.RFF.1153
Reference Number/Coop Supplier No</Description>
<Type>%String</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>SupplierDefaultData</DefaultData>
<Data name="SupplierDefaultData">
<Structure>listnode</Structure>
<Subscript>"Supplier"</Subscript>
<Value name="1">
<Value>ReferenceQual</Value>
</Value>
<Value name="2">
<Value>ReferenceNo</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.AS2.Notification">
<Description>

	To create an AS2.Notification, do something like this:

	set type = ##class(Alliance.Ens.AS2.NotificationType).Arrived()
	set notification = ##class(Alliance.Ens.AS2.Notification).new(.status, type, "ID", "Sender", "Receiver", "FileName", "Log")
</Description>
<Super>%Persistent,%XML.Adaptor,%Populate</Super>
<TimeChanged>61935,61691.421203</TimeChanged>
<TimeCreated>61805,44812.600984</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	-----	Parameters			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Properties			-----------------------------------------------

]]></Content>
</UDLText>

<Property name="typeKey">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="typeValue">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="ident">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="sender">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="receiver">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="filename">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="log">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="timestampCreated">
<Type>Base.DateTime</Type>
</Property>

<UDLText name="T">
<Content><![CDATA[
//	-----	SQL Queries			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="%OnNew">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set timestampCreated = ##class(Base.DateTime).now()

	quit $$$OK
]]></Implementation>
</Method>

<Method name="new">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&status:%Status,type:Alliance.Ens.AS2.NotificationType,ident:%String,sender:%String,receiver:%String,filename:%String,log:%String]]></FormalSpec>
<ReturnType>Alliance.Ens.AS2.Notification</ReturnType>
<Implementation><![CDATA[
	set notification = ..%New()

	set notification.typeKey = type.key
	set notification.typeValue = type.value
	set notification.ident = ident
	set notification.sender = sender
	set notification.receiver = receiver
	set notification.filename = filename
	set notification.log = log

	set status = notification.%Save()
	if ($$$ISERR(status))		quit $$$NULLOREF

	quit notification
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<Method name="getType">
<ReturnType>Alliance.Ens.AS2.NotificationType</ReturnType>
<Implementation><![CDATA[	quit ##class(Alliance.Ens.AS2.NotificationType).get(..typeKey)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Support				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="toString">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	quit "[AS2.Notification:" _
		..typeValue _ ":" _
		..ident _ ":" _
		..sender _ ":" _
		..receiver _ ":" _
		..filename _ ":" _
		..timestampCreated.toString() _ 
		"]"
]]></Implementation>
</Method>

<Method name="write">
<Implementation><![CDATA[	write !, ..toString()
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Test				-----------------------------------------------

]]></Content>
</UDLText>

<Method name="test">
<Description>
		do ##class(Alliance.Ens.AS2.Notification).test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	do ##class(Alliance.Ens.AS2.Notification).%DeleteExtent()

	set status = $$$OK

	set type = ##class(Alliance.Ens.AS2.NotificationType).Arrived()
	set n = ..new(.status, type, "42", "Sender", "Receiver", "C:/somewhere/here/this", "Log")
	do n.write()

	set type = ##class(Alliance.Ens.AS2.NotificationType).Sent()
	set n = ..new(.status, type, "43", "Me", "You", "C:/nowhere/here/this", "Log")
	do n.write()

	set type = ##class(Alliance.Ens.AS2.NotificationType).Error()
	set n = ..new(.status, type, "44", "He", "She", "C:/anywhere/here/this", "Log")
	do n.write()
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.Ens.AS2.NotificationD</DataLocation>
<DefaultData>NotificationDefaultData</DefaultData>
<IdLocation>^Alliance.Ens.AS2.NotificationD</IdLocation>
<IndexLocation>^Alliance.Ens.AS2.NotificationI</IndexLocation>
<StreamLocation>^Alliance.Ens.AS2.NotificationS</StreamLocation>
<Data name="NotificationDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Type</Value>
</Value>
<Value name="3">
<Value>Id</Value>
</Value>
<Value name="4">
<Value>type</Value>
</Value>
<Value name="5">
<Value>id</Value>
</Value>
<Value name="6">
<Value>sender</Value>
</Value>
<Value name="7">
<Value>receiver</Value>
</Value>
<Value name="8">
<Value>filename</Value>
</Value>
<Value name="9">
<Value>log</Value>
</Value>
<Value name="10">
<Value>timestamp</Value>
</Value>
<Value name="11">
<Value>ident</Value>
</Value>
<Value name="12">
<Value>timestampCreated</Value>
</Value>
<Value name="13">
<Value>typeKey</Value>
</Value>
<Value name="14">
<Value>typeValue</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.AS2.NotificationType">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61832,65572.008646</TimeChanged>
<TimeCreated>61805,44577.198996</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Creation	-----------------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Ens.AS2.NotificationType).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	set type = ..new("100", "Received",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("200", "Sent",,, .status)
	quit:($$$ISERR(status)) status

	set type = ..new("300", "Error",,, .status)
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="Arrived">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.AS2.NotificationType</ReturnType>
<Implementation><![CDATA[	quit ..get("100")
]]></Implementation>
</Method>

<Method name="Sent">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.AS2.NotificationType</ReturnType>
<Implementation><![CDATA[	quit ..get("200")
]]></Implementation>
</Method>

<Method name="Error">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.AS2.NotificationType</ReturnType>
<Implementation><![CDATA[	quit ..get("300")
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Instance Methods	-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	Such methods are recommended to free the users from knowing what the different keys actually mean

]]></Content>
</UDLText>

<Method name="isArrived">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "100")
]]></Implementation>
</Method>

<Method name="isSent">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "200")
]]></Implementation>
</Method>

<Method name="isError">
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit (..key = "300")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.Adapter.SOAPInboundAdapterNoLog">
<IncludeCode>noLOGINFO</IncludeCode>
<Super>EnsLib.SOAP.InboundAdapter</Super>
<TimeChanged>61835,34134.285349</TimeChanged>
<TimeCreated>61835,33006.69139</TimeCreated>

<Method name="OnTask">
<Description>
	Exact copy of method OnTask() from class EnsLib.TCP.InboundAdapter</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	#; $ZU(53) means it's a tcp spawned child worker job
	If ""'=$ZU(53) {
		Set tSC=$$$OK, $ZT="ChildTrap"
		Use ..Device
		Set $ZT="OCTrap"
		Set tSC=..OnConnected()
		If $$$ISERR(tSC) $$$sysTRACE("OnConnected() returned %QuitTask="_..BusinessHost.%QuitTask_", '"_$$$StatusText(tSC)_"'")
		Set $ZT="ChildTrap"
		
		If '..StayConnected||$$$ISERR(tSC) { Do ..Disconnect() }
		Else { Do ..TestConnection() }
		If '..Connected Set ..BusinessHost.%QuitTask=1  Set tTxt="Closing TCP Connection Job"  If ..%logConnections { $$$LOGINFO(tTxt) } Else { $$$sysTRACE(tTxt) }
	} Else {
		#; ... otherwise it's the master listener job
		Set tSC=$$$OK, $ZT="Trap"
		Do {
			Use:..Connected ..Device
			Do:..Connected ..TestConnection()
			Set tWasConnected=..Connected
			If '..Connected {
				If ""=..%outIPAddr {
					If ..%PoolLimit<=1 || (..%PoolLimit>$G(^CacheTemp.EnsTCPJobs($Job,"children"))) {
						$$$catTRACE("connwait","Waiting for connection on port "_..Port_" with timeout "_..CallInterval)
						$$$SetJobMonitor(..BusinessHost.%ConfigName,$$$SystemName_":"_$Job,$$$eMonitorConnected,".|"_$$$timeUTC)
						Use ..Device
						Read tDummy:..CallInterval Set tNewConnection=$Test
						If tNewConnection {
							Set tRemote=$zu(111,0), ps=$S($L(tRemote)>6:"|",1:":"), tRemoteIP=$$$IPBinaryToText($E(tRemote,1,*-2)), tRemotePort=$ZWAscii($Reverse($E(tRemote,*-1,*))), tRemote=tRemoteIP_ps_tRemotePort
							If ""=..AllowedIPAddresses {
								Set tIPOK=1
							} Else {
								Set tIPOK=0
								For i=1:1:$L(..AllowedIPAddresses,",") { Set tIP=$ZStrip($P(..AllowedIPAddresses,",",i),"<>W")  Continue:""=tIP
									If $P(tIP,ps)=tRemoteIP && $Case($P(tIP,ps,2), "":1, tRemotePort:1, :0) Set tIPOK=1 Quit
								}
							}
							If tIPOK { Set ..IOAddr=..Port_"<-"_tRemote_$S(""=..SSLConfig:"",1:"/SSL="_..SSLConfig), ..Connected=1 }
							Else { Write *-2  $$$LOGWARNING("Rejected connection attempt on port "_..Port_" from "_tRemote_" which was not found in AllowedIPAddresses list '"_..AllowedIPAddresses_"'") }
							Set ..%tracedLimit=0 ; reset when below pool limit
						}
					} Else { ; limit reached; don't accept new connections
						If '..%warnedLimit { Set ..%warnedLimit=1 $$$LOGWARNING("Not accepting new connections because limit of "_..%PoolLimit_" connection jobs has been reached") }
						ElseIf '..%tracedLimit { Set ..%tracedLimit=1 $$$sysTRACE("Not accepting new connections because limit of "_..%PoolLimit_" connection jobs has been reached") }
					}
				}
				Else { ; If in connect-and-read mode
					If ..StayConnected=-1 || ..%OutDataReady {
						Set tSC=..ConnectOut(..CallInterval)  If $$$ISERR(tSC) { Set tTxt=$$$StatusDisplayString(tSC)
							If tTxt'=..%warnedConnect { $$$LOGWARNING(tTxt)  Set ..%warnedConnect=tTxt }
							Else { $$$catTRACE("connwait",tTxt) }
							Set tSC=$$$OK // timeout is not fatal at this point, but do log it
						} Else { Set ..%warnedConnect="" }
					} Else {
						$$$catTRACE("connwait","Not attempting to connect out because no output data is ready")
					}
				}
			}
			If ..Connected {
				If 'tWasConnected {
					Set tTxt="New connection"_$S(""=..%outIPAddr:" on port "_..Port_" from "_tRemote, 1:" to "_..%outIPAddr_$S(..%outIPAddr[":":"|",1:":")_..Port)
					If ..%logConnections { $$$LOGINFO(tTxt) } Else { $$$sysTRACE(tTxt) }
					If ""=..%outIPAddr {
						If ..JobPerConnection {
							Job ClassMethod^%apiOBJ(..%ClassName(1),"connectedJob",..BusinessHost.%ConfigName,..%PoolLimit):(:65560)
							$$$sysTRACE("spawned TCP socket reader '"_$zchild_"'")
							Do ..Disconnect()
							#; don't hang around before listening again
							Set ..BusinessHost.%WaitForNextCallInterval=0
							Quit
						}
						Set:'$IsObject(..Socket) ..Socket=..SocketNewObject()
						Do ..Socket.Attach(..Device)
						Set:""'=..Terminators ..Socket.LineTerminator=..Terminators
						Set $ZT="OnConnectTrap"
						Set tSC=..BusinessHost.OnConnect(0)  If $$$ISERR(tSC) Do ..Disconnect()  Quit
OnConnectTrap
					}
					If ""'=..BusinessHost.%LastReportedError && ("ERROR <Ens>ErrGeneral: No Connection made "=$E(..BusinessHost.%LastReportedError,1,$L("ERROR <Ens>ErrGeneral: No Connection made "))) {
						Set ..BusinessHost.%LastReportedError=""
						$$$SetHostMonitor(..BusinessHost.%ConfigName,$$$eMonitorStatus,"OK")
					}
				}
				Set $ZT="OCTrap"
				set tSC=..OnConnected()
				Set $ZT="Trap"
				Do:'..StayConnected ..Disconnect()
OCContinue
				If $$$ISERR(tSC) $$$sysTRACE("OnConnected() returned %QuitTask="_..BusinessHost.%QuitTask_", '"_$$$StatusText(tSC)_"'")
			} ElseIf ..StayConnected<0&&'..JobPerConnection {
				Set tSC=$$$ERROR($$$EnsErrGeneral,"No Connection made "_$S(""'=..%outIPAddr:"to "_..%outIPAddr_$S(..%outIPAddr[":":"|",1:":"), 1:"on port ")_..Port_" within interval "_..CallInterval)
			}
		} While 0
	}
Exit
	#; $$$sysTRACE("Exit from OnTask: "_tSC)
	Use ..OldIO
	$$$ACLOSEIOLOGENTRY(tSC,"StillConnected="_..Connected,$$$NULLOREF)
	Quit tSC
Trap
 	Set $ZT="ChildTrap",tSC=$$$SystemError
	#; Reopen the device in case it got messed up
	If (""=..%outIPAddr) {
		$$$LOGINFO("Re-opening Port "_..Port_" to listen for incoming connections")
		Use ..OldIO
		Close ..Device
		If ""=..SSLConfig {
			Open ..Device:(:..Port:..#Mode_"A-D":..Terminators:..#InputBufferSize:..#OutputBufferSize:..QSize:/TCPNOXY):..#OpenTimeout
		} Else {
			Open ..Device:(:..Port:..#Mode_"A-D":..Terminators:..#InputBufferSize:..#OutputBufferSize:..QSize:/TCPNOXY:/SSL=..SSLConfig):..#OpenTimeout
		}
		If $Test=0 Set tSC=$$$EnsError($$$EnsErrTCPListen,..Port,..#OpenTimeout,"Open """_..Device_""":(:"_..Port_":"""_..#Mode_"A-D"_""":"_..Terminators_":"_..#InputBufferSize_":"_..#OutputBufferSize_":"_..QSize_":/SSL="_..SSLConfig_"):"_..#OpenTimeout)
		Use ..Device
		Do SetIO^%NLS("RAW") ; turn off translation mode
	} Else { ; If in connect-and-read mode
		Do:..IsReadError(tSC) ..Disconnect()
	}
	Goto Exit
ChildTrap
 	Set $ZT="",tSC=$$$SystemError
	Goto Exit
OCTrap
 	Set $ZT="Trap",tSC=$$$SystemError
	Goto OCContinue
]]></Implementation>
</Method>

<Method name="Disconnect">
<Description>
	Exact copy of method Disconnect() from class EnsLib.TCP.InboundAdapter</Description>
<Implementation><![CDATA[
	Set $ZT="Trap",tSC=$$$OK
	If ..Connected {
		Set tTxt="Disconnecting from "_..IOAddr
		If ..%logConnections { $$$LOGINFO(tTxt) } Else { $$$sysTRACE(tTxt) }
	}
	If ""=..%outIPAddr {
		Use ..Device Write *-2 ; go ahead and try even if we think we're already disconnected - we'll just trap out or fail if we are
	}
Exit
	Set ..IOAddr="", ..Connected=0
	Use:$IO=..Device ..OldIO
	Close:""'=..%outIPAddr ..Device
	Quit
Trap
 	Set $ZT="",tSC=$$$SystemError
	Goto Exit
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DTL.EDI2ModelOrder">
<ClassType/>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.DataTransformDTL</Super>
<TimeChanged>61830,59104.521814</TimeChanged>
<TimeCreated>61747,65412.534918</TimeCreated>

<XData name="DTL">
<XMLNamespace>http://www.intersystems.com/dtl</XMLNamespace>
<Data><![CDATA[
<?xml version="1.0" ?>
<transform targetClass='Alliance.Ens.Message.OrderRequest' sourceClass='EnsLib.EDI.EDIFACT.Document' sourceDocType='D96A:ORDERS' create='new' language='objectscript'>
<assign property='target.Order.EDIInfo.MsgRefNo' value='source.{UNH-1:0062}' action='set'/>
<assign property='target.Order.EDIInfo.MsgTypeIdent' value='source.{UNH-1:S009(1).0065}' action='set'/>
<assign property='target.Order.EDIInfo.MsgTypeVerNo' value='source.{UNH-1:S009(1).0052}' action='set'/>
<assign property='target.Order.EDIInfo.MsgRefRelNo' value='source.{UNH-1:S009(1).0054}' action='set'/>
<assign property='target.Order.EDIInfo.CntrlAcy' value='source.{UNH-1:S009(1).0051}' action='set'/>
<assign property='target.Order.EDIInfo.AssocCode' value='source.{UNH-1:S009(1).0057}' action='set'/>
<assign property='target.Order.Type' value='source.{BGM-2:C002.1001}' action='set'/>
<assign property='target.Order.CodeListAgcy' value='source.{BGM-2:C002.3055}' action='set'/>
<assign property='target.Order.OrderNo' value='source.{BGM-2:1004}' action='set'/>
<assign property='target.Order.MsgFunction' value='source.{BGM-2:1225}' action='set'/>
<assign property='target.Order.RespType' value='source.{BGM-2:4343}' action='set'/>
<foreach property='source.{DTM-3()}' key='dtm'>
<if condition='source.{DTM-3(dtm):C507.2005} = "137"'>
<true>
<assign property='target.Order.DocumentDateTime.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.DocumentDateTime.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.DocumentDateTime.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{DTM-3(dtm):C507.2005} = "282"'>
<true>
<assign property='target.Order.LatestConfirmDate.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.LatestConfirmDate.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.LatestConfirmDate.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{DTM-3(dtm):C507.2005} = "2"'>
<true>
<assign property='target.Order.ReqDeliveryDate.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.ReqDeliveryDate.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.ReqDeliveryDate.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{DTM-3(dtm):C507.2005} = "200"'>
<true>
<assign property='target.Order.PickUpDate.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.PickUpDate.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.PickUpDate.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{DTM-3(dtm):C507.2005} = "15"'>
<true>
<assign property='target.Order.PromotionStart.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.PromotionStart.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.PromotionStart.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{DTM-3(dtm):C507.2005} = "16"'>
<true>
<assign property='target.Order.PromotionEnd.DTType' value='source.{DTM-3(dtm):C507.2005}' action='set'/>
<assign property='target.Order.PromotionEnd.Data' value='source.{DTM-3(dtm):C507.2380}' action='set'/>
<assign property='target.Order.PromotionEnd.Format' value='source.{DTM-3(dtm):C507.2379}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{FTX-7()}' key='ftx'>
<if condition='source.{FTX-7(ftx):4451} = "DIN"'>
<true>
<assign property='target.Order.DeliveryInstr.Subject' value='source.{FTX-7(1):4451}' action='set'/>
</true>
</if>
<assign property='target.Order.DeliveryInstr.Line1' value='source.{FTX-7(1):C108(1).4440}' action='set'/>
<assign property='target.Order.DeliveryInstr.Line2' value='source.{FTX-7(1):C108(1).44402}' action='set'/>
<assign property='target.Order.DeliveryInstr.Line3' value='source.{FTX-7(1):C108(1).44403}' action='set'/>
<assign property='target.Order.DeliveryInstr.Line4' value='source.{FTX-7(1):C108(1).44404}' action='set'/>
<assign property='target.Order.DeliveryInstr.Line5' value='source.{FTX-7(1):C108(1).44405}' action='set'/>
<if condition='source.{FTX-7(ftx):4451} = "ADK"'>
<true>
<assign property='target.Order.PromotionInfo.Subject' value='source.{FTX-7(1):4451}' action='set'/>
<assign property='target.Order.PromotionInfo.Line1' value='source.{FTX-7(1):C108(1).4440}' action='set'/>
<assign property='target.Order.PromotionInfo.Line2' value='source.{FTX-7(1):C108(1).44402}' action='set'/>
<assign property='target.Order.PromotionInfo.Line3' value='source.{FTX-7(1):C108(1).44403}' action='set'/>
<assign property='target.Order.PromotionInfo.Line4' value='source.{FTX-7(1):C108(1).44404}' action='set'/>
<assign property='target.Order.PromotionInfo.Line5' value='source.{FTX-7(1):C108(1).44405}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup1()}' key='sg1'>
<if condition='source.{SegmentGroup1(sg1).RFF-9:C506.1153} = "ABO"'>
<true>
<assign property='target.Order.OriginatorRefCode' value='source.{SegmentGroup1(sg1).RFF-9:C506.1154}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup1(sg1).RFF-9:C506.1153} = "PD"'>
<true>
<assign property='target.Order.PromotionalDealNo' value='source.{SegmentGroup1(sg1).RFF-9:C506.1154}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup2()}' key='sg2'>
<if condition='source.{SegmentGroup2(sg2).NAD-12:3035} = "BY"'>
<true>
<assign property='target.Order.Buyer.Type' value='source.{SegmentGroup2(sg2).NAD-12:3035}' action='set'/>
<assign property='target.Order.Buyer.PartyId' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3039}' action='set'/>
<assign property='target.Order.Buyer.CodeListResp' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3055}' action='set'/>
<assign property='target.Order.Buyer.ReferenceQual' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.1153}' action='set'/>
<assign property='target.Order.Buyer.ReferenceNo' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.1154}' action='set'/>
<assign property='target.Order.Buyer.ReferenceTradingEmpty' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.1156}' action='set'/>
<assign property='target.Order.Buyer.ReferenceTradingGood' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.4000}' action='set'/>
<if condition='source.{SegmentGroup2(sg2).SegmentGroup5(1).CTA-22:3139} = "OC"'>
<true>
<assign property='target.Order.Buyer.ContactName' value='source.{SegmentGroup2(sg2).SegmentGroup5(1).CTA-22:C056(1).3412}' action='set'/>
</true>
</if>
<foreach property='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23()}' key='com'>
<if condition='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3155} = "TE"'>
<true>
<assign property='target.Order.Buyer.ContactTel' value='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3148}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3155} = "FX"'>
<true>
<assign property='target.Order.Buyer.ContactFax' value='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3148}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3155} = "EM"'>
<true>
<assign property='target.Order.Buyer.ContactEMail' value='source.{SegmentGroup2(sg2).SegmentGroup5(1).COM-23(com):C076.3148}' action='set'/>
</true>
</if>
</foreach>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).NAD-12:3035} = "SU"'>
<true>
<assign property='target.Order.Supplier.Type' value='source.{SegmentGroup2(sg2).NAD-12:3035}' action='set'/>
<assign property='target.Order.Supplier.PartyId' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3039}' action='set'/>
<assign property='target.Order.Supplier.CodeListResp' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3055}' action='set'/>
<assign property='target.Order.Supplier.ReferenceQual' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.1153}' action='set'/>
<assign property='target.Order.Supplier.ReferenceNo' value='source.{SegmentGroup2(sg2).SegmentGroup3(1).RFF-16:C506.1154}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).NAD-12:3035} = "DP"'>
<true>
<assign property='target.Order.DeliveryParty.Type' value='source.{SegmentGroup2(sg2).NAD-12:3035}' action='set'/>
<assign property='target.Order.DeliveryParty.PartyId' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3039}' action='set'/>
<assign property='target.Order.DeliveryParty.CodeListResp' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3055}' action='set'/>
<assign property='target.Order.DeliveryParty.Name1' value='source.{SegmentGroup2(sg2).NAD-12:C080(1).3036}' action='set'/>
<assign property='target.Order.DeliveryParty.Name2' value='source.{SegmentGroup2(sg2).NAD-12:C080(1).30362}' action='set'/>
<assign property='target.Order.DeliveryParty.Telephone' value='source.{SegmentGroup2(sg2).NAD-12:C080(1).30363}' action='set'/>
<assign property='target.Order.DeliveryParty.Street' value='source.{SegmentGroup2(sg2).NAD-12:C059(1).3042}' action='set'/>
<assign property='target.Order.DeliveryParty.POBox' value='source.{SegmentGroup2(sg2).NAD-12:C059(1).30422}' action='set'/>
<assign property='target.Order.DeliveryParty.Station' value='source.{SegmentGroup2(sg2).NAD-12:C059(1).30423}' action='set'/>
<assign property='target.Order.DeliveryParty.City' value='source.{SegmentGroup2(sg2).NAD-12:3164}' action='set'/>
<assign property='target.Order.DeliveryParty.ZIPCode' value='source.{SegmentGroup2(sg2).NAD-12:3251}' action='set'/>
<assign property='target.Order.DeliveryParty.CountryCode' value='source.{SegmentGroup2(sg2).NAD-12:3207}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).NAD-12:3035} = "IV"'>
<true>
<assign property='target.Order.Invoicee.Type' value='source.{SegmentGroup2(sg2).NAD-12:3035}' action='set'/>
<assign property='target.Order.Invoicee.PartyId' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3039}' action='set'/>
<assign property='target.Order.Invoicee.CodeListResp' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3055}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup2(sg2).NAD-12:3035} = "SN"'>
<true>
<assign property='target.Order.StoreNumber.Type' value='source.{SegmentGroup2(sg2).NAD-12:3035}' action='set'/>
<assign property='target.Order.StoreNumber.PartyId' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3039}' action='set'/>
<assign property='target.Order.StoreNumber.CodeListResp' value='source.{SegmentGroup2(sg2).NAD-12:C082(1).3055}' action='set'/>
</true>
</if>
</foreach>
<assign property='target.Order.CurrencyInfo.DetailsQualifier' value='source.{SegmentGroup7(1).CUX-29:C504.6347}' action='set'/>
<assign property='target.Order.CurrencyInfo.CurrencyCoded' value='source.{SegmentGroup7(1).CUX-29:C504.6345}' action='set'/>
<assign property='target.Order.CurrencyInfo.CurrencyQualifier' value='source.{SegmentGroup7(1).CUX-29:C504.6343}' action='set'/>
<assign property='target.Order.PaymentTerms.TermsType' value='source.{SegmentGroup8(1).PAT-33:4279}' action='set'/>
<assign property='target.Order.PaymentTerms.TimeRelation' value='source.{SegmentGroup8(1).PAT-33:C112(1).2009}' action='set'/>
<assign property='target.Order.PaymentTerms.PeriodType' value='source.{SegmentGroup8(1).PAT-33:C112(1).2151}' action='set'/>
<assign property='target.Order.PaymentTerms.PeriodNr' value='source.{SegmentGroup8(1).PAT-33:C112(1).2152}' action='set'/>
<assign property='target.Order.PaymentTerms.PaymentTime' value='source.{SegmentGroup8(1).PAT-33:C112(1).2475}' action='set'/>
<foreach property='source.{SegmentGroup9()}' key='sg9'>
<if condition='source.{SegmentGroup9(sg9).TDT-38:8051} = "20"'>
<true>
<assign property='target.Order.ModeOfTransport' value='source.{SegmentGroup9(sg9).TDT-38:C220(1).8067}' action='set'/>
</true>
</if>
</foreach>
<assign property='target.Order.DeliveryTerms.TermsOfDel' value='source.{SegmentGroup11(1).TOD-43:4055}' action='set'/>
<assign property='target.Order.DeliveryTerms.TermsOfDelCode' value='source.{SegmentGroup11(1).TOD-43:C100(1).4053}' action='set'/>
<assign property='target.Order.DeliveryTerms.TermsOfDelPlace' value='source.{SegmentGroup11(1).TOD-43:C100(1).4052}' action='set'/>
<foreach property='source.{SegmentGroup25()}' key='position'>
<assign property='target.Order.OrderLines' value='##class(Alliance.Common.Model.Order.OrderLine).%New()' action='append'/>
<assign property='target.Order.OrderLines.(position).LineNo' value='source.{SegmentGroup25(position).LIN-94:1082}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemNo' value='source.{SegmentGroup25(position).LIN-94:C212(1).7140}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemNoType' value='source.{SegmentGroup25(position).LIN-94:C212(1).7143}' action='set'/>
<assign property='target.Order.OrderLines.(position).SubLineIndicator' value='source.{SegmentGroup25(position).LIN-94:C829(1).5495}' action='set'/>
<assign property='target.Order.OrderLines.(position).LineNoRef' value='source.{SegmentGroup25(position).LIN-94:C829(1).1082}' action='set'/>
<assign property='target.Order.OrderLines.(position).Configuration' value='source.{SegmentGroup25(position).LIN-94:7083}' action='set'/>
<foreach property='source.{SegmentGroup25(position).PIA-95()}' key='pia'>
<if condition='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7143} = "EN"'>
<true>
<assign property='target.Order.OrderLines.(position).GTINNo' value='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7140}' action='set'/>
<assign property='target.Order.OrderLines.(position).GTINNoType' value='source.{SegmentGroup25(position).PIA-95(pia):C212(1).3055}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7143} = "IN"'>
<true>
<assign property='target.Order.OrderLines.(position).BuyerArticleNo' value='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7140}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7143} = "SA"'>
<true>
<assign property='target.Order.OrderLines.(position).SupplierArticleNo' value='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7140}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7143} = "GU"'>
<true>
<assign property='target.Order.OrderLines.(position).ProductCategory' value='source.{SegmentGroup25(position).PIA-95(pia):C212(1).7140}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup25(position).IMD-96()}' key='imd'>
<assign property='tempKey' value='source.{SegmentGroup25(position).IMD-96(imd):7077}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemDescriptions' value='##class(Alliance.Common.Model.Order.ItemDescription).%New()' action='set' key='tempKey'/>
<assign property='target.Order.OrderLines.(position).ItemDescriptions.(tempKey).Type' value='source.{SegmentGroup25(position).IMD-96(imd):7077}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemDescriptions.(tempKey).Ident' value='source.{SegmentGroup25(position).IMD-96(imd):C273(1).7009}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemDescriptions.(tempKey).Textline1' value='source.{SegmentGroup25(position).IMD-96(imd):C273(1).7008}' action='set'/>
<assign property='target.Order.OrderLines.(position).ItemDescriptions.(tempKey).Textline2' value='source.{SegmentGroup25(position).IMD-96(imd):C273(1).70082}' action='set'/>
</foreach>
<foreach property='source.{SegmentGroup25(position).QTY-98()}' key='qty'>
<if condition='source.{SegmentGroup25(position).QTY-98(qty):C186.6063} = "21"'>
<true>
<assign property='target.Order.OrderLines.(position).OrderedQty' value='source.{SegmentGroup25(position).QTY-98(qty):C186.6060}' action='set'/>
<assign property='target.Order.OrderLines.(position).OrderedQtyUoM' value='source.{SegmentGroup25(position).QTY-98(qty):C186.6411}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup25(position).GIN-103()}' key='gin'>
<if condition='source.{SegmentGroup25(position).GIN-103(gin):7405} = "BX"'>
<true>
<assign property='target.Order.OrderLines.(position).BatchNo' value='source.{SegmentGroup25(position).GIN-103(gin):C208.7402}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup25(position).FTX-108()}' key='ftx'>
<if condition='source.{SegmentGroup25(position).FTX-108(ftx):4451} = "MKS"'>
<true>
<assign property='target.Order.OrderLines.(position).MKSTextLines' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.4440}' action='append'/>
<assign property='target.Order.OrderLines.(position).MKSTextLines' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.44402}' action='append'/>
<assign property='target.Order.OrderLines.(position).MKSTextLines' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.44403}' action='append'/>
<assign property='target.Order.OrderLines.(position).MKSTextLines' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.44404}' action='append'/>
<assign property='target.Order.OrderLines.(position).MKSTextLines' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.44405}' action='append'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).FTX-108(ftx):4451} = "ADK"'>
<true>
<assign property='target.Order.OrderLines.(position).ADKText' value='source.{SegmentGroup25(position).FTX-108(ftx):C108.4440}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup25(position).SegmentGroup28()}' key='sg28'>
<if condition='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5125} = "AAA"'>
<true>
<assign property='target.Order.OrderLines.(position).PriceNet.Qualifier' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5125}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.Price' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5118}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.Type' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5387}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.UnitPriceBase' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5284}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.UnitOfMeasure' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.6411}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.CurrencyDetails' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6347}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.CurrencyCode' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6345}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceNet.CurrencyQual' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6343}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5125} = "INF"'>
<true>
<assign property='target.Order.OrderLines.(position).PriceGross.Qualifier' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5125}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.Price' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5118}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.Type' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5387}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.UnitPriceBase' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.5284}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.UnitOfMeasure' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).PRI-119:C509.6411}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.CurrencyDetails' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6347}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.CurrencyCode' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6345}' action='set'/>
<assign property='target.Order.OrderLines.(position).PriceGross.CurrencyQual' value='source.{SegmentGroup25(position).SegmentGroup28(sg28).CUX-120:C504.6343}' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.{SegmentGroup25(position).SegmentGroup29()}' key='sg29'>
<if condition='source.{SegmentGroup25(position).SegmentGroup29(sg29).RFF-125:C506.1153} = "CT"'>
<true>
<assign property='target.Order.OrderLines.(position).DocumentRefNo' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).RFF-125:C506.1154}' action='set'/>
<assign property='target.Order.OrderLines.(position).DocumentRefPos' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).RFF-125:C506.1156}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).SegmentGroup29(sg29).RFF-125:C506.1153} = "PD"'>
<true>
<assign property='target.Order.OrderLines.(position).PromotionNo' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).RFF-125:C506.1154}' action='set'/>
<foreach property='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126()}' key='dtm'>
<if condition='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2005} = "15"'>
<true>
<assign property='target.Order.OrderLines.(position).PromotionStart.DTType' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2005}' action='set'/>
<assign property='target.Order.OrderLines.(position).PromotionStart.Data' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2380}' action='set'/>
<assign property='target.Order.OrderLines.(position).PromotionStart.Format' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2379}' action='set'/>
</true>
</if>
<if condition='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2005} = "16"'>
<true>
<assign property='target.Order.OrderLines.(position).PromotionEnd.DTType' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2005}' action='set'/>
<assign property='target.Order.OrderLines.(position).PromotionEnd.Data' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2380}' action='set'/>
<assign property='target.Order.OrderLines.(position).PromotionEnd.Format' value='source.{SegmentGroup25(position).SegmentGroup29(sg29).DTM-126(dtm):C507.2379}' action='set'/>
</true>
</if>
</foreach>
</true>
</if>
</foreach>
</foreach>
<foreach property='source.{CNT-211()}' key='cnt'>
<if condition='source.{CNT-211(cnt):C270.6069} = "2"'>
<true>
<assign property='target.Order.EDIInfo.LineCountCheck' value='source.{CNT-211(cnt):C270.6066}' action='set'/>
</true>
</if>
</foreach>
<assign property='target.Order.EDIInfo.SegementCountCheck' value='source.{UNT-216:0074}' action='set'/>
<assign property='target.Order.EDIInfo.MsgRefNoCheck' value='source.{UNT-216:0062}' action='set'/>
</transform>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.DTL.ModelDespatchAdvice2EDI">
<ClassType/>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.DataTransformDTL</Super>
<TimeChanged>62080,48336.139375</TimeChanged>
<TimeCreated>61699,61312.168823</TimeCreated>

<XData name="DTL">
<XMLNamespace>http://www.intersystems.com/dtl</XMLNamespace>
<Data><![CDATA[
<?xml version="1.0" ?>
<transform targetClass='EnsLib.EDI.EDIFACT.Document' targetDocType='D96A:DESADV' sourceClass='Alliance.Ens.Message.DespatchAdviceRequest' create='new' language='objectscript'>
<assign property='target.{UNH-1:0062}' value='source.DespatchAdvice.EDIHeader.MsgRefNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0065}' value='source.DespatchAdvice.EDIHeader.MsgTypeId' action='set'/>
<assign property='target.{UNH-1:S009(1).0052}' value='source.DespatchAdvice.EDIHeader.MsgTypeVerNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0054}' value='source.DespatchAdvice.EDIHeader.MsgTypeReleaseNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0051}' value='source.DespatchAdvice.EDIHeader.CntrlAcy' action='set'/>
<assign property='target.{UNH-1:S009(1).0057}' value='source.DespatchAdvice.EDIHeader.AssocAssCode' action='set'/>
<assign property='target.{BGM-2:C002.1001}' value='source.DespatchAdvice.ShpDocName' action='set'/>
<assign property='target.{BGM-2:C002.3055}' value='source.DespatchAdvice.ShpCodeListAgy' action='set'/>
<assign property='target.{BGM-2:1004}' value='source.DespatchAdvice.ShpNo' action='set'/>
<assign property='target.{BGM-2:1225}' value='source.DespatchAdvice.ShpMsgFnct' action='set'/>
<assign property='target.{DTM-3(1):C507.2005}' value='"137"' action='set'/>
<assign property='target.{DTM-3(1):C507.2380}' value='source.DespatchAdvice.MsgTimestamp.Data' action='set'/>
<assign property='target.{DTM-3(1):C507.2379}' value='"204"' action='set'/>
<assign property='target.{DTM-3(2):C507.2005}' value='"191"' action='set'/>
<assign property='target.{DTM-3(2):C507.2380}' value='source.DespatchAdvice.DeliveryTime.Data' action='set'/>
<assign property='target.{DTM-3(2):C507.2379}' value='"204"' action='set'/>
<assign property='target.{SegmentGroup1(1).RFF-8:C506.1154}' value='source.DespatchAdvice.OrderNo' action='set'/>
<assign property='target.{SegmentGroup1(1).RFF-8:C506.1153}' value='source.DespatchAdvice.OrderNoType' action='set'/>
<assign property='target.{SegmentGroup1(2).RFF-8:C506.1153}' value='"ABO"' action='set'/>
<assign property='target.{SegmentGroup1(2).RFF-8:C506.1154}' value='source.DespatchAdvice.SAPBusCase' action='set'/>
<assign property='target.{SegmentGroup2(1).NAD-11:3035}' value='source.DespatchAdvice.BuyerInfo.Type' action='set'/>
<assign property='target.{SegmentGroup2(1).NAD-11:C082(1).3039}' value='source.DespatchAdvice.BuyerInfo.PartyID' action='set'/>
<assign property='target.{SegmentGroup2(1).NAD-11:C082(1).3055}' value='source.DespatchAdvice.BuyerInfo.CodeListRespAgy' action='set'/>
<assign property='target.{SegmentGroup2(1).SegmentGroup3(1).RFF-14:C506.1153}' value='source.DespatchAdvice.BuyerInfo.RefQual' action='set'/>
<assign property='target.{SegmentGroup2(1).SegmentGroup3(1).RFF-14:C506.1154}' value='source.DespatchAdvice.BuyerInfo.RefNo' action='set'/>
<assign property='target.{SegmentGroup2(2).NAD-11:3035}' value='source.DespatchAdvice.SupplierInfo.Type' action='set'/>
<assign property='target.{SegmentGroup2(2).NAD-11:C082(1).3039}' value='source.DespatchAdvice.SupplierInfo.PartyID' action='set'/>
<assign property='target.{SegmentGroup2(2).NAD-11:C082(1).3055}' value='source.DespatchAdvice.SupplierInfo.CodeListRespAgy' action='set'/>
<assign property='target.{SegmentGroup2(2).SegmentGroup3(1).RFF-14:C506.1153}' value='source.DespatchAdvice.SupplierInfo.RefQual' action='set'/>
<assign property='target.{SegmentGroup2(2).SegmentGroup3(1).RFF-14:C506.1154}' value='source.DespatchAdvice.SupplierInfo.RefNo' action='set'/>
<assign property='target.{SegmentGroup2(3).NAD-11:3035}' value='source.DespatchAdvice.DeliveryPartyInfo.Type' action='set'/>
<assign property='target.{SegmentGroup2(3).NAD-11:C082(1).3039}' value='source.DespatchAdvice.DeliveryPartyInfo.PartyID' action='set'/>
<assign property='target.{SegmentGroup2(3).NAD-11:C082(1).3055}' value='source.DespatchAdvice.DeliveryPartyInfo.CodeListRespAgy' action='set'/>
<foreach property='source.DespatchAdvice.PackageInfos()' key='count'>
<assign property='target.{SegmentGroup10(count).CPS-38:7164}' value='source.DespatchAdvice.PackageInfos.(count).HierarchyNo' action='set'/>
<if condition='(count &gt; 1) = 1'>
<true>
<assign property='target.{SegmentGroup10(count).CPS-38:7166}' value='source.DespatchAdvice.PackageInfos.(count).ParentHryNo' action='set'/>
</true>
</if>
<foreach property='source.DespatchAdvice.PackageInfos.(count).PackageUnits()' key='count2'>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).PAC-41:7224}' value='source.DespatchAdvice.PackageInfos.(count).PackageUnits.(count2).Count' action='set'/>
<if condition='(count &gt; 1) = 1'>
<true>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).PAC-41:C531}' value='source.DespatchAdvice.PackageInfos.(count).PackageUnits.(count2).Level' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).PAC-41:C202(1).7065}' value='source.DespatchAdvice.PackageInfos.(count).PackageUnits.(count2).Type' action='set'/>
<if condition='(source.DespatchAdvice.PackageInfos.(count).PackageUnits.(count2).SSCCNo = "") = 0'>
<true>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).SegmentGroup13(1).PCI-48:4233}' value='"33E"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).SegmentGroup13(1).SegmentGroup14(1).GIN-53:7405}' value='"BJ"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup11(count2).SegmentGroup13(1).SegmentGroup14(1).GIN-53:C208(1).7402}' value='source.DespatchAdvice.PackageInfos.(count).PackageUnits.(count2).SSCCNo' action='set'/>
</true>
</if>
</true>
</if>
</foreach>
<foreach property='source.DespatchAdvice.PackageInfos.(count).Items()' key='count2'>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).LIN-56:1082}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).LineNo' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).LIN-56:C212(1).7140}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).ItemNo' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).LIN-56:C212(1).7143}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).ItemNoType' action='set'/>
<if condition='(source.DespatchAdvice.PackageInfos.(count).Items.(count2).SAPItemNo = "") = 0'>
<true>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).PIA-57(1):4347}' value='"1"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).PIA-57(1):C212(1).7143}' value='"IN"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).PIA-57(1):C212(1).3055}' value='"92"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).PIA-57(1):C212(1).7140}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).SAPItemNo' action='set'/>
</true>
</if>
<if condition='(source.DespatchAdvice.PackageInfos.(count).Items.(count2).Quantity = "") = 0'>
<true>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).QTY-60(1):C186.6063}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).QuantityQual' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).QTY-60(1):C186.6060}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).Quantity' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).QTY-60(1):C186.6411}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).QuantityUoM' action='set'/>
</true>
</if>
<if condition='(source.DespatchAdvice.PackageInfos.(count).Items.(count2).OrderItemNo = "")=0'>
<true>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).SegmentGroup16(1).RFF-69:C506.1153}' value='"PS"' action='set'/>
<assign property='target.{SegmentGroup10(count).SegmentGroup15(count2).SegmentGroup16(1).RFF-69:C506.1156}' value='source.DespatchAdvice.PackageInfos.(count).Items.(count2).OrderItemNo' action='set'/>
</true>
</if>
</foreach>
</foreach>
<assign property='target.{CNT-98(1):C270.6069}' value='"2"' action='set'/>
<assign property='target.{CNT-98(1):C270.6066}' value='source.DespatchAdvice.PackageInfos.Count()-1' action='set'/>
<code>
<![CDATA[ set LINSegementCounter = 0
]]]]><![CDATA[>
</code>
<foreach property='source.DespatchAdvice.PackageInfos()' key='empty'>
<foreach property='source.DespatchAdvice.PackageInfos.(empty).Items()' key='empty2'>
<code>
<![CDATA[ set LINSegementCounter = LINSegementCounter + 1
]]]]><![CDATA[>
</code>
</foreach>
</foreach>
<assign property='target.{CNT-98(1):C270.6066}' value='LINSegementCounter' action='set'/>
<assign property='target.{UNT-99:0074}' value='target.SegCount + 1' action='set'/>
<assign property='target.{UNT-99:0062}' value='source.DespatchAdvice.EDIHeader.MsgRefNo' action='set'/>
</transform>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.DTL.ModelInvoice2EDI">
<ClassType/>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.DataTransformDTL</Super>
<TimeChanged>62073,40515.660714</TimeChanged>
<TimeCreated>61713,52466.306904</TimeCreated>

<XData name="DTL">
<XMLNamespace>http://www.intersystems.com/dtl</XMLNamespace>
<Data><![CDATA[
<?xml version="1.0" ?>
<transform targetClass='EnsLib.EDI.EDIFACT.Document' targetDocType='D01B:INVOIC' sourceClass='Alliance.Ens.Message.InvoiceRequest' create='new' language='objectscript'>
<assign property='target.{UNH-1:0062}' value='source.Invoice.EDIHeader.MsgRefNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0065}' value='source.Invoice.EDIHeader.MsgTypeId' action='set'/>
<assign property='target.{UNH-1:S009(1).0052}' value='source.Invoice.EDIHeader.MsgTypeVerNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0054}' value='source.Invoice.EDIHeader.MsgTypeReleaseNo' action='set'/>
<assign property='target.{UNH-1:S009(1).0051}' value='source.Invoice.EDIHeader.CntrlAcy' action='set'/>
<assign property='target.{UNH-1:S009(1).0057}' value='source.Invoice.EDIHeader.AssocAssCode' action='set'/>
<assign property='target.{BGM-2:C002.1001}' value='source.Invoice.DocumentType' action='set'/>
<assign property='target.{BGM-2:C106(1).1004}' value='source.Invoice.InvoiceNo' action='set'/>
<assign property='target.{BGM-2:1225}' value='source.Invoice.MsgType' action='set'/>
<if condition='((source.Invoice.RespType = "") || (source.Invoice.RespType = $c(0))) = 0'>
<true>
<assign property='target.{BGM-2:4343}' value='source.Invoice.RespType' action='set'/>
</true>
</if>
<assign property='target.{DTM-3(1):C507.2005}' value='source.Invoice.MsgTimestamp.DTType' action='set'/>
<assign property='target.{DTM-3(1):C507.2380}' value='source.Invoice.MsgTimestamp.Data' action='set'/>
<assign property='target.{DTM-3(1):C507.2379}' value='source.Invoice.MsgTimestamp.Format' action='set'/>
<assign property='target.{DTM-3(2):C507.2005}' value='source.Invoice.InvDateApplication.DTType' action='set'/>
<assign property='target.{DTM-3(2):C507.2380}' value='source.Invoice.InvDateApplication.Data' action='set'/>
<assign property='target.{DTM-3(2):C507.2379}' value='source.Invoice.InvDateApplication.Format' action='set'/>
<assign property='target.{DTM-3(3):C507.2005}' value='source.Invoice.DeliveryDate.DTType' action='set'/>
<assign property='target.{DTM-3(3):C507.2380}' value='source.Invoice.DeliveryDate.Data' action='set'/>
<assign property='target.{DTM-3(3):C507.2379}' value='source.Invoice.DeliveryDate.Format' action='set'/>
<if condition='(source.Invoice.InvoicingPeriod.Data = "") = 0'>
<true>
<assign property='target.{DTM-3(4):C507.2005}' value='source.Invoice.InvoicingPeriod.DTType' action='set'/>
<assign property='target.{DTM-3(4):C507.2380}' value='source.Invoice.InvoicingPeriod.Data' action='set'/>
<assign property='target.{DTM-3(4):C507.2379}' value='source.Invoice.InvoicingPeriod.Format' action='set'/>
</true>
</if>
<if condition='((source.Invoice.InvMessage = "") || (source.Invoice.InvMessage = $c(0))) = 0'>
<true>
<assign property='target.{FTX-7(1):4451}' value='"ZZZ"' action='set'/>
<assign property='target.{FTX-7(1):4453}' value='"1"' action='set'/>
<assign property='target.{FTX-7(1):C108(1).4440}' value='source.Invoice.InvMessage' action='set'/>
</true>
</if>
<foreach property='source.Invoice.RefInfos()' key='c'>
<if condition='(source.Invoice.RefInfos.(c).ReferenceNo = "0") = 0'>
<true>
<assign property='target.{SegmentGroup1(c).RFF-13:C506.1153}' value='source.Invoice.RefInfos.(c).ReferenceType' action='set'/>
<assign property='target.{SegmentGroup1(c).RFF-13:C506.1154}' value='source.Invoice.RefInfos.(c).ReferenceNo' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.Invoice.PartyInfos()' key='c'>
<assign property='target.{SegmentGroup2(c).NAD-23:3035}' value='source.Invoice.PartyInfos.(c).Type' action='set'/>
<assign property='target.{SegmentGroup2(c).NAD-23:C082(1).3039}' value='source.Invoice.PartyInfos.(c).PartyID' action='set'/>
<assign property='target.{SegmentGroup2(c).NAD-23:C082(1).3055}' value='source.Invoice.PartyInfos.(c).CodeListRespAgy' action='set'/>
<assign property='target.{SegmentGroup2(c).NAD-23:C080(1).3036}' value='$replace(source.Invoice.PartyInfos.(c).Name,"+","?+")' action='set'/>
<if condition='((source.Invoice.PartyInfos.(c).Name2 = "") || (source.Invoice.PartyInfos.(c).Name2 = $c(0))) = 0'>
<true>
<assign property='target.{SegmentGroup2(c).NAD-23:C080(1).30362}' value='$replace(source.Invoice.PartyInfos.(c).Name2,"+","?+")' action='set'/>
</true>
</if>
<assign property='target.{SegmentGroup2(c).NAD-23:C059(1).3042}' value='$replace(source.Invoice.PartyInfos.(c).Street,"+","?+")' action='set'/>
<if condition='((source.Invoice.PartyInfos.(c).Street2 = "") || (source.Invoice.PartyInfos.(c).Street2 = $c(0))) = 0'>
<true>
<assign property='target.{SegmentGroup2(c).NAD-23:C059(1).30422}' value='$replace(source.Invoice.PartyInfos.(c).Street2,"+","?+")' action='set'/>
</true>
</if>
<assign property='target.{SegmentGroup2(c).NAD-23:3164}' value='$replace(source.Invoice.PartyInfos.(c).City,"+","?+")' action='set'/>
<assign property='target.{SegmentGroup2(c).NAD-23:3251}' value='source.Invoice.PartyInfos.(c).ZIPCode' action='set'/>
<assign property='target.{SegmentGroup2(c).NAD-23:3207}' value='source.Invoice.PartyInfos.(c).Country' action='set'/>
<if condition='((source.Invoice.PartyInfos.(c).VATRegNo = "") || (source.Invoice.PartyInfos.(c).VATRegNo = $c(0))) = 0'>
<true>
<assign property='target.{SegmentGroup2(c).SegmentGroup3(1).RFF-28:C506.1153}' value='"VA"' action='set'/>
<assign property='target.{SegmentGroup2(c).SegmentGroup3(1).RFF-28:C506.1154}' value='source.Invoice.PartyInfos.(c).VATRegNo' action='set'/>
</true>
</if>
</foreach>
<assign property='target.{SegmentGroup7(1).CUX-41:C504.6345}' value='source.Invoice.Currency' action='set'/>
<assign property='target.{SegmentGroup7(1).CUX-41:C504.6347}' value='"2"' action='set'/>
<assign property='target.{SegmentGroup7(1).CUX-41:C504.6343}' value='"4"' action='set'/>
<foreach property='source.Invoice.PaymentTerms()' key='c'>
<assign property='target.{SegmentGroup8(c).PAT-44:4279}' value='source.Invoice.PaymentTerms.(1).Type' action='set'/>
<assign property='target.{SegmentGroup8(c).PAT-44:C112(1).2475}' value='source.Invoice.PaymentTerms.(c).TimeRef' action='set'/>
<assign property='target.{SegmentGroup8(c).PAT-44:C112(1).2009}' value='source.Invoice.PaymentTerms.(c).TimeRelation' action='set'/>
<assign property='target.{SegmentGroup8(c).PAT-44:C112(1).2151}' value='source.Invoice.PaymentTerms.(c).PeriodType' action='set'/>
<assign property='target.{SegmentGroup8(c).PAT-44:C112(1).2152}' value='source.Invoice.PaymentTerms.(c).PeriodCount' action='set'/>
<assign property='pos' value='1' action='set'/>
<if condition='(source.Invoice.PaymentTerms.(c).DiscountDue.Data = "") = 0'>
<true>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2005}' value='source.Invoice.PaymentTerms.(c).DiscountDue.DTType' action='set'/>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2380}' value='source.Invoice.PaymentTerms.(c).DiscountDue.Data' action='set'/>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2379}' value='source.Invoice.PaymentTerms.(c).DiscountDue.Format' action='set'/>
<assign property='pos' value='2' action='set'/>
</true>
</if>
<if condition='(source.Invoice.PaymentTerms.(c).NetDue.Data = "") = 0'>
<true>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2005}' value='source.Invoice.PaymentTerms.(c).NetDue.DTType' action='set'/>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2380}' value='source.Invoice.PaymentTerms.(c).NetDue.Data' action='set'/>
<assign property='target.{SegmentGroup8(c).DTM-45(pos):C507.2379}' value='source.Invoice.PaymentTerms.(c).NetDue.Format' action='set'/>
</true>
</if>
</foreach>
<foreach property='source.Invoice.InvoiceLines()' key='c'>
<assign property='target.{SegmentGroup26(c).LIN-110:1082}' value='source.Invoice.InvoiceLines.(c).ItemID' action='set'/>
<assign property='target.{SegmentGroup26(c).LIN-110:C212(1).7140}' value='source.Invoice.InvoiceLines.(c).ItemNo' action='set'/>
<assign property='target.{SegmentGroup26(c).LIN-110:C212(1).7143}' value='source.Invoice.InvoiceLines.(c).ItemTypeId' action='set'/>
<foreach property='source.Invoice.InvoiceLines.(c).ProductIds()' key='c2'>
<assign property='target.{SegmentGroup26(c).PIA-111(c2):4347}' value='source.Invoice.InvoiceLines.(c).ProductIds.(c2).NumberType' action='set'/>
<assign property='target.{SegmentGroup26(c).PIA-111(c2):C212(1).7140}' value='source.Invoice.InvoiceLines.(c).ProductIds.(c2).ProductNo' action='set'/>
<assign property='target.{SegmentGroup26(c).PIA-111(c2):C212(1).7143}' value='source.Invoice.InvoiceLines.(c).ProductIds.(c2).NumberOwner' action='set'/>
</foreach>
<foreach property='source.Invoice.InvoiceLines.(c).ItemDescriptions()' key='c2'>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):7077}' value='source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Type' action='set'/>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):C273(1).7009}' value='source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Ident' action='set'/>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):C273(1).7008}' value='$replace(source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Textline1,"+","?+")' action='set'/>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):C273(1).3055}' value='source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).RespAgcy' action='set'/>
<if condition='((source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Textline2 = "") || (source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Textline2 = $c(0))) = 0'>
<true>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):C273(1).70082}' value='$replace(source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).Textline2,"+","?+")' action='set'/>
</true>
</if>
<assign property='target.{SegmentGroup26(c).IMD-113(c2):C273(1).3453}' value='source.Invoice.InvoiceLines.(c).ItemDescriptions.(c2).LanguageCode' action='set'/>
</foreach>
<foreach property='source.Invoice.InvoiceLines.(c).Quantities()' key='c2'>
<assign property='target.{SegmentGroup26(c).QTY-115(c2):C186.6063}' value='source.Invoice.InvoiceLines.(c).Quantities.(c2).Type' action='set'/>
<assign property='target.{SegmentGroup26(c).QTY-115(c2):C186.6060}' value='source.Invoice.InvoiceLines.(c).Quantities.(c2).Quantity' action='set'/>
</foreach>
<assign property='target.{SegmentGroup26(c).SegmentGroup27(1).MOA-126:C516.5025}' value='"203"' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup27(1).MOA-126:C516.5004}' value='source.Invoice.InvoiceLines.(c).MonetaryAmount' action='set'/>
<foreach property='source.Invoice.InvoiceLines.(c).PriceDetails()' key='c2'>
<assign property='target.{SegmentGroup26(c).SegmentGroup29(c2).PRI-134:C509.5125}' value='source.Invoice.InvoiceLines.(c).PriceDetails.(c2).PriceCode' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup29(c2).PRI-134:C509.5118}' value='##class(Base.String).DecimalToString(source.Invoice.InvoiceLines.(c).PriceDetails.(c2).PriceAmount)' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup29(c2).PRI-134:C509.5375}' value='source.Invoice.InvoiceLines.(c).PriceDetails.(c2).PriceType' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup29(c2).PRI-134:C509.5387}' value='source.Invoice.InvoiceLines.(c).PriceDetails.(c2).PriceSpec' action='set'/>
</foreach>
<foreach property='source.Invoice.InvoiceLines.(c).OrderRefs()' key='c2'>
<assign property='target.{SegmentGroup26(c).SegmentGroup30(1).RFF-140:C506.1153}' value='source.Invoice.InvoiceLines.(c).OrderRefs.(c2).ReferenceType' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup30(1).RFF-140:C506.1154}' value='source.Invoice.InvoiceLines.(c).OrderRefs.(c2).ReferenceNo' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup30(1).RFF-140:C506.1156}' value='source.Invoice.InvoiceLines.(c).OrderRefs.(c2).LineNo' action='set'/>
</foreach>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).TAX-156:5283}' value='"7"' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).TAX-156:C241(1).5153}' value='"VAT"' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).TAX-156:C243(1).5278}' value='source.Invoice.InvoiceLines.(c).VATPercent' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).MOA-157(1):C516.5004}' value='##class(Base.String).DecimalToString(source.Invoice.InvoiceLines.(c).TaxDueAmount)' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).MOA-157(1):C516.5025}' value='"124"' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).MOA-157(2):C516.5004}' value='##class(Base.String).DecimalToString(source.Invoice.InvoiceLines.(c).TaxableAmount)' action='set'/>
<assign property='target.{SegmentGroup26(c).SegmentGroup34(1).MOA-157(2):C516.5025}' value='"125"' action='set'/>
</foreach>
<assign property='target.{UNS-217:0081}' value='source.Invoice.UNSSeperator' action='set'/>
<assign property='target.{CNT-218(1):C270.6069}' value='"2"' action='set'/>
<assign property='target.{CNT-218(1):C270.6066}' value='source.Invoice.LineCount' action='set'/>
<assign property='target.{SegmentGroup50(1).MOA-220:C516.5025}' value='source.Invoice.MonetaryDetails.(1).Type' action='set'/>
<assign property='target.{SegmentGroup50(1).MOA-220:C516.5004}' value='source.Invoice.MonetaryDetails.(1).Amount' action='set'/>
<if condition='(source.Invoice.DocumentType = "381") = 0'>
<true>
<assign property='target.{SegmentGroup50(1).SegmentGroup51.RFF-222:C506.1153}' value='source.Invoice.MonetaryDetails.(1).Referencetype' action='set'/>
<assign property='target.{SegmentGroup50(1).SegmentGroup51.RFF-222:C506.1154}' value='source.Invoice.MonetaryDetails.(1).ReferenceNo' action='set'/>
</true>
</if>
<assign property='target.{SegmentGroup50(2).MOA-220:C516.5025}' value='source.Invoice.MonetaryDetails.(2).Type' action='set'/>
<assign property='target.{SegmentGroup50(2).MOA-220:C516.5004}' value='##class(Base.String).DecimalToString(source.Invoice.MonetaryDetails.(2).Amount)' action='set'/>
<foreach property='source.Invoice.TAXDetails()' key='c'>
<assign property='target.{SegmentGroup52(c).TAX-225:5283}' value='source.Invoice.TAXDetails.(c).FnType' action='set'/>
<assign property='target.{SegmentGroup52(c).TAX-225:C241(1).5153}' value='source.Invoice.TAXDetails.(c).TaxType' action='set'/>
<assign property='target.{SegmentGroup52(c).TAX-225:C243(1).5278}' value='source.Invoice.TAXDetails.(c).Percent' action='set'/>
<assign property='target.{SegmentGroup52(c).TAX-225:3446}' value='source.Invoice.TAXDetails.(c).PartyTaxIdent' action='set'/>
<assign property='target.{SegmentGroup52(c).MOA-226(1):C516.5025}' value='"124"' action='set'/>
<assign property='target.{SegmentGroup52(c).MOA-226(1):C516.5004}' value='##class(Base.String).DecimalToString(source.Invoice.TAXDetails.(c).TaxAmount)' action='set'/>
<assign property='target.{SegmentGroup52(c).MOA-226(2):C516.5025}' value='"125"' action='set'/>
<assign property='target.{SegmentGroup52(c).MOA-226(2):C516.5004}' value='##class(Base.String).DecimalToString(source.Invoice.TAXDetails.(c).TaxableAmount)' action='set'/>
</foreach>
<assign property='target.{UNT-232:0074}' value='target.SegCount + 1' action='set'/>
<assign property='target.{UNT-232:0062}' value='source.Invoice.EDIHeader.MsgRefNo' action='set'/>
</transform>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.DispCons.AS2Messages">
<Super>Alliance.Ens.DispCons.AbstractZENPage</Super>
<TimeChanged>62257,40565.72933</TimeChanged>
<TimeCreated>61810,55856.584121</TimeCreated>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>Systemübersicht</Default>
</Parameter>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
<Data><![CDATA[
<page xmlns="http://www.intersystems.com/zen" title="Systemübersicht">

<!--<timer timeout="10000" ontimeout="zenPage.refreshTable(zenThis);"/>-->

<hgroup width="100%">

<vgroup width="5%"/>
<vgroup width="90%">

<spacer height="10"/>

<hgroup>

<menu id="menu" layout="horizontal">
<menuItem caption="Systeme" link="Alliance.Ens.DispCons.Systems.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Prozesse" link="Alliance.Ens.DispCons.Processes.cls" containerStyle="background: lightgray;"/>
<menuItem caption="EDI Meldungen" link="Alliance.Ens.DispCons.AS2Messages.cls" containerStyle="background: white;"/>
<menuItem caption="Produktion" link="Alliance.Ens.DispCons.Production.cls" containerStyle="background: lightgray;"/>
</menu>

<spacer width="100"/>

<label value="DISPONENTEN-MONITOR" valign="middle" containerStyle="font-size:120%; font-weight:'bold'; vertical-align:bottom; color:'darkblue';"/>

</hgroup>

<spacer height="10"/>

<tablePane
id="AS2NotificationTable"
tableName="Alliance_Ens_AS2.Notification"
whereClause=""
orderByClause="timestampCreated_horolog desc"
valueColumn="ID"
width="100%"
caption="Classic EDI Meldungen"
fixedHeaders="false"
maxRows="1000"
pageSize="25"
extraColumnWidth="3"
showRowNumbers="false"
rowSelect="false"
showZebra="true"
useSnapshot="true"
>
<column header="Status" colName="typeValue as Status" OnDrawCell="DrawAS2Status" style="text-align: center;"/>
<column header="Typ" colName="typeValue" filterType="query" filterQuery="select value from Alliance_Ens_AS2.NotificationType order by 1"/>
<column header="Erstellt" colName="timestampCreated_horolog" OnDrawCell="DrawHorologToDateTime" seed="3" filterType="date"/>
<column header="Id" colName="ident"/>
<column header="Sender" colName="sender" filterType="query" filterQuery="select distinct %exact(sender) from Alliance_Ens_AS2.Notification order by 1"/>
<column header="Empfänger" colName="receiver" filterType="query" filterQuery="select distinct %exact(receiver) from Alliance_Ens_AS2.Notification order by 1"/>
<column header="Dateiname" colName="filename"/>
<condition
colName="typeValue"
predicate="EQ"
value="Error"
cellStyle="background: #FF9999;"
/>
</tablePane>

<tableNavigatorBar id="AS2NotificationNavBar" tablePaneId="AS2NotificationTable"/>

</vgroup>
<vgroup width="5%"/>

</hgroup>

</page>
]]></Data>
</XData>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Server Callback Methods:	=======================================

]]></Content>
</UDLText>

<Method name="DrawAS2Status">
<Description>
	Input is a string in timestamp format. Output is a html string for an image.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set value = %query(pName)

	if (value = ##class(Alliance.Ens.AS2.NotificationType).Arrived().value)
	{
		set as2StatusGifName = "Green"	//	green ball
	}
	elseif (value = ##class(Alliance.Ens.AS2.NotificationType).Sent().value)
	{
		set as2StatusGifName = "Green"	//	green ball
	}
	elseif (value = ##class(Alliance.Ens.AS2.NotificationType).Error().value)
	{
		set as2StatusGifName = "Red"	//	red ball
	}
	else
	{
		set as2StatusGifName = "White"	//	white ball
	}

	write "<img src='" _ $$$APPURI _ "/pic/stat" _ as2StatusGifName _ ".gif'>"

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Private:			===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Client Methods:		===============================================

]]></Content>
</UDLText>

<Method name="refreshTable">
<Description>
Refreshing Method for table pane</Description>
<FormalSpec>timer</FormalSpec>
<Language>javascript</Language>
<ClientMethod>1</ClientMethod>
<Implementation><![CDATA[
	zenPage.getComponentById('AS2NotificationTable').executeQuery(true);
	timer.startTimer();
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DispCons.AbstractZENPage">
<Description>
Created using the page template: Default</Description>
<IncludeCode>Alliance</IncludeCode>
<Super>%ZEN.Component.page</Super>
<TimeChanged>62122,50406.031528</TimeChanged>
<TimeCreated>61812,28932.997425</TimeCreated>

<Parameter name="APPLICATION">
<Description>
Class name of application this page belongs to.</Description>
<Default>Alliance.Ens.DispCons.Application</Default>
</Parameter>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>(Abstract)</Default>
</Parameter>

<Parameter name="DOMAIN">
<Description>
Domain used for localization.</Description>
</Parameter>

<XData name="Style">
<Description>
This Style block contains page-specific CSS style definitions.</Description>
<Data><![CDATA[
<style type="text/css">
</style>
]]></Data>
</XData>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
</XData>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Server Callback Methods:	=======================================

]]></Content>
</UDLText>

<Method name="DrawDate">
<Description>
	Input is a date in US (or ODBC) format. Output is a date in european format.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set value = %query(pName)
	if (value = "")		write "&nbsp;"		quit $$$OK

	//	This converts the date from the US-Format 1 (mm/dd/yyyy) to european format 4 (dd/mm/yyyy)
	write ..toGermanDateFormat($zdate($zdateh(value, 1), 4))

	quit $$$OK
]]></Implementation>
</Method>

<Method name="DrawHorologToDateTime">
<Description>
	Input is a string in horolog format. Output is a datetime in european format. pSeed contains the seconds precision.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set value = %query(pName)
	if (value = "")		write "&nbsp;"		quit $$$OK

	if (pSeed = "")		set pSeed = 0

	//	This converts the datetime from horolog format to european format
	write ..toGermanDateFormat($zdatetime(value, 4, 1, pSeed))

	quit $$$OK
]]></Implementation>
</Method>

<Method name="DrawTimeStampToDateTime">
<Description>
	Input is a string in timestamp format. Output is a datetime in european format. pSeed contains the seconds precision.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set value = %query(pName)
	if (value = "")		write "&nbsp;"		quit $$$OK

	if (pSeed = "")		set pSeed = 0

	//	This converts the datetime from timestamp format to european format
	write ..toGermanDateFormat($zdatetime($zdatetimeh(value, 3, 1, pSeed), 4, 1, pSeed))

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Server Support Methods:		=======================================

]]></Content>
</UDLText>

<Method name="toGermanDateFormat">
<ClassMethod>1</ClassMethod>
<FormalSpec>dateOrDateTime:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit $translate(dateOrDateTime, "/", ".")
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DispCons.Application">
<Description>
Alliance.Ens.DispCons.Application</Description>
<Super>%ZEN.application</Super>
<TimeChanged>61810,36174.584699</TimeChanged>
<TimeCreated>61808,50522.234614</TimeCreated>

<Parameter name="APPLICATIONNAME">
<Description>
This is the name of this application.</Description>
<Default>DispCons</Default>
</Parameter>

<Parameter name="HOMEPAGE">
<Description>
This is the URL of the main starting page of this application.</Description>
<Default>Alliance.Ens.DispCons.Overview.cls</Default>
</Parameter>

<XData name="Style">
<Description>
This Style block contains application-wide CSS style definitions.</Description>
<Data><![CDATA[
<style type="text/css">

/*Style classes for use on this page */

	body { font-family: arial; }

	table.tpTable caption {
		background: transparent;
		font-size: 1.4em;
		font-weight: bold;
		text-align: left;
		border: none;
		padding: 10;
	}

	/* even rows */
	 .tpEven { color: black; background: #ebe3ff; }
	
	/* odd rows */
	 .tpOdd { color: black; background: white; }

	/* this is a selected row */
	table.tpTable tr.tpSelected { background: #3d80df; color: white; }

	/* hover for odd and even rows */
	tr.tpOdd:hover,tr.tpEven:hover { 
		background-color: #3d80df; 
		color: #ffffff;
	}

	/* table header style */
	table.tpTable th {
		border-right: 1px solid gray;
		border-bottom: 1px solid gray;
		background: #C5D6D6;
		color: black;
		font-weight: bold;
		text-align: left;
		padding: 2px;
		overflow: hidden;
	}

	/* selected column header (th) */
	table.tpTable th.tpHdrSelected { background: #3d80df; }

	/* filter layour */
	table.tpFilterLayout td { border: none; background: #C5D6D6; }

</style>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.DispCons.CodeStatusTimeThreshold">
<Super>Base.CodeAbstract</Super>
<TimeChanged>61814,37193.499314</TimeChanged>
<TimeCreated>61814,36697.380519</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Properties			===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Queries				===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Class Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Instance Creation	---------------------------------------

]]></Content>
</UDLText>

<Method name="initialize">
<Description>
write ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).initialize()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	do ..new("green", "0", "Number of minutes when to show status = green",, .status)
	quit:($$$ISERR(status)) status

	do ..new("yellow", "1", "Number of minutes when to show status = yellow",, .status)
	quit:($$$ISERR(status)) status

	do ..new("red", "3", "Number of minutes when to show status = red",, .status)
	quit status
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Instance Methods	===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<Method name="Green">
<Description>
write ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Green()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.DispCons.CodeStatusTimeThreshold</ReturnType>
<Implementation><![CDATA[	quit ..get("green")
]]></Implementation>
</Method>

<Method name="Yellow">
<Description>
write ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Yellow()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.DispCons.CodeStatusTimeThreshold</ReturnType>
<Implementation><![CDATA[	quit ..get("yellow")
]]></Implementation>
</Method>

<Method name="Red">
<Description>
write ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Red()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.DispCons.CodeStatusTimeThreshold</ReturnType>
<Implementation><![CDATA[	quit ..get("red")
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Inquiring		-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Business Logic	-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Support			-------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	===========================================================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Private Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Testing		-----------------------------------------------

]]></Content>
</UDLText>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.DispCons.Login">
<Super>Alliance.Ens.DispCons.AbstractZENPage</Super>
<TimeChanged>62200,58399.005742</TimeChanged>
<TimeCreated>61814,60086.226063</TimeCreated>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>Login</Default>
</Parameter>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
<Data><![CDATA[
<page xmlns="http://www.intersystems.com/zen" title="">

<hgroup width="100%">

<vgroup width="5%"/>
<vgroup width="90%">

<spacer height="10"/>

<html>
<p><b>DISPONENTEN-MONITOR</b></p>
</html>

<spacer height="10"/>

<form id="loginForm" nextPage="Alliance.Ens.DispCons.Systems.cls">
<text name="CacheUserName" label="Name:"/>
<spacer height="5"/>
<password name="CachePassword" label="Passwort:"/>
<spacer height="5"/>
<submit caption="Login"/>
</form>
<html align="left" enclosingStyle="color:red;" OnDrawContent="DrawMessage"/>
</vgroup>
<vgroup width="5%"/>
</hgroup>
</page>
]]></Data>
</XData>

<Method name="DrawMessage">
<FormalSpec>pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    if ($Get(%request.Data("$ZENLOGINFAILURE",1))=1)
    {
        write "Benutzername oder Passwort ist falsch."
    }
    Quit $$$OK
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DispCons.Processes">
<Super>Alliance.Ens.DispCons.AbstractZENPage</Super>
<TimeChanged>62257,42190.356349</TimeChanged>
<TimeCreated>61810,36348.891574</TimeCreated>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>Prozessübersicht</Default>
</Parameter>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
<Data><![CDATA[
<page xmlns="http://www.intersystems.com/zen" title="Prozessübersicht">

<!--<timer timeout="10000" ontimeout="zenPage.refreshTable(zenThis);"/>-->

<hgroup width="100%">

<vgroup width="5%"/>
<vgroup width="90%">

<spacer height="10"/>

<hgroup>

<menu id="menu" layout="horizontal">
<menuItem caption="Systeme" link="Alliance.Ens.DispCons.Systems.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Prozesse" link="Alliance.Ens.DispCons.Processes.cls" containerStyle="background: white;"/>
<menuItem caption="EDI Meldungen" link="Alliance.Ens.DispCons.AS2Messages.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Produktion" link="Alliance.Ens.DispCons.Production.cls" containerStyle="background: lightgray;"/>
</menu>

<spacer width="100"/>

<label value="DISPONENTEN-MONITOR" valign="middle" containerStyle="font-size:120%; font-weight:'bold'; vertical-align:bottom; color:'darkblue';"/>

</hgroup>

<spacer height="10"/>

<tablePane
id="MessageTable"
 queryClass="Alliance.Common.KAL.Message" queryName="processAllFields"
valueColumn="ID"
width="100%"
caption="Prozessübersicht"
fixedHeaders="false"
maxRows="1000"
pageSize="25"
extraColumnWidth="3%"
showRowNumbers="false"
rowSelect="false"
showZebra="true"
useSnapshot="true" showQuery="false"
>
<column hidden="true" colName="ID"/>
<column header="OK" colName="isProcessed" filterType="enum" filterEnum="0,1" style="text-align:center;"/>
<column header="Typ" colName="severityValue" filterType="query" filterQuery="select value from Alliance_Common_KAL_Code.MessageSeverity"/>
<column header="Durchgeführt" colName="timeStampCreated" OnDrawCell="DrawTimeStampToDateTime" seed="3" filterType="date"/>
<column header="Sender-Typ" colName="senderTypValue" filterType="query" filterQuery="select value from Alliance_Common_KAL_Code.MessageSenderType"/>
<column header="Kategorie" colName="typValue" filterType="query" filterQuery="select value from Alliance_Common_KAL_Code.MessageType"/>
<column header="Nachricht" colName="subTypValue" filterType="query" filterQuery="select value from Alliance_Common_KAL_Code.MessageSubType"/>
<column header="Lieferant" colName="lieferantName" filterType="query" filterQuery="select distinct %exact(lieferantName) from Alliance_Common_KAL.Message where lieferantName is not null"/>
<column header="Ort" colName="lieferantOrt" filterType="query" filterQuery="select distinct %exact(lieferantOrt) from Alliance_Common_KAL.Message where lieferantOrt is not null"/>
<column header="Abnehmer" colName="vzName" filterType="query" filterQuery="select distinct %exact(vzName) from Alliance_Common_KAL.Message where vzName is not null"/>
<column header="Ort" colName="vzOrt" filterType="query" filterQuery="select distinct %exact(vzOrt) from Alliance_Common_KAL.Message where vzOrt is not null"/>
<column header="Bestelldatum" colName="datum" OnDrawCell="DrawDate" filterType="date"/>
<column header="Bestellnr" colName="bestellNr" filterType="query" filterQuery="select distinct bestellNr from Alliance_Common_KAL.Message where bestellNr is not null"/>
<column header="Text" colName="additionalText" filterType="text" filterOp="["/>
</tablePane>

<tableNavigatorBar id="MessageTableNavBar" tablePaneId="MessageTable"/>

</vgroup>
<vgroup width="5%"/>

</hgroup>

</page>
]]></Data>
</XData>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Client Methods:		===============================================

]]></Content>
</UDLText>

<Method name="refreshTable">
<Description>
Refreshing Method for table pane</Description>
<FormalSpec>timer</FormalSpec>
<Language>javascript</Language>
<ClientMethod>1</ClientMethod>
<Implementation><![CDATA[
	zenPage.getComponentById('MessageTable').executeQuery(true);
	timer.startTimer();
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DispCons.Production">
<Super>Alliance.Ens.DispCons.AbstractZENPage</Super>
<TimeChanged>62257,40531.350099</TimeChanged>
<TimeCreated>61813,32522.792709</TimeCreated>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>Production</Default>
</Parameter>

<XData name="Style">
<Description>
This Style block contains page-specific CSS style definitions.</Description>
<Data><![CDATA[
<style type="text/css">

table th
{
	font-size: 1.1em;
	font-weight: bold;
	text-align: right;
}

</style>
]]></Data>
</XData>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
<Data><![CDATA[
<page xmlns="http://www.intersystems.com/zen" title="Production">

<!--<timer timeout="10000" ontimeout="zenPage.refreshTable(zenThis);"/>-->

<hgroup width="100%">

<vgroup width="5%"/>
<vgroup width="90%">

<spacer height="10"/>

<hgroup>

<menu id="menu" layout="horizontal">
<menuItem caption="Systeme" link="Alliance.Ens.DispCons.Systems.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Prozesse" link="Alliance.Ens.DispCons.Processes.cls" containerStyle="background: lightgray;"/>
<menuItem caption="EDI Meldungen" link="Alliance.Ens.DispCons.AS2Messages.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Produktion" link="Alliance.Ens.DispCons.Production.cls" containerStyle="background: white;"/>
</menu>

<spacer width="100"/>

<label value="DISPONENTEN-MONITOR" valign="middle" containerStyle="font-size:120%; font-weight:'bold'; vertical-align:bottom; color:'darkblue';"/>

</hgroup>

<spacer height="10"/>

<html id="productionInfos" OnDrawContent="GetHTMLProductionInfos">
</html>

<spacer height="10"/>

<tablePane
showQuery="false"
id="MessageTable"
tableName="Ens_Util.Log"
orderByClause="ID desc"
valueColumn="ID"
width="100%"
caption="Log-Meldungen"
fixedHeaders="false"
maxRows="100"
pageSize="20"
extraColumnWidth="3%"
showRowNumbers="false"
rowSelect="false"
showZebra="true"
useSnapshot="true"
>
<column hidden="true" header="ID" colName="ID" filterType="text" filterOp="["/>
<column header="Typ" colName="Type" filterType="enum" filterEnum="1,2,3,4" filterEnumDisplay="Assert,Error,Warning,Info"/>
<column header="Zeit" colName="TimeLogged" OnDrawCell="DrawTimeStampToDateTime" seed="3" filterType="date"/>
<column header="Nachricht" colName="Text" filterType="text" filterOp="["/>
<condition
colName="Type"
predicate="EQ"
value="Error"
cellStyle="background: #FF9999;"
/>
<condition
colName="Type"
predicate="EQ"
value="Warning"
cellStyle="background: #FFFF99;"
/>
</tablePane>

<tableNavigatorBar id="MessageTableNavBar" tablePaneId="MessageTable"/>

</vgroup>
<vgroup width="5%"/>

</hgroup>

</page>
]]></Data>
</XData>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Server Callback Methods:	=======================================

]]></Content>
</UDLText>

<Method name="GetHTMLProductionInfos">
<Description>
		Draw the HTML-Part containing the Production infos</Description>
<FormalSpec>pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK

	do ##class(Ens.Director).GetProductionStatus(.prodName,.status)
	if (prodName = "")
	{
		set prodName = "(Unbekannt)"
		set statusTxt = "(Unbekannt)"
		set imageName = "White"
	}
	else
	{
		set statusTxt = ##class(Ens.DataType.ProductionState).LogicalToDisplay(status)

		if (statusTxt = "Running") {
			set imageName = "Green"
		}
		elseif (statusTxt = "Stopped") {
			set imageName = "Red"
		}
		elseif (statusTxt = "Suspended") {
			set imageName = "Red"
		}
		elseif (statusTxt = "Troubled") {
			set imageName = "Yellow"
		}
		else
		{
			set imageName = "White"
		}
	}

	set imageFile = $$$APPURI _ "/pic/stat" _ imageName _ ".gif"

	set started = $get(^Ens.Configuration("csp","Activity",prodName,"started")) //$$$timeUTCtoLocal($get(^Ens.Configuration("csp","Activity",prodName,"started")))
	set stopped = $get(^Ens.Configuration("csp","Activity",prodName,"stopped")) //$$$timeUTCtoLocal($get(^Ens.Configuration("csp","Activity",prodName,"stopped")))

	do ##class(CSPX.EnsHomeSummary).GetServiceSummary(.tResult,0)
	set actLast = $get(tResult("1LastActivityTime"))
	set actCount = $get(tResult("2ActivitiesCompleted"))
	kill tResult

	do ##class(CSPX.EnsHomeSummary).GetLogSummary(.tResult,0)
	set errLast = $get(tResult("1LastErrorTime"))
	set errCount = $fnumber($get(tResult("2TotalErrorCount")),",")
	kill tResult

	&html<
		<div style="font-size: 1.4em; font-weight: bold; text-align: left;">
			<p><img src="#(imageFile)#"/> <b>#(prodName)#</b></p>
		</div>

		<table id="StatusTable">
			<tr>
				<th>Status:&nbsp;</th>
				<td>#(statusTxt)#</td>
			</tr>
			<tr>
				<th>Letzter Start:&nbsp;</th>
				<td>#(started)#</td>
			</tr>
			<tr>
				<th>Letzter Stop:&nbsp;</th>
				<td>#(stopped)#</td>
			</tr>
			<tr>
				<th>Letzte Aktivität:&nbsp;</th>
				<td>#(actLast)#</td>
			</tr>
			<tr>
				<th>Anzahl Aktivitäten seit Start:&nbsp;</th>
				<td>#(actCount)#</td>
			</tr>
			<tr>
				<th>Letzter Fehler seit Start:&nbsp;</th>
				<td>#(errLast)#</td>
			</tr>
			<tr>
				<th>Anzahl Fehler seit Start:&nbsp;</th>
				<td>#(errCount)#</td>
			</tr>
		</table>
	>

	kill prodName, status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Client Methods:		===============================================

]]></Content>
</UDLText>

<Method name="refreshTable">
<Description>
Refreshing Method for table pane</Description>
<FormalSpec>timer</FormalSpec>
<Language>javascript</Language>
<ClientMethod>1</ClientMethod>
<Implementation><![CDATA[
	//zenPage.getComponentById('productionInfos').redraw???();
	zenPage.getComponentById('MessageTable').executeQuery(true);
	timer.startTimer();
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.DispCons.Systems">
<Super>Alliance.Ens.DispCons.AbstractZENPage</Super>
<TimeChanged>61848,77103.712988</TimeChanged>
<TimeCreated>61810,55856.584121</TimeCreated>

<Parameter name="PAGENAME">
<Description>
Displayed name of this page.</Description>
<Default>Systemübersicht</Default>
</Parameter>

<XData name="Contents">
<Description>
This XML block defines the contents of this page.</Description>
<XMLNamespace>http://www.intersystems.com/zen</XMLNamespace>
<Data><![CDATA[
<page xmlns="http://www.intersystems.com/zen" title="Systemübersicht">

<timer timeout="10000" ontimeout="zenPage.refreshTable(zenThis);"/>

<hgroup width="100%">

<vgroup width="5%"/>
<vgroup width="90%">

<spacer height="10"/>

<hgroup>

<menu id="menu" layout="horizontal">
<menuItem caption="Systeme" link="Alliance.Ens.DispCons.Systems.cls" containerStyle="background: white;"/>
<menuItem caption="Prozesse" link="Alliance.Ens.DispCons.Processes.cls" containerStyle="background: lightgray;"/>
<menuItem caption="EDI Meldungen" link="Alliance.Ens.DispCons.AS2Messages.cls" containerStyle="background: lightgray;"/>
<menuItem caption="Produktion" link="Alliance.Ens.DispCons.Production.cls" containerStyle="background: lightgray;"/>
</menu>

<spacer width="100"/>

<label value="DISPONENTEN-MONITOR" valign="middle" containerStyle="font-size:120%; font-weight:'bold'; vertical-align:bottom; color:'darkblue';"/>

</hgroup>

<spacer height="10"/>

<tablePane
id="SystemsTable"
tableName="Alliance_Ens_Setup.AttachedSystems"
valueColumn="ID"
width="100%"
caption="Systemübersicht"
fixedHeaders="false"
maxRows="100"
pageSize="20"
extraColumnWidth="3%"
showRowNumbers="false"
rowSelect="false"
showZebra="true"
useSnapshot="true"
>
<column header="Status" colName="lastKALMessage as OnlineStatus" OnDrawCell="DrawSystemOnlineStatus" style="text-align: center;"/>
<column header="System" colName="systemID"/>
<column header="Name" colName="systemName"/>
<column header="Letzter Kontakt" colName="lastKALMessage as LastKALDatum" OnDrawCell="DrawTimeStampToDateTime"/>
<column header="Vor [Min]" colName="lastKALMessage as Diff" OnDrawCell="DrawDiff"/>
<column header="Letzte Aktivität" colName="lastKALMessageReceived->subTypValue"/>
<column header="Durchgeführt" colName="lastKALMessageReceived->timeStampCreated" OnDrawCell="DrawTimeStampToDateTime"/>
<column header="Lieferant" colName="lastKALMessageReceived->lieferantName"/>
<column header="Abnehmer" colName="lastKALMessageReceived->vzName"/>
<column header="Datum" colName="lastKALMessageReceived->datum" OnDrawCell="DrawDate"/>
</tablePane>

<spacer height="10"/>

<html>
<div style="text-align:right;">
Last Page Update: <div id="LastUpdated"></div>
</div>

<table>
<tr class="footerlinks">
<td align="right"><hr id="bar" size="5" style='width:92px;'/></td>
<td align="right">Seconds to refresh: </td>
<td id="idCount">0</td>
</tr>
</table>

</html>

</vgroup>
<vgroup width="5%"/>

</hgroup>

</page>
]]></Data>
</XData>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Server Callback Methods:	=======================================

]]></Content>
</UDLText>

<Method name="DrawDiff">
<Description>
	Input is a string in timestamp format. Output is the difference in minutes between this timestamp and now.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set value = %query(pName)
	if (value = "")		write "&nbsp;"		quit $$$OK

	write ..minutesSince(value)

	quit $$$OK
]]></Implementation>
</Method>

<Method name="DrawSystemOnlineStatus">
<Description>
	Input is a string in timestamp format. Output is a html string for an image.</Description>
<FormalSpec>pTable:%ZEN.Component.tablePane,pName:%String,pSeed:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set systemID = %query("SystemID")
	set onlineStatusGifName = "White"

	if (systemID = ##class(Alliance.Ens.Setup.AttachedSystems).AllianceId())
	{
		do ##class(Ens.Director).GetProductionStatus(.prodName,.status)
		if (prodName = "")
		{
			set onlineStatusGifName = "Red"
		}
		else
		{
			set statusTxt = ##class(Ens.DataType.ProductionState).LogicalToDisplay(status)

			if (statusTxt = "Running") {
				set onlineStatusGifName = "Green"
			}
			elseif (statusTxt = "Stopped") {
				set onlineStatusGifName = "Red"
			}
			elseif (statusTxt = "Suspended") {
				set onlineStatusGifName = "Red"
			}
			elseif (statusTxt = "Troubled") {
				set onlineStatusGifName = "Yellow"
			}
			else
			{
				set onlineStatusGifName = "White"
			}
		}
	}
	else
	{
		set value = %query(pName)
		if (value '= "")
		{
			set diffInMinutes = ..minutesSince(value)

			if (diffInMinutes >= ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Red().value)
			{
				set onlineStatusGifName = "Red"
			}
			elseif (diffInMinutes >= ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Yellow().value)
			{
				set onlineStatusGifName = "Yellow"
			}
			elseif (diffInMinutes >= ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).Green().value)
			{
				set onlineStatusGifName = "Green"
			}
			else
			{
				set onlineStatusGifName = "White"
			}
		}
	}
	write "<img src='" _ $$$APPURI _ "/pic/stat" _ onlineStatusGifName _ ".gif'>"

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Private:			===============================================

]]></Content>
</UDLText>

<Method name="minutesSince">
<ClassMethod>1</ClassMethod>
<FormalSpec>value:%String</FormalSpec>
<Private>1</Private>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	if (value = "")		quit -1

	set then = ##class(Base.DateTime).newFromTimeStamp(value)
	set now = ##class(Base.DateTime).now()
	set diff = now.durationBetween(then)
	quit diff.seconds \ 60
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	====	Client Methods:		===============================================

]]></Content>
</UDLText>

<Method name="refreshTable">
<Description>
Refreshing Method for table pane</Description>
<FormalSpec>timer</FormalSpec>
<Language>javascript</Language>
<ClientMethod>1</ClientMethod>
<Implementation><![CDATA[
	zenPage.getComponentById('SystemsTable').executeQuery(true);
	//zenPage.getComponentById('LastUpdated').innerHTML = new Date().toLocaleString();
	timer.startTimer();
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.KAL.MessagesReceived">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>61935,61695.15064</TimeChanged>
<TimeCreated>61802,63594.109159</TimeCreated>

<Property name="senderId">
<Type>%String</Type>
<Required>1</Required>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="timeStampReceived">
<Type>%TimeStamp</Type>
<InitialExpression>$zdatetime($zutil(188),3, 1, 6)</InitialExpression>
</Property>

<Property name="messageCount">
<Type>%Integer</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.E8F6D.MessagesRec2141D</DataLocation>
<DefaultData>MessagesReceivedDefaultData</DefaultData>
<IdLocation>^Alliance.E8F6D.MessagesRec2141D</IdLocation>
<IndexLocation>^Alliance.E8F6D.MessagesRec2141I</IndexLocation>
<StreamLocation>^Alliance.E8F6D.MessagesRec2141S</StreamLocation>
<Data name="MessagesReceivedDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>senderId</Value>
</Value>
<Value name="3">
<Value>timeStampReceived</Value>
</Value>
<Value name="4">
<Value>messageCount</Value>
</Value>
<Value name="5">
<Value>messages</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.DespatchAdviceRequest">
<Super>Ens.Request</Super>
<TimeChanged>61826,42953.934501</TimeChanged>
<TimeCreated>61747,62669.695496</TimeCreated>

<Parameter name="RESPONSECLASSNAME">
<Default>Alliance.Ens.Message.DespatchAdviceResponse</Default>
</Parameter>

<Property name="DespatchAdvice">
<Type>Alliance.Common.Model.DespatchAdvice.DespatchAdvice</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>DespatchAdviceRequestDefaultData</DefaultData>
<Data name="DespatchAdviceRequestDefaultData">
<Structure>listnode</Structure>
<Subscript>"DespatchAdviceRequest"</Subscript>
<Value name="1">
<Value>DespatchAdvice</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.DespatchAdviceResponse">
<Super>Ens.Response</Super>
<TimeChanged>61826,42751.739783</TimeChanged>
<TimeCreated>61754,39819.903217</TimeCreated>

<Property name="Status">
<Type>%Status</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>DespatchAdviceResponseDefaultData</DefaultData>
<Data name="DespatchAdviceResponseDefaultData">
<Structure>listnode</Structure>
<Subscript>"DespatchAdviceResponse"</Subscript>
<Value name="1">
<Value>Status</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.InvoiceRequest">
<Super>Ens.Request</Super>
<TimeChanged>61826,43364.84129</TimeChanged>
<TimeCreated>61747,62669.695496</TimeCreated>

<Parameter name="RESPONSECLASSNAME">
<Default>Alliance.Ens.Message.InvoiceResponse</Default>
</Parameter>

<Property name="Invoice">
<Type>Alliance.Common.Model.Invoice.Invoice</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>InvoiceRequestDefaultData</DefaultData>
<Data name="InvoiceRequestDefaultData">
<Structure>listnode</Structure>
<Subscript>"InvoiceRequest"</Subscript>
<Value name="1">
<Value>Invoice</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.InvoiceResponse">
<Super>Ens.Response</Super>
<TimeChanged>61826,43335.603048</TimeChanged>
<TimeCreated>61754,39819.903217</TimeCreated>

<Property name="Status">
<Type>%Status</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>InvoiceResponseDefaultData</DefaultData>
<Data name="InvoiceResponseDefaultData">
<Structure>listnode</Structure>
<Subscript>"InvoiceResponse"</Subscript>
<Value name="1">
<Value>Status</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.KALMessagesRequest">
<Super>Ens.Request</Super>
<TimeChanged>61828,41338.826779</TimeChanged>
<TimeCreated>61802,63651.70555</TimeCreated>

<Property name="messages">
<Type>Alliance.Ens.KAL.MessagesReceived</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>KALMessagesRequestDefaultData</DefaultData>
<Data name="KALMessagesRequestDefaultData">
<Structure>listnode</Structure>
<Subscript>"KALMessagesRequest"</Subscript>
<Value name="1">
<Value>messages</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.OrderRequest">
<Super>Ens.Request</Super>
<TimeChanged>61828,41829.048451</TimeChanged>
<TimeCreated>61824,41962.855266</TimeCreated>

<Parameter name="RESPONSECLASSNAME">
<Default>Alliance.Ens.Message.OrderResponse</Default>
</Parameter>

<Property name="Order">
<Type>Alliance.Common.Model.Order.Order</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>OrderRequestDefaultData</DefaultData>
<Data name="OrderRequestDefaultData">
<Structure>listnode</Structure>
<Subscript>"OrderRequest"</Subscript>
<Value name="1">
<Value>Order</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.OrderResponse">
<Super>Ens.Response</Super>
<TimeChanged>61828,42040.59632</TimeChanged>
<TimeCreated>61754,39819.903217</TimeCreated>

<Property name="Status">
<Type>%Status</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>OrderResponseDefaultData</DefaultData>
<Data name="OrderResponseDefaultData">
<Structure>listnode</Structure>
<Subscript>"OrderResponse"</Subscript>
<Value name="1">
<Value>Status</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Message.RequestWithID">
<Super>Ens.Request</Super>
<TimeChanged>62033,57000.551353</TimeChanged>
<TimeCreated>61824,61756.625524</TimeCreated>

<Property name="id">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Method name="%OnNew">
<FormalSpec>id:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set ..id = id
	quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>RequestWithIDDefaultData</DefaultData>
<Data name="RequestWithIDDefaultData">
<Structure>listnode</Structure>
<Subscript>"RequestWithID"</Subscript>
<Value name="1">
<Value>id</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Operation.DESADVInterchangeMessageWriter">
<ProcedureBlock>1</ProcedureBlock>
<Super>EnsLib.EDI.EDIFACT.Operation.FileOperation</Super>
<TimeChanged>61828,56722.392231</TimeChanged>
<TimeCreated>61826,49495.296496</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.File.OutboundAdapter</Default>
</Parameter>

<Parameter name="INVOCATION">
<Default>Queue</Default>
</Parameter>

<Parameter name="SETTINGS">
<Default>SeparatorsBackup</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="SeparatorsBackup">
<Type>%String</Type>
<Parameter name="MAXLEN" value="9"/>
</Property>

<Method name="WriteDESADVInterchange">
<FormalSpec>pRequest:EnsLib.EDI.EDIFACT.Document,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #Dim tSC As %Status = $$$OK
    #Dim tFilename As %String = ""
    #Dim Adapter As EnsLib.File.OutboundAdapter

    // Create new file name  
    Set tFilename = ..CreateFilename(..Filename)

    // Write the EDIFACT Interchange file
    set tSC = ..outputDocument(tFilename, pRequest, ..Separators)
    
    $$$LOGINFO("Writing file '" _ ..Adapter.FilePath _ "\" _ tFilename _"'")

    quit tSC
]]></Implementation>
</Method>

<Method name="CreateFilename">
<FormalSpec>pFilename:%String,pTimestamp:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    // Create TimeStamp for file if any "%.."-patterns defined
    set tFilename=..Adapter.CreateTimestamp(pFilename, pFilename)
    
    set tFilename = $Replace(tFilename, pFilename, "")
    set tFilename = $Replace(tFilename, "__", "_")
    set tFilename = $Replace(tFilename, "-", "")
    set tFilename = $Replace(tFilename, ".", "")
    set tFilename = $Replace(tFilename, "_", ".")
    
    // Add counter
    if $Length(tFilename, "$INC") > 1 {
        set tCounter = $Increment(^Alliance.ConfigNameSequenceNumber(..%ConfigName))
        // Add leading zeros (search for width of the number, assuming 20 is max value)
        for i=1:1:20 {
            set tFilename = $LISTTOSTRING($LISTFROMSTRING(tFilename,"$INC("_i_")"), $TRANSLATE($JUSTIFY(tCounter, i)," ",0))
        }
    }

    // Return file name
    Quit tFilename
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
    <MapItem MessageType="EnsLib.EDI.EDIFACT.Document"> 
        <Method>WriteDESADVInterchange</Method>
    </MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.DebugOutputOperation">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessOperation</Super>
<TimeChanged>61824,31539.476595</TimeChanged>
<TimeCreated>61750,63296.411328</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.File.OutboundAdapter</Default>
</Parameter>

<Parameter name="INVOCATION">
<Default>Queue</Default>
</Parameter>

<Parameter name="SETTINGS">
<Default>FileName, ColumnSeparator</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the column seperator in the CSV file

]]></Content>
</UDLText>

<Property name="ColumnSeparator">
<Type>%String</Type>
</Property>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="FileName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="256"/>
</Property>

<Method name="WriteLogMessage">
<FormalSpec>pRequest:Ens.Request,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	#Dim tSC As %Status
	#Dim Adapter As EnsLib.File.OutboundAdapter
	#Dim tFileName As %String

	// Initialise variables
	Set tSC = $$$OK
	Set tFileName = "" 
	
	// Check if file exists and if not create a new file and write the two header rows (info and column header)
	If ((tFileName="") || ('..Adapter.Exists(tFileName)))
	{
		Set tFileName = ..CreateFileNameTimeStamp()
	}

	// Get request object properties and set the outbound line string (New version utilizing messages)
	Set tLine =
			pRequest.messages.senderId
		_ ..ColumnSeparator _ pRequest.messages.messageCount
		_ ..ColumnSeparator _ pRequest.messages.timeStampReceived
		
	// Write the outbound line string
	Set tSC=..Adapter.PutLine(tFileName, tLine)
	
	Quit tSC
]]></Implementation>
</Method>

<Method name="CreateFileNameTimeStamp">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	// Create TimeStamp for file if any "%.."-patterns defined
	Set tFilename=..Adapter.CreateTimestamp(..FileName,..FileName)
	
	// Add counter
	if $Length(tFilename, "$INC") > 1 {
		set tCounter = $Increment(^Alliance.BO(..%ConfigName))
		// Add leading zeros (search for width of the number, assuming 20 is max value)
		for i=1:1:20 {
			set tFilename = $LISTTOSTRING($LISTFROMSTRING(tFilename,"$INC("_i_")"), $TRANSLATE($JUSTIFY(tCounter, i)," ",0))
		}
	}
	
	// Return file name
	Quit tFilename
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
	<MapItem MessageType="Ens.Request"> 
		<Method>WriteLogMessage</Method>
	</MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.GetDespatchAdviceFromAgrisM">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessOperation</Super>
<TimeChanged>61832,38166.653715</TimeChanged>
<TimeCreated>61824,63961.499324</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.SOAP.OutboundAdapter</Default>
</Parameter>

<Method name="id">
<FormalSpec>pRequest:Alliance.Ens.Message.RequestWithID,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set ..Adapter.WebServiceClientClass = "Alliance.Ens.WS.WSClientGetDespatchAdvice"
	set ..Adapter.WebServiceURL = ##class(Alliance.Ens.Setup.AttachedSystems).GetWebServiceURL("AgrisM") _ "Alliance.Agris.WS.WSServiceReturnDespatchAdvice.cls"

	Set status = ..Adapter.InvokeMethod("id", .result, pRequest.id)
	quit:($$$ISERR(status)) status

	if (result = $$$NULLOREF)
	{
		$$$LOGINFO("No Despatch Advice found on AgrisM with Id = " _ pRequest.id)
		quit $$$ERROR("No Despatch Advice found on AgrisM with Id = " _ pRequest.id)
	}

	if (##class(Alliance.Common.Model.DespatchAdvice.DespatchAdvice).%ExistsId(pRequest.id))
	{
		$$$LOGINFO("Deleting existing Despatch Advice with Id = " _ pRequest.id)
		do ##class(Alliance.Common.Model.DespatchAdvice.DespatchAdvice).%DeleteId(pRequest.id)
	}

	$$$LOGINFO("Saving Despatch Advice with Id = " _ pRequest.id)

	quit result.%Save()
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
	<MapItem MessageType="Alliance.Ens.Message.RequestWithID">
		<Method>id</Method>
	</MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.GetFinalOrderFromAgrisM">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessOperation</Super>
<TimeChanged>61836,43176.521198</TimeChanged>
<TimeCreated>61824,61145.875094</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.SOAP.OutboundAdapter</Default>
</Parameter>

<Method name="id">
<FormalSpec>pRequest:Alliance.Ens.Message.RequestWithID,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	$$$LOGINFO("Get Final Order from AgrisM with id = " _ pRequest.id)

	set ..Adapter.WebServiceClientClass = "Alliance.Ens.WS.WSClientGetFinalOrder"
	set ..Adapter.WebServiceURL = ##class(Alliance.Ens.Setup.AttachedSystems).GetWebServiceURL("AgrisM") _ "Alliance.Agris.WS.WSServiceReturnFinalOrder.cls"

	Set status = ..Adapter.InvokeMethod("id", .result, pRequest.id)
	quit:($$$ISERR(status)) status

	if (result = $$$NULLOREF)
	{
		$$$LOGINFO("No order found with Id = " _ pRequest.id)
		quit $$$ERROR("No order found with Id = " _ pRequest.id)
	}

	if (##class(Alliance.Common.Model.Order.Order).%ExistsId(pRequest.id))
	{
		$$$LOGINFO("Deleting existing order with Id = " _ pRequest.id)
		do ##class(Alliance.Common.Model.Order.Order).%DeleteId(pRequest.id)
	}

	$$$LOGINFO("Saving order with Id = " _ pRequest.id)

	quit result.%Save()
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
	<MapItem MessageType="Alliance.Ens.Message.RequestWithID">
		<Method>id</Method>
	</MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.GetInvoiceFromAgrisM">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessOperation</Super>
<TimeChanged>62033,58672.977791</TimeChanged>
<TimeCreated>61824,65581.968779</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.SOAP.OutboundAdapter</Default>
</Parameter>

<Method name="id">
<FormalSpec>pRequest:Alliance.Ens.Message.RequestWithID,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set ..Adapter.WebServiceClientClass = "Alliance.Ens.WS.WSClientGetInvoice"
	set ..Adapter.WebServiceURL = ##class(Alliance.Ens.Setup.AttachedSystems).GetWebServiceURL("AgrisM") _ "Alliance.Agris.WS.WSServiceReturnInvoice.cls"

	Set status = ..Adapter.InvokeMethod("id", .result, pRequest.id)
	
	quit:($$$ISERR(status)) status

	if (result = $$$NULLOREF)
	{
		$$$LOGINFO("No invoice found with Id = " _ pRequest.id)
		quit $$$ERROR("No invoice found with Id = " _ pRequest.id)
	}

	if (##class(Alliance.Common.Model.Invoice.Invoice).%ExistsId(pRequest.id))
	{
		$$$LOGINFO("Deleting existing invoice with Id = " _ pRequest.id)
		do ##class(Alliance.Common.Model.Invoice.Invoice).%DeleteId(pRequest.id)
	}

	$$$LOGINFO("Saving invoice with Id = " _ pRequest.id)

	quit result.%Save()
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
	<MapItem MessageType="Alliance.Ens.Message.RequestWithID">
		<Method>id</Method>
	</MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.INVOICInterchangeMessageWriter">
<ProcedureBlock>1</ProcedureBlock>
<Super>EnsLib.EDI.EDIFACT.Operation.FileOperation</Super>
<TimeChanged>61828,56766.960947</TimeChanged>
<TimeCreated>61826,49495.296496</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.File.OutboundAdapter</Default>
</Parameter>

<Parameter name="INVOCATION">
<Default>Queue</Default>
</Parameter>

<Parameter name="SETTINGS">
<Default>SeparatorsBackup</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="SeparatorsBackup">
<Type>%String</Type>
<Parameter name="MAXLEN" value="9"/>
</Property>

<Method name="WriteINVOICInterchange">
<FormalSpec>pRequest:EnsLib.EDI.EDIFACT.Document,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #Dim tSC As %Status = $$$OK
    #Dim tFilename As %String = ""
    #Dim Adapter As EnsLib.File.OutboundAdapter

    // Create new file name  
    Set tFilename = ..CreateFilename(..Filename)

    // Write the EDIFACT Interchange file
    set tSC = ..outputDocument(tFilename, pRequest, ..Separators)
    
    $$$LOGINFO("Writing file '" _ ..Adapter.FilePath _ "\" _ tFilename _"'")

    quit tSC
]]></Implementation>
</Method>

<Method name="CreateFilename">
<FormalSpec>pFilename:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    // Create TimeStamp for file if any "%.."-patterns defined
    set tFilename=..Adapter.CreateTimestamp(pFilename, pFilename)
    
    set tFilename = $Replace(tFilename, pFilename, "")
    set tFilename = $Replace(tFilename, "__", "_")
    set tFilename = $Replace(tFilename, "-", "")
    set tFilename = $Replace(tFilename, ".", "")
    set tFilename = $Replace(tFilename, "_", ".")
    
    // Add counter
    if $Length(tFilename, "$INC") > 1 {
        set tCounter = $Increment(^Alliance.ConfigNameSequenceNumber(..%ConfigName))
        // Add leading zeros (search for width of the number, assuming 20 is max value)
        for i=1:1:20 {
            set tFilename = $LISTTOSTRING($LISTFROMSTRING(tFilename,"$INC("_i_")"), $TRANSLATE($JUSTIFY(tCounter, i)," ",0))
        }
    }

    // Return file name
    Quit tFilename
]]></Implementation>
</Method>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
    <MapItem MessageType="EnsLib.EDI.EDIFACT.Document"> 
        <Method>WriteINVOICInterchange</Method>
    </MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Operation.SendNewOrderToAgrisM">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessOperation</Super>
<TimeChanged>61828,59468.923992</TimeChanged>
<TimeCreated>61824,60960.703732</TimeCreated>

<Parameter name="ADAPTER">
<Default>EnsLib.SOAP.OutboundAdapter</Default>
</Parameter>

<Method name="sendOrder">
<FormalSpec>pRequest:Alliance.Ens.Message.OrderRequest,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Library.Status</ReturnType>
<Implementation><![CDATA[
	set order = pRequest.Order
	set sys = ""
	if (order.ObjectType = 100) {
		set sys = "AgrisM"
		set order.Status = 1050
		set order.StatusChanged = $ZDT($ZUTIL(188),3)
		do order.%Save()
		$$$LOGINFO("Order saved")
	}
	if (order.ObjectType = 110) {
		set sys = order.Supplier.PartyId
		set order.Status = 1200
		set order.StatusChanged = $ZDT($ZUTIL(188),3)
		do order.%Save()
		set master = ##class(Alliance.Common.Model.Order.Order).%OpenId(order.ParentID)
		set master.Status = 1200
		set master.StatusChanged = $ZDT($ZUTIL(188),3)
		do master.%Save()
		$$$LOGINFO("Master-Order saved")
	}

	set ..Adapter.WebServiceURL = ##class(Alliance.Ens.Setup.AttachedSystems).GetWebServiceURL(sys) _ "Alliance.Agris.WS.WSServiceReceiveNewOrder.cls"
	set ..Adapter.WebServiceClientClass = "Alliance.Ens.WS.WSClientSendNewOrder"

 	set tSCSoap = ..Adapter.InvokeMethod("newOrder", .SendOrderResult, order)
 	Quit:$$$ISERR(tSCSoap) tSCSoap

 	set tSC = pRequest.NewResponse(.pResponse)
 	Quit:$$$ISERR(tSC) tSC

 	Set pResponse.Status = tSCSoap
 	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
/*
/// This is the default message handler.  All request types not declared in the message map are delivered here
Method OnMessage(pRequest As %Library.Persistent, Output pResponse As %Library.Persistent) As %Status
{
	Quit ..sendOrder(pRequest, pResponse)
}
*/
]]></Content>
</UDLText>

<XData name="MessageMap">
<Data><![CDATA[
<MapItems>
    <MapItem MessageType="Alliance.Ens.Message.OrderRequest">
        <Method>sendOrder</Method>
    </MapItem>
</MapItems>
]]></Data>
</XData>
</Class>


<Class name="Alliance.Ens.Process.CreateKALMessage">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62046,38058.851582</TimeChanged>
<TimeCreated>61832,39109.273434</TimeCreated>

<Method name="OnRequest">
<FormalSpec>pRequest:Ens.Request,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set requestClass = pRequest.%ClassName(1)

	if (requestClass = "Alliance.Ens.Message.OrderRequest")
	{
		quit ..anOrderCameIn(pRequest)
	}
	elseif (requestClass = "Alliance.Ens.Message.DespatchAdviceRequest")
	{
		quit ..aDespatchAdviceCameIn(pRequest)
	}
	elseif (requestClass = "Alliance.Ens.Message.InvoiceRequest")
	{
		quit ..aInvoiceCameIn(pRequest)
	}
	else
	{
		//	...
	}

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	===========================================================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Private Methods		===============================================

]]></Content>
</UDLText>

<Method name="anOrderCameIn">
<FormalSpec>pRequest:Alliance.Ens.Message.OrderRequest</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set order = pRequest.Order
	set vzName = order.DeliveryParty.Name1 _ " " _ order.DeliveryParty.Name2
	set orderNr = "'" _ order.OrderNo _ "'"

	//	Create a KAL Message:
	set typ = ##class(Alliance.Common.KAL.Code.MessageType).Lieferung()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).BestellungInAllianceAngekommen()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).Alliance()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ##class(Alliance.Common.KAL.Message).new(.status, typ, subTyp, senderTyp, severity, todayH, vzName,, orderNr)

	quit ..doCreateKALMessage(message)
]]></Implementation>
</Method>

<Method name="aDespatchAdviceCameIn">
<FormalSpec>pRequest:Alliance.Ens.Message.DespatchAdviceRequest</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set id = pRequest.DespatchAdvice.%Id()
	set bestellNr = "'" _ pRequest.DespatchAdvice.OrderNo _ "'"

	//	Create a KAL Message:
	set typ = ##class(Alliance.Common.KAL.Code.MessageType).DespatchAdvice()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).DespatchAdviceInAllianceAngek()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).Alliance()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ##class(Alliance.Common.KAL.Message).new(.status, typ, subTyp, senderTyp, severity, todayH,,, bestellNr, id)

	quit ..doCreateKALMessage(message)
]]></Implementation>
</Method>

<Method name="aInvoiceCameIn">
<FormalSpec>pRequest:Alliance.Ens.Message.InvoiceRequest</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set id = pRequest.Invoice.%Id()
	set bestellNr = ""

	for i=1:1:pRequest.Invoice.RefInfos.Count() {
		set r = pRequest.Invoice.RefInfos.GetAt(i)
		if ((r '= $$$NULLOREF) && (r.ReferenceType = "ON")) {
			set bestellNr = "'" _ r.ReferenceNo _ "'"
			quit
		}
	}
	set vzName = ""
	
	for i=1:1:pRequest.Invoice.PartyInfos.Count() {
		set p = pRequest.Invoice.PartyInfos.GetAt(i)
		if ((p '= $$$NULLOREF) && (p.Type = "DP")) {	
			set vzName = p.Name _ " " _ p.Name2
			quit
		}
	}
	
	set invoicNr = pRequest.Invoice.InvoiceNo

	//	Create a KAL Message:
	set typ = ##class(Alliance.Common.KAL.Code.MessageType).Invoice()
	set subTyp = ##class(Alliance.Common.KAL.Code.MessageSubType).InvoiceInAllianceAngekommen()
	set senderTyp = ##class(Alliance.Common.KAL.Code.MessageSenderType).Alliance()
	set severity = ##class(Alliance.Common.KAL.Code.MessageSeverity).Info()
	set todayH = ##class(Base.DateTime).today().toHorolog()

	set message = ##class(Alliance.Common.KAL.Message).new(.status, typ, subTyp, senderTyp, severity, todayH,vzName,, bestellNr, id _" Invoice Nr: "_invoicNr)

	quit ..doCreateKALMessage(message)
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	===========================================================================

]]></Content>
</UDLText>

<Method name="doCreateKALMessage">
<FormalSpec>message:Alliance.Common.KAL.Message</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set message.timeStampTransmitted = $zdatetime($zutil(188), 3, 1, 6)
	set message.isProcessed = $$$NO
	set status = message.%Save()
	quit:($$$ISERR(status)) status

	//	Create a KAL MessagesReceived:
	set messagesReceived = ##class(Alliance.Ens.KAL.MessagesReceived).%New()
	set messagesReceived.senderId = message.clientId
	set messagesReceived.messageCount = 1
	set status = messagesReceived.%Save()
	quit:($$$ISERR(status)) status

	//	Update AttachedSystems' last received KAL-message:
	do ##class(Alliance.Ens.Setup.AttachedSystems).setLastKALMessageReceived(message)

	//	Create a KALMessageRequest:
	set messagesRequest = ##class(Alliance.Ens.Message.KALMessagesRequest).%New()
	set messagesRequest.messages = messagesReceived

	//	Trigger KAL Message Process to digest this KAL message (don't expect a response):
	do ..SendRequestAsync("KAL Message Process", messagesRequest, 0)

	quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.DespatchAdviceProcessor">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>61836,44019.090438</TimeChanged>
<TimeCreated>61836,42029.641062</TimeCreated>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.RequestWithID,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set id = pRequest.id

	$$$LOGINFO("Get Despatch Advice from AgrisM with id = " _ id)

	//set request = ##class(Alliance.Ens.Message.RequestWithID).%New(id)
	//	We have to send this syncronously because otherwise, the following %OpenId()-command fails:
	do ..SendRequestSync("Get DespatchAdvice from AgrisM", pRequest, .pResponse,, "Get DespatchAdvice from AgrisM")

	set despatchAdvice = ##class(Alliance.Common.Model.DespatchAdvice.DespatchAdvice).%OpenId(id)
	if (despatchAdvice = $$$NULLOREF)
	{
		$$$LOGINFO("No Despatch Advice found with Id = " _ id)
		quit
	}

	set despatchAdviceRequest = ##class(Alliance.Ens.Message.DespatchAdviceRequest).%New() 
	set despatchAdviceRequest.DespatchAdvice = despatchAdvice

	//	Create KAL Message that the Despatch Advice arrived on Alliance:
	do ..SendRequestAsync("Create KAL Message", despatchAdviceRequest, 0)

	//
	// Process the conversion of the model object to an EDIFACT output: DESADV & DESADV Interchange
	//
	do ..SendRequestAsync("Convert DespatchAdvice to EDIFACT format", despatchAdviceRequest, 0,, "Convert Despatch Advice to EDIFACT format")

	quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.InvoiceProcessor">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62033,55011.788927</TimeChanged>
<TimeCreated>61836,43449.890832</TimeCreated>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.RequestWithID,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	//$$$LOGINFO("Get Invoice from AgrisM with id = " _ pRequest.id)

	//do ..SendRequestSync("Get Invoice from AgrisM", pRequest, .pResponse,, "Get Invoice from AgrisM")

	set id = pRequest.id

	$$$LOGINFO("Get Invoice from AgrisM with id = " _ id)

	//set request = ##class(Alliance.Ens.Message.RequestWithID).%New(id)
	//	We have to send this syncronously because otherwise, the following %OpenId()-command fails:
	do ..SendRequestSync("Get Invoice from AgrisM", pRequest, .pResponse,, "Get Invoice from AgrisM")

	set invoice = ##class(Alliance.Common.Model.Invoice.Invoice).%OpenId(id)
	if (invoice = $$$NULLOREF)
	{
		$$$LOGINFO("No Invoice found with Id = " _ id)
		quit
	}

	set invoiceRequest = ##class(Alliance.Ens.Message.InvoiceRequest).%New() 
	set invoiceRequest.Invoice = invoice

	//	Create KAL Message that the Invoice arrived on Alliance:
	do ..SendRequestAsync("Create KAL Message", invoiceRequest, 0)

	//
	// Process the conversion of the model object to an EDIFACT output: INVOIC & INVOIC Interchange
	//
	do ..SendRequestAsync("Convert Invoice to EDIFACT format", invoiceRequest, 0,, "Convert Invoice to EDIFACT format")

	quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.KALMessageProcess">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62033,55405.563773</TimeChanged>
<TimeCreated>61751,64230.913494</TimeCreated>

<Property name="MessagePickupOperation">
<Description>
Configuration items to which to send Documents</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Property name="OrderDeliveryOperation">
<Description>
Configuration items to which to send Documents</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Parameter name="SETTINGS">
<Default>MessagePickupOperation,OrderDeliveryOperation</Default>
</Parameter>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.KALMessagesRequest,*pResponse:Ens.Response</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set messages = pRequest.messages

	set resultSet = ##class(%ResultSet).%New("Alliance.Common.KAL.Message:unprocessedMessages")
	do resultSet.Execute()
	while (resultSet.Next())
	{
		set messageId = $get(resultSet.Data("ID"))
		set message = ##class(Alliance.Common.KAL.Message).%OpenId(messageId)
		if (message = $$$NULLOREF)
		{
			set status = $$$ERROR("Could not load message with ID=" _ messageId)
			quit
		}

		set messageType = message.getTyp()
		set messageSubType = message.getSubTyp()

		$$$LOGINFO(messageType.value _ ":" _ messageSubType.value)

		if (messageType.isLieferung())
		{
			if (messageSubType.isDefinTeilbestellungErfasst())
			{
				set request = ##class(Alliance.Ens.Message.RequestWithID).%New(message.additionalText)
				do ..SendRequestAsync("Get Final Order from AgrisM", request, 0,, "Get Final Order from AgrisM")
			}
		}
		elseif (messageType.isDespatchAdvice())
		{
			if (messageSubType.isDespatchAdviceErstellt())
			{
				set request = ##class(Alliance.Ens.Message.RequestWithID).%New(message.additionalText)
				do ..SendRequestAsync("Process new DespatchAdvice", request, 0,, "Process new Despatch Advice")
			}
		}
		elseif (messageType.isInvoice())
		{
			if (messageSubType.isInvoiceErstellt())
			{
				set request = ##class(Alliance.Ens.Message.RequestWithID).%New(message.additionalText)
				do ..SendRequestSync("Process new Invoice", request, .response,, "Process new Invoice from AgrisM")
			}
		}

		set message.isProcessed = $$$YES
		do message.%Save()
	}

	Quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
/*
/// Handle a 'Response'
Method OnResponse(request As Ens.Request, ByRef response As Alliance.Ens.Message.DespatchAdviceResponse, callrequest As Ens.Request, callresponse As Ens.Response, pCompletionKey As %String) As %Status
{
    set response.Status = $$$OK
    quit $$$OK
}
*/
]]></Content>
</UDLText>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>KALMessageProcessDefaultData</DefaultData>
<Data name="KALMessageProcessDefaultData">
<Structure>listnode</Structure>
<Subscript>"KALMessageProcess"</Subscript>
<Value name="1">
<Value>MessagePickupOperation</Value>
</Value>
<Value name="2">
<Value>OrderDeliveryOperation</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.ModelDespatchAdvice2DESADV">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>61829,35816.678573</TimeChanged>
<TimeCreated>61824,57247.625691</TimeCreated>

<Parameter name="SETTINGS">
<Default>OutputTestEDIFACTMessage</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="OutputTestEDIFACTMessage">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.DespatchAdviceRequest,*pResponse:Alliance.Ens.Message.DespatchAdviceResponse</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim tSC As %Library.Status = $$$OK
    #dim tDESADV As EnsLib.EDI.EDIFACT.Document
    
    if (..OutputTestEDIFACTMessage = 1) {
 
    $$$LOGINFO("Processing Model DespatchAdvice to EDIFACT DESADV")
    
    // Create Response Object
    set pResponse = ##class(Alliance.Ens.Message.DespatchAdviceResponse).%New()
    if '$IsObject(pResponse) {
        set tSC = $$$ERROR("Response 'Alliance.Ens.Message.DespatchAdviceResponse' konnte nicht alloziert werden!") 
        quit tSC
    }
    
    //
    // Tranform the Despatch Advice to DESADV
    //
    set tDTL = ##class(Alliance.Ens.DTL.ModelDespatchAdvice2EDI).%New()
    if '$IsObject(tDTL) {
        set tSC = $$$ERROR("Data Transformation 'Alliance.Ens.DTL.ModelDespatchAdvice2EDI' kann nicht alloziert werden!")
        quit tSC 
    }
    // Do the transformation
    set tSC = tDTL.Transform(pRequest, .tDESADV)
    if ($$$ISERR(tSC)) {
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelDespatchAdvice2EDI' kann nicht durchgeführt werden!")
        quit tSC
    }
    
    $$$LOGINFO("DESADV Message Stream: " _ tDESADV.OutputToString(tDESADV.Separators, .tSC))
    
    //
    // Send to DESADV EDIFACT writer
    //
    set tSC = ..SendRequestAsync("DESADVMessageWriter", tDESADV) Quit:$$$ISERR(tSC) tSC

    }

     quit tSC
]]></Implementation>
</Method>

<Method name="OnResponse">
<Description>
Handle a 'Response'</Description>
<FormalSpec><![CDATA[request:Ens.Request,&response:Alliance.Ens.Message.DespatchAdviceResponse,callrequest:Ens.Request,callresponse:Ens.Response,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    // Subclass responsibility
    set response.Status = $$$OK
    
    quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ModelDespatchAdvice2DESADVDefaultData</DefaultData>
<Data name="ModelDespatchAdvice2DESADVDefaultData">
<Structure>listnode</Structure>
<Subscript>"ModelDespatchAdvice2DESADV"</Subscript>
<Value name="1">
<Value>test</Value>
</Value>
<Value name="2">
<Value>OutputTestEDIFACTMessage</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.ModelDespatchAdvice2DESADVInterchange">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62046,39751.687584</TimeChanged>
<TimeCreated>61824,57247.625691</TimeCreated>

<Parameter name="SETTINGS">
<Default>OutputTestEDIFACTMessage, OutputTestEDIFACTMessageWithTestIndicator</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="OutputTestEDIFACTMessage">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Property name="OutputTestEDIFACTMessageWithTestIndicator">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.DespatchAdviceRequest,*pResponse:Alliance.Ens.Message.DespatchAdviceResponse</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim tSC As %Library.Status = $$$OK
    #dim tDESADVMessage As EnsLib.EDI.EDIFACT.Document
    #dim tDESADVInterchange As EnsLib.EDI.EDIFACT.Document
    #dim tSegment As EnsLib.EDI.EDIFACT.Segment
    
    $$$LOGINFO("Processing Model DespatchAdvice to EDIFACT DESADV Interchange")
    
    // Create Response Object
    set pResponse = ##class(Alliance.Ens.Message.DespatchAdviceResponse).%New()
    if '$IsObject(pResponse) {
        set tSC = $$$ERROR("Response 'Alliance.Ens.Message.DespatchAdviceResponse' konnte nicht alloziert werden!") 
        quit tSC
    }
 	
    //
    // Create EDIFACT Interchange for DESADV
    //
    set tDESADVInterchange = ##class(EnsLib.EDI.EDIFACT.Document).%New()
    set tDESADVInterchange.DocType = "D96A:Interchange"
    set tDESADVInterchange.Separators = ":+? "
 
    //
    // Tranform the Despatch Advice to DESADV
    //
    // Create the DTL
    set tDTL = ##class(Alliance.Ens.DTL.ModelDespatchAdvice2EDI).%New()
    if '$IsObject(tDTL) {
        set tSC = $$$ERROR("Data Transformation 'Alliance.Ens.DTL.ModelDespatchAdvice2EDI' kann nicht alloziert werden!")
        quit tSC 
    }
    // Do the transformation
    set tSC = tDTL.Transform(pRequest, .tDESADVMessage)
    if ($$$ISERR(tSC)) {
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelDespatchAdvice2EDI' kann nicht durchgeführt werden!")
        quit tSC
    }
    if '$IsObject(tDESADVMessage) {
        $$$LOGERROR("Data Transformation hat keine gültige DESADV EDIFACT Message erzeugt!")
        set tSC = $$$ERROR("Data Transformation hat keine gültige DESADV EDIFACT Message erzeugt!")
        quit tSC
    }
    // Save DESADV EDIFACT Message
    do tDESADVMessage.%Save() 
    if (..OutputTestEDIFACTMessage = 1) {
        $$$LOGINFO("DESADV Message Stream: " _ tDESADVMessage.OutputToString(tDESADVInterchange.Separators, .tSC))
    }
    
    //
    // Generate DESADV EDIFACT Interchange UNA segment
    //                                                                              
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString("UNA:+.? ", .tSC, ":+.?")
    set tSegment.Separators = tDESADVInterchange.Separators
    do tDESADVInterchange.AppendSegment(tSegment)  
    // Save DESADV EDIFACT Interchange UNA segment
    do tDESADVInterchange.%Save()

    //
    // Generate DESADV EDIFACT Interchange UNB header segment
    //
    //                      
    set tSegmentUNB =
      // UNB S001
        "UNB"_
      // UNB 0001:UNOC                                  UNB 0002:3
         "+"_pRequest.DespatchAdvice.EDIHeader.SyntaxId_":"_pRequest.DespatchAdvice.EDIHeader.SyntaxVer_
      // UNB S002.0004                                  UNB S002.0007
         "+"_pRequest.DespatchAdvice.EDIHeader.SenderId_":"_pRequest.DespatchAdvice.EDIHeader.SenderIdCodeQual_
      // UNB S003.0010                                     UNB S003.0007                                             UNB S003.0014 
         "+"_pRequest.DespatchAdvice.EDIHeader.RecipientId_":"_pRequest.DespatchAdvice.EDIHeader.RecipientIdCodeQual_":"_pRequest.DespatchAdvice.EDIHeader.RoutingAdr_
      // UNB S004.0017 : (Format YYMMDD)                       UNB S004.0019 : (Format HHMM)                         UNB S004.0020
         "+"_pRequest.DespatchAdvice.EDIHeader.InterchangeDate_":"_pRequest.DespatchAdvice.EDIHeader.InterchangeTime_"+"_pRequest.DespatchAdvice.EDIHeader.InterchangeCtrlRef_
      // UNB S005.0022    UNB S005.0026                                        UNB S005.0029    UNB S005.0031                                                                                     
         "+"_             "+"_pRequest.DespatchAdvice.EDIHeader.ApplicationRef_"+"_             "+"_
      // UNB S005.0032      
         "+"_pRequest.DespatchAdvice.EDIHeader.CommunicationAgrmt
      // UNB S005.0035 This has to set only for test purposes!!!                                   
      if (..OutputTestEDIFACTMessageWithTestIndicator = 1) { 
         // Control of the test indicator is in the production configuration!!! (pRequest.DespatchAdvice.EDIHeader.TestIndicator
         set tSegmentUNB = tSegmentUNB_"+"_"1"
      }
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString(tSegmentUNB,,":+.?")
    set tSegment.Separators = tDESADVInterchange.Separators
    do tDESADVInterchange.AppendSegment(tSegment)
    // Save DESADV EDIFACT Interchange UNB header segment
    do tDESADVInterchange.%Save()

    //
    // Generate DESADV EDIFACT Interchange UNHDocsRef segment
    //
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).%New()
    set tSegment.Separators = tDESADVInterchange.Separators
    do tSegment.SetValueAt("UNHDocsRef"_tSegment.ES_3)
    do tDESADVInterchange.AppendSegment(tSegment)
    // Save DESADV EDIFACT Interchange
    do tDESADVInterchange.%Save()
    
    // 
    // Generate Interchange UNHDocsRef child references
    //
    // At the moment we just have one message per EDIFACT interchange, 
    // do not forget to change the count in the UNZ trail segment if there are more messages!!!
    //
    do tDESADVInterchange.AddChild(3, tDESADVMessage)
    // Save DESADV EDIFACT Interchange UNHDocsRef child reference
    do tDESADVInterchange.%Save()
    
    //
    // Generate DESADV EDIFACT Interchange UNZ trail segment
    //
    //               UNZ S001  UNZ 0036:1       UNZ 0020 == UNB S004.0020       
    set tSegmentUNZ ="UNZ"_"+"_"1"_"+"_pRequest.DespatchAdvice.EDIHeader.InterchangeCtrlRef
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString(tSegmentUNZ,,":+.?")
    set tSegment.Separators = tDESADVInterchange.Separators
    do tDESADVInterchange.AppendSegment(tSegment)
    // Save DESADV EDIFACT Interchange UNZ trail segment
    do tDESADVInterchange.%Save()
    
    $$$LOGINFO("DESADV Interchange Stream: " _ tDESADVInterchange.OutputToString(tDESADVInterchange.Separators, .tSC))

    //
    // Send to EDIFACT DESADV Interchange writer
    //
    set tSC = ..SendRequestAsync("Write DESADV Interchange to file", tDESADVInterchange) Quit:$$$ISERR(tSC) tSC

    quit tSC
]]></Implementation>
</Method>

<Method name="OnResponse">
<Description>
Handle a 'Response'</Description>
<FormalSpec><![CDATA[request:Ens.Request,&response:Alliance.Ens.Message.DespatchAdviceResponse,callrequest:Ens.Request,callresponse:Ens.Response,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    // Subclass responsibility
    set response.Status = $$$OK
    
    quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ModelDespatchAdvice2DESADVInterchangeDefaultData</DefaultData>
<Data name="ModelDespatchAdvice2DESADVInterchangeDefaultData">
<Structure>listnode</Structure>
<Subscript>"ModelDespatchAdvice2DESADVInterchange"</Subscript>
<Value name="1">
<Value>OutputTestEDIFACTMessage</Value>
</Value>
<Value name="2">
<Value>OutputTestEDIFACTMessageWithTestIndicator</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.ModelInvoice2INVOIC">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62033,32816.91053</TimeChanged>
<TimeCreated>61824,57247.625691</TimeCreated>

<Parameter name="SETTINGS">
<Default>OutputTestEDIFACTMessage</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="OutputTestEDIFACTMessage">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.InvoiceRequest,*pResponse:Alliance.Ens.Message.InvoiceResponse</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim tSC As %Library.Status = $$$OK
    #dim tINVOIC As EnsLib.EDI.EDIFACT.Document
    
    if (..OutputTestEDIFACTMessage = 1) {
 
    $$$LOGINFO("Processing Model Invoice to EDIFACT INVOIC")
    
    // Create Response Object
    set pResponse = ##class(Alliance.Ens.Message.InvoiceResponse).%New()
    if '$IsObject(pResponse) {
        set tSC = $$$ERROR("Response 'Alliance.Ens.Message.InvoiceResponse' konnte nicht alloziert werden!") 
        $$$LOGERROR("Response 'Alliance.Ens.Message.InvoiceResponse' konnte nicht alloziert werden!")
        quit tSC
    }
    
    //
    // Tranform the Invoice to INVOIC
    //
    set tDTL = ##class(Alliance.Ens.DTL.ModelInvoice2EDI).%New()
    if '$IsObject(tDTL) {
        set tSC = $$$ERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht alloziert werden!")
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht alloziert werden!")
        quit tSC 
    }
    // Do the transformation
    set tSC = tDTL.Transform(pRequest, .tINVOIC)
    if ($$$ISERR(tSC)) {
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht durchgeführt werden!")
        quit tSC
    }
    
    $$$LOGINFO("INVOIC Message Stream: " _ tINVOIC.OutputToString(tINVOIC.Separators, .tSC))
    
    //
    // Send to INVOIC EDIFACT writer
    //
    set tSC = ..SendRequestAsync("INVOICMessageWriter", tINVOIC) Quit:$$$ISERR(tSC) tSC

    }

     quit tSC
]]></Implementation>
</Method>

<Method name="OnResponse">
<Description>
Handle a 'Response'</Description>
<FormalSpec><![CDATA[request:Ens.Request,&response:Alliance.Ens.Message.InvoiceResponse,callrequest:Ens.Request,callresponse:Ens.Response,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    // Subclass responsibility
    set response.Status = $$$OK
    
    quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ModelInvoice2INVOICDefaultData</DefaultData>
<Data name="ModelInvoice2INVOICDefaultData">
<Structure>listnode</Structure>
<Subscript>"ModelInvoice2INVOIC"</Subscript>
<Value name="1">
<Value>OutputTestEDIFACTMessage</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Process.ModelInvoice2INVOICInterchange">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>62054,41807.698768</TimeChanged>
<TimeCreated>61824,57247.625691</TimeCreated>

<Parameter name="SETTINGS">
<Default>OutputTestEDIFACTMessage, OutputTestEDIFACTMessageWithTestIndicator</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
// Setting in the EMP: defines the file name for the outbound

]]></Content>
</UDLText>

<Property name="OutputTestEDIFACTMessage">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Property name="OutputTestEDIFACTMessageWithTestIndicator">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Method name="OnRequest">
<FormalSpec>pRequest:Alliance.Ens.Message.InvoiceRequest,*pResponse:Alliance.Ens.Message.InvoiceResponse</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim tSC As %Library.Status = $$$OK
    #dim tINVOICMessage As EnsLib.EDI.EDIFACT.Document
    #dim tINVOICInterchange As EnsLib.EDI.EDIFACT.Document
    #dim tSegment As EnsLib.EDI.EDIFACT.Segment
    
    $$$LOGINFO("Processing Model Invoice to EDIFACT INVOIC Interchange")
    
    // Create Response Object
    set pResponse = ##class(Alliance.Ens.Message.InvoiceResponse).%New()
    if '$IsObject(pResponse) {
        set tSC = $$$ERROR("Response 'Alliance.Ens.Message.InvoiceResponse' konnte nicht alloziert werden!") 
        quit tSC
    }
 
    //
    // Create EDIFACT Interchange for INVOIC
    //
    set tINVOICInterchange = ##class(EnsLib.EDI.EDIFACT.Document).%New()
    set tINVOICInterchange.DocType = "D96A:Interchange"
    set tINVOICInterchange.Separators = ":+? "
 
    //
    // Tranform the Invoice to INVOIC
    //
    // Create the DTL
    set tDTL = ##class(Alliance.Ens.DTL.ModelInvoice2EDI).%New()
    if '$IsObject(tDTL) {
        set tSC = $$$ERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht alloziert werden!")
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht alloziert werden!")
        quit tSC 
    }
    // Do the transformation
    set tSC = tDTL.Transform(pRequest, .tINVOICMessage)
    if ($$$ISERR(tSC)) {
        $$$LOGERROR("Data Transformation 'Alliance.Ens.DTL.ModelInvoice2EDI' kann nicht durchgeführt werden!")
        quit tSC
    }
    if '$IsObject(tINVOICMessage) {
        $$$LOGERROR("Data Transformation hat keine gültige INVOIC EDIFACT Message erzeugt!")
        set tSC = $$$ERROR("Data Transformation hat keine gültige INVOIC EDIFACT Message erzeugt!")
        quit tSC
    }
    // Save INVOIC EDIFACT Message
    do tINVOICMessage.%Save() 
    if (..OutputTestEDIFACTMessage = 1) {
        $$$LOGINFO("INVOIC Message Stream: " _ tINVOICMessage.OutputToString(tINVOICInterchange.Separators, .tSC))
    }
    
    //
    // Generate INVOIC EDIFACT Interchange UNA segment
    //                                                                              
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString("UNA:+.? ", .tSC, tINVOICInterchange.Separators)
    set tSegment.Separators = tINVOICInterchange.Separators
    do tINVOICInterchange.AppendSegment(tSegment)  
    // Save INVOIC EDIFACT Interchange UNA segment
    do tINVOICInterchange.%Save()

    //
    // Generate INVOIC EDIFACT Interchange UNB header segment
    //
    //               UNB S001       
    set tSegmentUNB ="UNB"_
    //               UNB 0001:UNOC                                  UNB 0002:3
                     "+"_pRequest.Invoice.EDIHeader.SyntaxId_":"_pRequest.Invoice.EDIHeader.SyntaxVer_
    //               UNB S002.0004                                  UNB S002.0007
                     "+"_pRequest.Invoice.EDIHeader.SenderId_":"_pRequest.Invoice.EDIHeader.SenderIdCodeQual_
    //               UNB S003.0010                                     UNB S003.0007                                             UNB S003.0014 
                     "+"_pRequest.Invoice.EDIHeader.RecipientId_":"_pRequest.Invoice.EDIHeader.RecipientIdCodeQual_":"_pRequest.Invoice.EDIHeader.RoutingAdr_
    //               UNB S004.0017 : (Format YYYYMMDD)                       UNB S004.0019 : (Format HHMM)                         UNB S004.0020
                     "+"_pRequest.Invoice.EDIHeader.InterchangeDate_":"_pRequest.Invoice.EDIHeader.InterchangeTime_"+"_pRequest.Invoice.EDIHeader.InterchangeCtrlRef_
    //               UNB S005.0026                                        UNB S005.0032                                     
                     "++"_pRequest.Invoice.EDIHeader.ApplicationRef_"+++"_pRequest.Invoice.EDIHeader.CommunicationAgrmt
                     
    //               UNB S005.0035 This has to set only for test purposes!!!                                   
    if (..OutputTestEDIFACTMessageWithTestIndicator = 1) {
                     set tSegmentUNB = tSegmentUNB_"+"_pRequest.Invoice.EDIHeader.TestIndicator
    }
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString(tSegmentUNB,,":+.?")
    set tSegment.Separators = tINVOICInterchange.Separators
    do tINVOICInterchange.AppendSegment(tSegment)
    // Save INVOIC EDIFACT Interchange UNB header segment
    do tINVOICInterchange.%Save()

    //
    // Generate INVOIC EDIFACT Interchange UNHDocsRef segment
    //
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).%New()
    set tSegment.Separators = tINVOICInterchange.Separators
    do tSegment.SetValueAt("UNHDocsRef"_tSegment.ES_3)
    do tINVOICInterchange.AppendSegment(tSegment)
    // Save INVOIC EDIFACT Interchange
    do tINVOICInterchange.%Save()
    
    // 
    // Generate Interchange UNHDocsRef child references
    //
    // At the moment we just have one message per EDIFACT interchange, 
    // do not forget to change the count in the UNZ trail segment if there are more messages!!!
    //
    do tINVOICInterchange.AddChild(3, tINVOICMessage)
    // Save INVOIC EDIFACT Interchange UNHDocsRef child reference
    do tINVOICInterchange.%Save()
    
    //
    // Generate INVOIC EDIFACT Interchange UNZ trail segment
    //
    //               UNZ S001       
    set tSegmentUNZ ="UNZ"_
    //               UNZ 0036:1  UNZ 0020 == UNB S004.0020
                     "+"_"1"_"+"_pRequest.Invoice.EDIHeader.InterchangeCtrlRef
    // UNZ+1+1234567'
    set tSegment = ##class(EnsLib.EDI.EDIFACT.Segment).ImportFromString(tSegmentUNZ,,":+.?")
    set tSegment.Separators = tINVOICInterchange.Separators
    do tINVOICInterchange.AppendSegment(tSegment)
    // Save INVOIC EDIFACT Interchange UNZ trail segment
    do tINVOICInterchange.%Save()
    
    $$$LOGINFO("INVOIC Interchange Stream: " _ tINVOICInterchange.OutputToString(tINVOICInterchange.Separators, .tSC))

    //
    // Send to EDIFACT INVOIC Interchange writer
    //
    set tSC = ..SendRequestAsync("Write INVOIC Interchange to file", tINVOICInterchange) Quit:$$$ISERR(tSC) tSC

    quit tSC
]]></Implementation>
</Method>

<Method name="OnResponse">
<Description>
Handle a 'Response'</Description>
<FormalSpec><![CDATA[request:Ens.Request,&response:Alliance.Ens.Message.DespatchAdviceResponse,callrequest:Ens.Request,callresponse:Ens.Response,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    // Subclass responsibility
    set response.Status = $$$OK
    
    quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ModelInvoice2INVOICInterchangeDefaultData</DefaultData>
<Data name="ModelInvoice2INVOICInterchangeDefaultData">
<Structure>listnode</Structure>
<Subscript>"ModelInvoice2INVOICInterchange"</Subscript>
<Value name="1">
<Value>OutputTestEDIFACTMessage</Value>
</Value>
<Value name="2">
<Value>OutputTestEDIFACTMessageWithTestIndicator</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Production.Alliance">
<ProcedureBlock>1</ProcedureBlock>
<Super>Ens.Production</Super>
<TimeChanged>62263,28504.144646</TimeChanged>
<TimeCreated>61748,56002.465142</TimeCreated>

<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Alliance.Ens.Production.Alliance" TestingEnabled="true" LogGeneralTraceEvents="false">
  <Description>NewProduction</Description>
  <ActorPoolSize>2</ActorPoolSize>
  <Item Name="DebugMessageWriter" Category="" ClassName="Alliance.Ens.Operation.DebugOutputOperation" PoolSize="1" Enabled="false" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="true" Schedule="">
    <Setting Target="Host" Name="FileName">debug.txt</Setting>
    <Setting Target="Host" Name="ColumnSeparator">;</Setting>
    <Setting Target="Adapter" Name="FilePath">D:\EnsembleTest\EDI\debug</Setting>
  </Item>
  <Item Name="Ens.Alert" Category="" ClassName="Alliance.Ens.Operation.DebugOutputOperation" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Adapter" Name="FilePath">D:\EnsembleTest\EDI\alert</Setting>
  </Item>
  <Item Name="KAL Message Process" Category="KAL" ClassName="Alliance.Ens.Process.KALMessageProcess" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="MessagePickupOperation"></Setting>
    <Setting Target="Host" Name="OrderDeliveryOperation"></Setting>
  </Item>
  <Item Name="Create KAL Message" Category="KAL" ClassName="Alliance.Ens.Process.CreateKALMessage" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="KAL Pickup Service" Category="KAL" ClassName="Alliance.Ens.Service.KALPickupService" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="DebugFlag">0</Setting>
    <Setting Target="Host" Name="AlertOnError">1</Setting>
    <Setting Target="Host" Name="ArchiveIO">0</Setting>
    <Setting Target="Adapter" Name="Port">1980</Setting>
    <Setting Target="Adapter" Name="StayConnected">0</Setting>
  </Item>
  <Item Name="ORDERs In Service" Category="" ClassName="EnsLib.EDI.EDIFACT.Service.FileService" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="TargetConfigNames">Alliance.Ens.Rules.OrderInRouting</Setting>
    <Setting Target="Host" Name="DocSchemaCategory">D96A</Setting>
    <Setting Target="Host" Name="Validation">dm</Setting>
    <Setting Target="Adapter" Name="FilePath">D:\EnsembleTest\EDI\inAllianceOst</Setting>
    <Setting Target="Adapter" Name="FileSpec">*.*</Setting>
    <Setting Target="Adapter" Name="ArchivePath">D:\EnsembleTest\EDI\archive</Setting>
    <Setting Target="Adapter" Name="WorkPath">D:\EnsembleTest\EDI\work</Setting>
    <Setting Target="Adapter" Name="AppendTimestamp">1</Setting>
  </Item>
  <Item Name="Alliance.Ens.Rules.OrderInRouting" Category="" ClassName="EnsLib.MsgRouter.VDocRoutingEngine" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="Validation">dm</Setting>
  </Item>
  <Item Name="Get Final Order from AgrisM" Category="Order" ClassName="Alliance.Ens.Operation.GetFinalOrderFromAgrisM" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Get DespatchAdvice from AgrisM" Category="Order" ClassName="Alliance.Ens.Operation.GetDespatchAdviceFromAgrisM" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Get Invoice from AgrisM" Category="Order" ClassName="Alliance.Ens.Operation.GetInvoiceFromAgrisM" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Send New Order to AgrisM" Category="Order" ClassName="Alliance.Ens.Operation.SendNewOrderToAgrisM" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="FailureTimeout">30</Setting>
  </Item>
  <Item Name="Process new DespatchAdvice" Category="DespatchAdvice" ClassName="Alliance.Ens.Process.DespatchAdviceProcessor" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Convert DespatchAdvice to EDIFACT format" Category="DESADV" ClassName="Alliance.Ens.Process.ModelDespatchAdvice2DESADVInterchange" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="OutputTestEDIFACTMessageWithTestIndicator">0</Setting>
  </Item>
  <Item Name="Write DESADV Interchange to file" Category="DESADV" ClassName="Alliance.Ens.Operation.DESADVInterchangeMessageWriter" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="SeparatorsBackup">:+? '\r\n</Setting>
    <Setting Target="Host" Name="Filename">ALLIANCE_AS2_DESADV_%Q_$INC(20)</Setting>
    <Setting Target="Host" Name="Separators">:+? '\r\n</Setting>
    <Setting Target="Host" Name="Validation">dm</Setting>
    <Setting Target="Adapter" Name="FilePath">D:\EnsembleTest\EDI\desadvout</Setting>
  </Item>
  <Item Name="Process new Invoice" Category="Invoice" ClassName="Alliance.Ens.Process.InvoiceProcessor" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="Write INVOIC Interchange to file" Category="" ClassName="Alliance.Ens.Operation.INVOICInterchangeMessageWriter" PoolSize="1" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
    <Setting Target="Host" Name="Filename">ALLIANCE_AS2_INVOIC_%Q_$INC(20)</Setting>
    <Setting Target="Adapter" Name="FilePath">D:\EnsembleTest\EDI\invoiceout</Setting>
  </Item>
  <Item Name="Convert Invoice to EDIFACT format" Category="" ClassName="Alliance.Ens.Process.ModelInvoice2INVOICInterchange" PoolSize="0" Enabled="true" Foreground="false" InactivityTimeout="0" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
</Production>
]]></Data>
</XData>
</Class>


<Document name="Alliance.Ens.Rules.OrderInRouting.RUL"><routingRule host="Alliance.Ens.Rules" name="OrderInRouting" effectiveBeginDateTime="" effectiveEndDateTime="" context="Alliance.Ens.Rules.Context" doAll="false" source="" msgClass="" docName="" docCategory="" docType="">
  <description></description>
  <reportGroup></reportGroup>
  <reportName></reportName>
  <shortDescription></shortDescription>
  <rule source="ORDERs In Service" msgClass="EnsLib.EDI.EDIFACT.Document" docName="" docCategory="D96A" docType="ORDERS">
    <action type="send" target="Create KAL Message,Send New Order to AgrisM" transform="Alliance.Ens.DTL.EDI2ModelOrder"></action>
  </rule>
  <rule source="ORDERs In Service" msgClass="EnsLib.EDI.EDIFACT.Document" docName="" docCategory="D96A" docType="">
  </rule>
</routingRule>
</Document>

<Class name="Alliance.Ens.Service.AS2NotifierService">
<Description>
Alliance.Ens.Service.AS2NotifierService</Description>
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebService</Super>
<TimeChanged>61832,65603.137365</TimeChanged>
<TimeCreated>61759,37639.083303</TimeCreated>

<Parameter name="SERVICENAME">
<Description>
Name des WebService.</Description>
<Default>AS2NotifierService</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
TODO: change this to actual SOAP namespace.
SOAP Namespace für den WebService</Description>
<Default>http://www.alliance.ch/as2</Default>
</Parameter>

<Parameter name="USECLASSNAMESPACES">
<Description>
Namespaces von referenzierten Klassen werden in der WSDL verwendet.</Description>
<Default>1</Default>
</Parameter>

<Method name="MessageArrived">
<Description>
TODO: add arguments and implementation.
MessageArrived</Description>
<FormalSpec>MessageId:%String,Sender:%String,Receiver:%String,Filename:%String,Log:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<WebMethod>1</WebMethod>
<Implementation><![CDATA[
	//set ^mku($I(^mku))=$LB("ARRIVED",MessageId, Sender, Receiver, Filename, Log, $h)

	set status = $$$OK
	set as2Type = ##class(Alliance.Ens.AS2.NotificationType).Arrived()
	set as2Notification = ##class(Alliance.Ens.AS2.Notification).new(.status, as2Type, MessageId, Sender, Receiver, Filename, Log)
	quit:($$$ISERR(status)) status

	Quit "Message received in Alliance"
]]></Implementation>
</Method>

<Method name="MessageSent">
<Description>
TODO: add arguments and implementation.
MessageSent</Description>
<FormalSpec>MessageId:%String,Sender:%String,Receiver:%String,Filename:%String,Log:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<WebMethod>1</WebMethod>
<Implementation><![CDATA[
	//set ^mku($I(^mku))=$LB("SENT",MessageId, Sender, Receiver, Filename, Log, $h)

	set status = $$$OK
	set as2Type = ##class(Alliance.Ens.AS2.NotificationType).Sent()
	set as2Notification = ##class(Alliance.Ens.AS2.Notification).new(.status, as2Type, MessageId, Sender, Receiver, Filename, Log)
	quit:($$$ISERR(status)) status

	Quit "Message sent to AS2"
]]></Implementation>
</Method>

<Method name="ErrorOccurred">
<Description>
TODO: add arguments and implementation.
ErrorOccurred</Description>
<FormalSpec>MessageId:%String,Sender:%String,Receiver:%String,Filename:%String,Log:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<WebMethod>1</WebMethod>
<Implementation><![CDATA[
	//set ^mku($I(^mku))=$LB("ERROR",MessageId, Sender, Receiver, Filename, Log, $h)

	set status = $$$OK
	set as2Type = ##class(Alliance.Ens.AS2.NotificationType).Error()
	set as2Notification = ##class(Alliance.Ens.AS2.Notification).new(.status, as2Type, MessageId, Sender, Receiver, Filename, Log)
	quit:($$$ISERR(status)) status

	Quit "Error occurred in AS2"
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.Service.KALPickupService">
<Description>
Alliance.Common.KAL.Server</Description>
<IncludeCode>Alliance</IncludeCode>
<ProcedureBlock>1</ProcedureBlock>
<Super>EnsLib.SOAP.Service</Super>
<TimeChanged>61836,41569.319141</TimeChanged>
<TimeCreated>61748,59654.437638</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//Parameter ADAPTER = "EnsLib.SOAP.InboundAdapter";

]]></Content>
</UDLText>

<Parameter name="ADAPTER">
<Description>
Name of the adapter class - override this to "" if you want to use only the regular SOAP mechanism and not the custom-port InboundAdapter.</Description>
<Default>Alliance.Ens.Adapter.SOAPInboundAdapterNoLog</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
Name des WebService.</Description>
<Default>KALPickupService</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
TODO: change this to actual SOAP namespace.
SOAP Namespace für den WebService</Description>
<Default>http://www.alliance.ch/kal/1.0</Default>
</Parameter>

<Parameter name="USECLASSNAMESPACES">
<Description>
Namespaces von referenzierten Klassen werden in der WSDL verwendet.</Description>
<Default>1</Default>
</Parameter>

<Property name="DebugFlag">
<Type>%Boolean</Type>
</Property>

<Parameter name="SETTINGS">
<Default>DebugFlag</Default>
</Parameter>

<Method name="receiveMessages">
<FormalSpec>messages:Alliance.Common.KAL.MessagesUnprocessed</FormalSpec>
<ReturnType>%Status</ReturnType>
<WebMethod>1</WebMethod>
<Implementation><![CDATA[
	set status = $$$OK
	set now = $zdatetime($zutil(188),3, 1, 6)

	set messagesReceived = ##class(Alliance.Ens.KAL.MessagesReceived).%New()
	set messagesReceived.timeStampReceived = now
	set messagesReceived.senderId = messages.senderId

	for i=1:1:messages.messages.Count()
	{
		set message = messages.messages.GetAt(i)
		set message.timeStampTransmitted = now
		set message.isProcessed = $$$NO
		set status = message.%Save()
		quit:($$$ISERR(status))

		set messagesReceived.messageCount = messagesReceived.messageCount + 1
	}

	set status = messagesReceived.%Save()

	//	Update timestamp:
	do ##class(Alliance.Ens.Setup.AttachedSystems).Touch(messages.senderId)

	//	Update last message received (if any):
	if (messages.messages.Count() '= 0)
	{
		do ##class(Alliance.Ens.Setup.AttachedSystems).setLastKALMessageReceived(messages.messages.GetAt(messages.messages.Count()))
	}

	set messagesRequest = ##class(Alliance.Ens.Message.KALMessagesRequest).%New()
	set messagesRequest.messages = messagesReceived

	do ..SendRequestAsync("KAL Message Process", messagesRequest)
	if (..DebugFlag)		do ..SendRequestAsync("DebugMessageWriter", messagesRequest)

	quit $$$OK
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.Setup.AttachedSystems">
<IncludeCode>Alliance</IncludeCode>
<Super>%Persistent</Super>
<TimeChanged>61935,61699.218028</TimeChanged>
<TimeCreated>61752,60202.291496</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<Parameter name="AllianceId">
<Type>%String</Type>
<Default>Alliance</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//	=====	Properties			===============================================

]]></Content>
</UDLText>

<Property name="SystemID">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="SystemName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
</Property>

<Property name="SystemTypeCode">
<Type>Alliance.Common.KAL.Code.SystemType</Type>
</Property>

<Property name="SystemIP">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
</Property>

<Property name="WebServiceURL">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Property name="SecurityToken">
<Type>%String</Type>
</Property>

<Property name="LastKALMessage">
<Type>%TimeStamp</Type>
</Property>

<Property name="lastKALMessageReceived">
<Type>Alliance.Common.KAL.Message</Type>
</Property>

<Property name="Status">
<Type>%Boolean</Type>
</Property>

<Property name="OnlineStatus">
<Description>
THGREEN		0
THYELLOW	10
THRED		30
THGREY		100</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
</Property>

<UDLText name="T">
<Content><![CDATA[
//	=====	Queries				===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	=====	Class Methods		===============================================

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----			Instance Creation	---------------------------------------

]]></Content>
</UDLText>

<Method name="%OnNew">
<FormalSpec>id:%String,type:%Integer,name:%String,url:%String,status:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set ..SystemID = id
	set ..SystemTypeCode = ##class(Alliance.Common.KAL.Code.SystemType).get(type)
	set ..SystemName = name
	set ..WebServiceURL = url
	set ..Status = status

	quit $$$OK
]]></Implementation>
</Method>

<Method name="new">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&status:%Status,id:%String,type:%Integer,name:%String,url:%String,onOff:%Boolean]]></FormalSpec>
<ReturnType>Alliance.Ens.Setup.AttachedSystems</ReturnType>
<Implementation><![CDATA[
	set sys = ..%New(id, type, name, url, onOff)
	set status = sys.%Save()
	quit sys
]]></Implementation>
</Method>

<Method name="initialize">
<Description>
	write ##class(Alliance.Ens.Setup.AttachedSystems).initialize()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = ..%DeleteExtent()
	quit:($$$ISERR(status)) status

	set allianceTypeId = ##class(Alliance.Common.KAL.Code.SystemType).Alliance().key
	set agrisMTypeId = ##class(Alliance.Common.KAL.Code.SystemType).AgrisM().key
	set agrisLTypeId = ##class(Alliance.Common.KAL.Code.SystemType).AgrisL().key

	set sys = ..new(.status, ..#AllianceId, allianceTypeId, "Alliance", "http://localhost:1980/Alliance.Ens.Service.KALPickupService.cls", 1)
	quit:($$$ISERR(status)) status

	set sys = ..new(.status, "AgrisM", agrisMTypeId, "Agris/M", "http://localhost:57772/csp/cbt/", 1)
	quit:($$$ISERR(status)) status

	set sys = ..new(.status, "AgrisL001", agrisLTypeId, "Agris/L Beerstecher", "http://...", 0)
	quit:($$$ISERR(status)) status

	set sys = ..new(.status, "AgrisL002", agrisLTypeId, "Agris/L Meier", "http://...", 0)
	quit:($$$ISERR(status)) status

	set sys = ..new(.status, "AgrisL003", agrisLTypeId, "Agris/L Gerber", "http://...", 0)
	quit:($$$ISERR(status)) status

	set sys = ..new(.status, "AgrisL004", agrisLTypeId, "Agris/L FOFT", "http://...", 0)
	quit:($$$ISERR(status)) status

	//	These are the same values as in system 1 (Alliance):
	set status = ##class(Alliance.Common.KAL.CommunicationParams).setAllParameters(..#AllianceId, allianceTypeId, "Alliance", "http://localhost:1980/Alliance.Ens.Service.KALPickupService.cls")
	quit:($$$ISERR(status)) status

	quit status
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----			Accessing		-------------------------------------------

]]></Content>
</UDLText>

<Method name="OnlineStatusGet">
<ReturnType>%Integer</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
  
	if (..LastKALMessage = "") {
  		quit 100
 	}
 	
 	set mins = ""
 	set timestamp = ..LastKALMessage
 	set currentTime = $ZDATETIME($ZTIMESTAMP,3)
 	&sql(SELECT {fn TIMESTAMPDIFF(SQL_TSI_MINUTE,:timestamp,:currentTime)} into :mins)  
 	set mins = 60+mins
 	if (mins >= $$$THRED) {
  		quit 30
 	}
 	if (mins >= $$$THYELLOW) {
  		quit 20
 	}
 	quit 10
]]></Implementation>
</Method>

<Method name="GetWebServiceURL">
<ClassMethod>1</ClassMethod>
<FormalSpec>sysID:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set url = ""
	&sql(SELECT WebServiceURL into :url FROM Alliance_Ens_Setup.AttachedSystems WHERE SystemID = :sysID)
	if (SQLCODE = 0) {
		quit url
	} else {
		quit ""
	}
]]></Implementation>
</Method>

<Method name="GetSystem">
<ClassMethod>1</ClassMethod>
<FormalSpec>sysID:%String</FormalSpec>
<ReturnType>Alliance.Ens.Setup.AttachedSystems</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID into :id FROM Alliance_Ens_Setup.AttachedSystems WHERE SystemID = :sysID)
	if (SQLCODE = 0) {
		quit ..%OpenId(id)
	} else {
		quit ""
	}
]]></Implementation>
</Method>

<Method name="GetAllianceSystem">
<ClassMethod>1</ClassMethod>
<ReturnType>Alliance.Ens.Setup.AttachedSystems</ReturnType>
<Implementation><![CDATA[	quit ..GetSystem(..#AllianceId)
]]></Implementation>
</Method>

<Method name="Touch">
<ClassMethod>1</ClassMethod>
<FormalSpec>sysID:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set sys = ..GetSystem(sysID)
	if (sys = $$$NULLOREF)		quit $$$ERRORSTATUS("Invalid SystemID"_sysID)

	//	Don't touch if system is Alliance:
	if (sysID = ..#AllianceId)		quit $$$OK

	set sys.LastKALMessage = $ZDT($ZUTIL(188),3)
	quit sys.%Save()
]]></Implementation>
</Method>

<Method name="setLastKALMessageReceived">
<ClassMethod>1</ClassMethod>
<FormalSpec>lastMessage:Alliance.Common.KAL.Message</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set sys = ..GetSystem(lastMessage.clientId)
	if (sys = $$$NULLOREF)		quit $$$ERRORSTATUS("Invalid SystemID"_lastMessage.clientId)

	set sys.lastKALMessageReceived = lastMessage
	quit sys.%Save()
]]></Implementation>
</Method>

<Method name="getLieferantenSysteme">
<ClassMethod>1</ClassMethod>
<ReturnType>%ResultSet</ReturnType>
<Implementation><![CDATA[
	set currentTime = $ZDATETIME($ZTIMESTAMP,3)
	set rs = ##class(%ResultSet).%New()
	do rs.Prepare("SELECT *, {fn TIMESTAMPDIFF(SQL_TSI_MINUTE,LastKALMessage,?)} As Diff FROM Alliance_Ens_Setup.AttachedSystems")
	do rs.Execute(currentTime)
	quit rs
]]></Implementation>
</Method>

<Method name="AllianceId">
<Description>
	##class(Alliance.Ens.Setup.AttachedSystems).AllianceId()</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit ..#AllianceId
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Alliance.E7FE1.AttachedSysD6D1D</DataLocation>
<DefaultData>AttachedSystemsDefaultData</DefaultData>
<IdLocation>^Alliance.E7FE1.AttachedSysD6D1D</IdLocation>
<IndexLocation>^Alliance.E7FE1.AttachedSysD6D1I</IndexLocation>
<StreamLocation>^Alliance.E7FE1.AttachedSysD6D1S</StreamLocation>
<Data name="AttachedSystemsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>SystemID</Value>
</Value>
<Value name="3">
<Value>SystemName</Value>
</Value>
<Value name="4">
<Value>SystemTypeCode</Value>
</Value>
<Value name="5">
<Value>SystemIP</Value>
</Value>
<Value name="6">
<Value>WebServiceURL</Value>
</Value>
<Value name="7">
<Value>SecurityToken</Value>
</Value>
<Value name="8">
<Value>LastKALMessage</Value>
</Value>
<Value name="9">
<Value>lastKALMessageReceived</Value>
</Value>
<Value name="10">
<Value>Status</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="Alliance.Ens.Setup.AttachedSystemsSetupPage">
<Super>%CSP.Page</Super>
<TimeChanged>61842,59461.752443</TimeChanged>
<TimeCreated>61754,54837.993218</TimeCreated>

<Method name="OnPreHTTP">
<ClassMethod>1</ClassMethod>
<ReturnType>%Boolean</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set action = %request.Get("ACTION")
	
	if ##class(%Dictionary.MethodDefinition).%ExistsId(..%ClassName(1)_"||OnAction"_action) {
		quit $ZObjClassMethod(..%ClassName(1),"OnAction"_action)
	}
	
	quit $$$YES
]]></Implementation>
</Method>

<Method name="OnPage">
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set action = %request.Get("ACTION")
	
	if ##class(%Dictionary.MethodDefinition).%ExistsId(..%ClassName(1)_"||OnAction"_action) {
		quit $ZObjClassMethod(..%ClassName(1),"OnPage"_action)
	}
	
	quit ..OnPageDefault()
]]></Implementation>
</Method>

<Method name="OnPageDefault">
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set SystemCount = 0
 	&sql(SELECT Count(*) INTO :SystemCount FROM Alliance_Ens_Setup.AttachedSystems)
 	
 &html<
 <html>
	<head>
		<title>Alliance Setup (#(SystemCount)# Systeme verfügbar)</title>
	</head>
	<body>
		<h1>Setup Toolkit für die Alliance Anwendungen</h1>
		
		<table border="1">
	>

	if (SystemCount = 0)
	{
 &html<
 			<tr>
				<td><a href="?ACTION=InstallData">Installiere Basisdaten</a></td>
			</tr>
	>
	}
	else
	{
		set rs = ##class(%ResultSet).%New()
		do rs.Prepare("select %ID, SystemID, SystemName, SystemTypeCode->""key"" as SystemType, WebServiceURL, Status from Alliance_Ens_Setup.AttachedSystems order by SystemType asc, SystemID asc")
		do rs.Execute()

		set allianceSystem = ##class(Alliance.Ens.Setup.AttachedSystems).GetAllianceSystem()
		set portalSetup = (allianceSystem.WebServiceURL '= "")

 &html<
 			<tr>
 				<td>Aktiv</td>
				<td>SystemID</td>
				<td>Typ</td>
				<td>Name</td>
				<td>WebService-URL</td>
				<td>Edit</td>
			</tr>
	>

		while (rs.Next())
		{
 &html<
 			<tr>
 				<td>#(rs.Get("Status"))#</td>
				<td>#(rs.Get("SystemID"))#</td>
				<td>#(rs.Get("SystemType"))#</td>
				<td>#(rs.Get("SystemName"))#</td>
				<td>#(rs.Get("WebServiceURL"))#&nbsp;</td>
				<td>
	>
			set systemType = (##class(Alliance.Common.KAL.Code.SystemType).get(rs.Get("SystemType")))
			if (((systemType '= $$$NULLOREF) && systemType.isAlliance())
			|| portalSetup)
			{
 &html<			<button type="button" onclick="document.location.href='?ACTION=Edit&SystemID=#(rs.Get("SystemID"))#';">Setup</button>
 	>
 			}
 &html<
 				&nbsp;
 				</td>
			</tr>
	>
		}
	}
 &html<
		</table>
	</body>
 </html>
>

	Quit $$$OK
]]></Implementation>
</Method>

<Method name="OnPageEdit">
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
 set system = ##class(Alliance.Ens.Setup.AttachedSystems).GetSystem(%request.Get("SystemID"))
 set systemName = "localhost"

 if (($case(system.SystemTypeCode,"":0,:system.SystemTypeCode.isAlliance()))
 && (system.WebServiceURL = ""))
 {
	 set system.WebServiceURL = "http://"_systemName_":1980/Alliance.Ens.Service.KALPickupService.cls" 
 }
 
 &html<
 <html>
	<head>
		<title>Alliance Setup for System #(system.SystemID)#</title>
	</head>
	<body>
		<h1>Setup Toolkit für die Alliance Anwendungen</h1>
		
		<form action="?ACTION=SaveEdit" method="POST">
			<input type="hidden" name="SystemID" value="#(system.SystemID)#" />
			
		<table border="1">
			<tr>
				<td><b>Aktiv</b></td>
				<td><input type="text" name="status" size="1" maxlength="1" value="#(..EscapeHTML(system.Status))#" /></td>
			</tr>
			<tr>
			<tr>
				<td><b>SystemID</b></td>
				<td><input type="text" name="id" size="20" maxlength="20" value="#(..EscapeHTML(system.SystemID))#" /></td>
			</tr>
			<tr>
				<td><b>Typ</b></td>
				<td><input type="text" name="type" size="3" maxlength="3" value="#(..EscapeHTML($case(system.SystemTypeCode,"":"",:system.SystemTypeCode.key)))#" /></td>
			</tr>
			<tr>
				<td><b>Name</b></td>
				<td><input type="text" name="name" size="50" maxlength="50" value="#(..EscapeHTML(system.SystemName))#" /></td>
			</tr>
			<tr>
				<td><b>WebService-URL</b></td>
				<td><input type="text" name="url" size="100" maxlength="100" value="#(..EscapeHTML(system.WebServiceURL))#" /></td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" value="Save" />
				</td>
			</tr>
		</table>
		</form>
	</body>
 </html>
	>	
	quit $$$OK
]]></Implementation>
</Method>

<Method name="OnActionEdit">
<ClassMethod>1</ClassMethod>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[	quit $$$YES
]]></Implementation>
</Method>

<Method name="OnActionSaveEdit">
<ClassMethod>1</ClassMethod>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set system = ##class(Alliance.Ens.Setup.AttachedSystems).GetSystem(%request.Get("SystemID"))
	set system.Status = %request.Get("status")
	set system.SystemID = %request.Get("id")
	set system.SystemTypeCode = ##class(Alliance.Common.KAL.Code.SystemType).get(%request.Get("type"))
	set system.SystemName = %request.Get("name")
	set system.WebServiceURL = %request.Get("url")
	do system.%Save()

	if ('((system.SystemTypeCode '= $$$NULLOREF) && (system.SystemTypeCode.isAlliance())))
	{
		set allianceSystem = ##class(Alliance.Ens.Setup.AttachedSystems).GetAllianceSystem()

		set wsc = ##class(Alliance.Ens.Setup.WSClientAttachedSystemSetup).%New()
		set wsc.Location = system.WebServiceURL_"/Alliance.Agris.Setup.SetupService.cls"
		do wsc.SetupClient(system.SystemID, system.SystemTypeCode.key, system.SystemName, allianceSystem.WebServiceURL)
	}

	set %response.Redirect = ..%ClassName(1)_".cls"

	quit $$$OK
]]></Implementation>
</Method>

<Method name="OnActionInstallData">
<ClassMethod>1</ClassMethod>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	do ##class(Alliance.Ens.Setup.AttachedSystems).initialize()

	set %response.Redirect = ..%ClassName(1)_".cls"
	
	quit $$$OK
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.Setup.Initializer">
<Description>

	Project Change History:

---	Date	---	By	---	What	-------------------------------------------
</Description>
<Super>Base.Initializer</Super>
<TimeChanged>61828,37164.337533</TimeChanged>
<TimeCreated>61815,66784.219049</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
// 	write ##class(Alliance.Ens.Setup.Initializer).initialize()

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// 	write ##class(Alliance.Ens.Setup.Initializer).initialize(1)		//	initialize forced

]]></Content>
</UDLText>

<Method name="runInitialization">
<Description>
	Actually do the initialization.</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set status = $$$OK

	set status = ##class(Alliance.Common.KAL.Code.SystemType).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Common.KAL.Code.MessageSenderType).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Common.KAL.Code.MessageType).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Common.KAL.Code.MessageSubType).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Common.KAL.Code.MessageSeverity).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Ens.DispCons.CodeStatusTimeThreshold).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Ens.AS2.NotificationType).initialize()
	quit:($$$ISERR(status)) status

	set status = ##class(Alliance.Ens.Setup.AttachedSystems).initialize()
	quit:($$$ISERR(status)) status

	quit $$$OK
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//	-----	Accessing			-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Support				-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Test				-----------------------------------------------

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//	-----	Private				-----------------------------------------------

]]></Content>
</UDLText>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="Alliance.Ens.Setup.Version">
<Description>
	
	Project Change History:

---	Date	---	By	---	What	-------------------------------------------

12.04.2010	Lem		Class AttachedSystems moved from package Common to Setup

12.04.2010	Lem		Package Setup moved from package Alliance to Alliance.Ens

15.04.2010	Lem		Despatch Advice processing implemented

16.04.2010	Lem		KAL-Messages from Alliance to Alliance implemented
					Calling get*- via WS is now done synchronously
</Description>
<Super>Base.VersionAbstract</Super>
<TimeChanged>61832,51861.701821</TimeChanged>
<TimeCreated>61828,36505.271796</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
//	=====	Parameters			===============================================

]]></Content>
</UDLText>

<Parameter name="Project">
<Default>Alliance</Default>
</Parameter>

<Parameter name="SubProject">
<Default>Ensemble</Default>
</Parameter>

<Parameter name="Version">
<Default>1.2.4</Default>
</Parameter>

<Parameter name="LastProjectChange">
<Default>16.04.2010</Default>
</Parameter>
</Class>


<Class name="Alliance.Ens.Setup.WSClientAttachedSystemSetup">
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61828,36591.661501</TimeChanged>
<TimeCreated>61754,55878.117546</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://alliance:57772/csp/alliance/Alliance.Agris.Setup.SetupService.cls</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/setup/1.0</Default>
</Parameter>

<Parameter name="OUTPUTTYPEATTRIBUTE">
<Description>
Use xsi:type attribute for literal types.</Description>
<Default>1</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>SetupService</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<Method name="SetupClient">
<Final>1</Final>
<FormalSpec>id:%String,type:%Integer,name:%String,allianceURL:%String</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%String</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[ Quit ..WebMethod("SetupClient").Invoke($this,"http://www.alliance.ch/setup/1.0/Alliance.Agris.Setup.SetupService.SetupClient",.id,.type,.name,.allianceURL)
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.WS.WSClientGetDespatchAdvice">
<IncludeCode>Ensemble</IncludeCode>
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61830,80420.728284</TimeChanged>
<TimeCreated>61824,58486.625995</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://will_be_specified_at_runtime</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/agris/1.0</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>ReturnDespatchAdvice</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<Method name="id">
<Final>1</Final>
<FormalSpec>id:%String</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>Alliance.Common.Model.DespatchAdvice.DespatchAdvice</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[
	$$$LOGINFO("Alliance.Ens.WS.WSClientGetDespatchAdvice")
	Quit ..WebMethod("id").Invoke($this, ..#NAMESPACE _ "/Alliance.Agris.WS.WSServiceReturnDespatchAdvice.id",id)
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.WS.WSClientGetFinalOrder">
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61825,38609.345944</TimeChanged>
<TimeCreated>61824,59137.319084</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://will_be_specified_at_runtime</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/agris/1.0</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>ReturnFinalOrder</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<Method name="id">
<Final>1</Final>
<FormalSpec>id:%String</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>Alliance.Common.Model.Order.Order</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[	Quit ..WebMethod("id").Invoke($this, ..#NAMESPACE _ "/Alliance.Agris.WS.WSServiceReturnFinalOrder.id",id)
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.WS.WSClientGetInvoice">
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61824,65773.906541</TimeChanged>
<TimeCreated>61824,58980.601573</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://will_be_specified_at_runtime</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/agris/1.0</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>ReturnInvoice</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<Method name="id">
<Final>1</Final>
<FormalSpec>id:%String</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>Alliance.Common.Model.Invoice.Invoice</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[ Quit ..WebMethod("id").Invoke($this, ..#NAMESPACE _ "/Alliance.Agris.WS.WSServiceReturnInvoice.id",id)
]]></Implementation>
</Method>
</Class>


<Class name="Alliance.Ens.WS.WSClientSendNewOrder">
<ProcedureBlock>1</ProcedureBlock>
<Super>%SOAP.WebClient</Super>
<TimeChanged>61825,37133.328865</TimeChanged>
<TimeCreated>61824,58102.553534</TimeCreated>

<Parameter name="LOCATION">
<Description>
This is the URL used to access the web service.</Description>
<Default>http://will_be_specified_at_runtime</Default>
</Parameter>

<Parameter name="NAMESPACE">
<Description>
This is the namespace used by the Service</Description>
<Default>http://www.alliance.ch/agris/1.0</Default>
</Parameter>

<Parameter name="SERVICENAME">
<Description>
This is the name of the Service</Description>
<Default>ReceiveNewOrder</Default>
</Parameter>

<Parameter name="SOAPVERSION">
<Description>
This is the SOAP version supported by the service.</Description>
<Default>1.1</Default>
</Parameter>

<Method name="newOrder">
<Final>1</Final>
<FormalSpec>order:Alliance.Common.Model.Order.Order</FormalSpec>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%String</ReturnType>
<WebMethod>1</WebMethod>
<SoapBindingStyle>document</SoapBindingStyle>
<SoapBodyUse>literal</SoapBodyUse>
<Implementation><![CDATA[ Quit ..WebMethod("newOrder").Invoke($this, ..#NAMESPACE _ "/Alliance.Agris.WS.WSServiceReceiveNewOrder.newOrder",.order)
]]></Implementation>
</Method>
</Class>


<Routine name="Alliance" type="INC" timestamp="61831,46222"><![CDATA[
#include %occStatus
#include %occInclude

#define APPURI 			"/dispo"

#define UID 			%session.Data("ap","UID")
#define UNAME 			%session.Data("ap","UNAME")
#define ERR				%session.Data("ap","err")

 ; Line Delimiter and Element Delimiter
#define LD				"++++"
#define ED				"####"

#define THRED			5
#define THYELLOW		2
#define THGREEN			0

#define LOG(%msg)		set ^ole($I(^ole)) = %msg

#; Return the current time as %TIMESTAMP value
#; Format: YYYY-MM-DD HH:MM:SS.nnnnnn
#define NOW		$ZDateTime($ZTimeStamp,3,1,6)



]]></Routine>


<Project name="Alliance" LastModified="2010-11-03 16:54:20">
  <Items>
    <ProjectItem name="Alliance.Common.KAL.Code.MessageSenderType" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.Code.MessageSeverity" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.Code.MessageSubType" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.Code.MessageType" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.Code.SystemType" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.CommunicationParams" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.KeepAliveTask" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.Message" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.MessagesUnprocessed" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.WSClientMessageSender" type="CLS"/>
    <ProjectItem name="Alliance.Common.KAL.WSClientMessageSender.sendMessages" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Core.ObjectHeader" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.DespatchAdvice" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.EDIHeader" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.ItemDetails" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.PackageInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.PackageUnit" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.PartyInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.DespatchAdvice.TransportDetails" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.AllowanceOrCharge" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.EDIHeader" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.Invoice" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.InvoiceLine" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.ItemDescription" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.MonetaryDetail" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.PartyInformation" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.PaymentTerms" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.PriceInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.ProductId" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.QuantityInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.ReferenceInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Invoice.TaxDetail" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.Buyer" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.CurrencyDetails" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.DeliveryParty" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.DeliveryTerms" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.EDIDTM" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.EDIFTX" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.EDIInfo" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.ItemDescription" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.Order" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.OrderLine" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.PartyInformation" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.PaymentTerms" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.PriceInformation" type="CLS"/>
    <ProjectItem name="Alliance.Common.Model.Order.Supplier" type="CLS"/>
    <ProjectItem name="Alliance.Ens.AS2.Notification" type="CLS"/>
    <ProjectItem name="Alliance.Ens.AS2.NotificationType" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Adapter.SOAPInboundAdapterNoLog" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DTL.EDI2ModelOrder" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DTL.ModelDespatchAdvice2EDI" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DTL.ModelInvoice2EDI" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.AS2Messages" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.AbstractZENPage" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.Application" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.CodeStatusTimeThreshold" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.Login" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.Processes" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.Production" type="CLS"/>
    <ProjectItem name="Alliance.Ens.DispCons.Systems" type="CLS"/>
    <ProjectItem name="Alliance.Ens.KAL.MessagesReceived" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.DespatchAdviceRequest" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.DespatchAdviceResponse" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.InvoiceRequest" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.InvoiceResponse" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.KALMessagesRequest" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.OrderRequest" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.OrderResponse" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Message.RequestWithID" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.DESADVInterchangeMessageWriter" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.DebugOutputOperation" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.GetDespatchAdviceFromAgrisM" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.GetFinalOrderFromAgrisM" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.GetInvoiceFromAgrisM" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.INVOICInterchangeMessageWriter" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Operation.SendNewOrderToAgrisM" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.CreateKALMessage" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.DespatchAdviceProcessor" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.InvoiceProcessor" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.KALMessageProcess" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.ModelDespatchAdvice2DESADV" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.ModelDespatchAdvice2DESADVInterchange" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.ModelInvoice2INVOIC" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Process.ModelInvoice2INVOICInterchange" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Production.Alliance" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Rules.OrderInRouting.RUL" type="RUL"/>
    <ProjectItem name="Alliance.Ens.Service.AS2NotifierService" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Service.KALPickupService" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Setup.AttachedSystems" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Setup.AttachedSystemsSetupPage" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Setup.Initializer" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Setup.Version" type="CLS"/>
    <ProjectItem name="Alliance.Ens.Setup.WSClientAttachedSystemSetup" type="CLS"/>
    <ProjectItem name="Alliance.Ens.WS.WSClientGetDespatchAdvice" type="CLS"/>
    <ProjectItem name="Alliance.Ens.WS.WSClientGetFinalOrder" type="CLS"/>
    <ProjectItem name="Alliance.Ens.WS.WSClientGetInvoice" type="CLS"/>
    <ProjectItem name="Alliance.Ens.WS.WSClientSendNewOrder" type="CLS"/>
    <ProjectItem name="Alliance.INC" type="MAC"/>
    <ProjectItem name="EnsLib.EDI.EDIFACT.Document" type="CLS"/>
    <ProjectItem name="csp/allianceprod/dispo/index.html" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/Thumbs.db" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/garbage.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat10.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat100.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat100.png" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat102.png" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat10_old.png" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat20.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat20.png" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat30.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/stat30.png" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/statGreen.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/statRed.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/statWhite.gif" type="CSP"/>
    <ProjectItem name="csp/allianceprod/dispo/pic/statYellow.gif" type="CSP"/>
    <ProjectItem name="noLOGINFO.INC" type="MAC"/>
  </Items>
</Project>


<Class name="EnsLib.EDI.EDIFACT.Document">
<Description>
Represents an Interchange or a TransactionSet. FunctionalGroups are represented as Segments within an Interchange.</Description>
<ClassType>persistent</ClassType>
<IncludeCode>EnsEDIEDIFACT</IncludeCode>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent,EnsLib.EDI.BatchDocument,EnsLib.EDI.Segmented,EnsLib.EDI.EDIFACT.MsgBodyMethods</Super>
<System>3</System>
<TimeChanged>61831,47534.506791</TimeChanged>
<TimeCreated>59816,48502.780779</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="DOMAIN">
<Description>
Use our own domain for localization</Description>
<Default>Ensemble</Default>
</Parameter>

<Parameter name="DOCCLASSNAME">
<Default>EDIFACT Document</Default>
</Parameter>

<Parameter name="DOCCLASSFULLNAME">
<Default>UN EDIFACT EDI Document</Default>
</Parameter>

<Parameter name="DOCSHORTNAME">
<Default>EDIFACT</Default>
</Parameter>

<Parameter name="DEFSEARCHCLASS">
<Default>EnsLib.EDI.EDIFACT.SearchTable</Default>
</Parameter>

<Parameter name="EXTENTSIZE">
<Default>2000000</Default>
</Parameter>

<Index name="Extent">
<Type>bitmap</Type>
<Extent>1</Extent>
</Index>

<Index name="ParentId">
<Properties>ParentId</Properties>
</Index>

<Index name="OriginalDocId">
<Properties>OriginalDocId</Properties>
</Index>

<Property name="Separators">
<Description>
All 4 Separators as a String, plus optionally SegmentTerminator: COMSEP_ELESEP_ESCSEP_REPSEP
Additional characters will be output as the Segment Terminator; may be up to 3 chars for output with newlines</Description>
<Type>%String</Type>
<Transient>1</Transient>
<Parameter name="MAXLEN" value="7"/>
<Parameter name="MINLEN" value="4"/>
</Property>

<Property name="ComponentSeparator">
<Description>
Sub-element component separator character</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
</Property>

<Property name="ElementSeparator">
<Description>
Data-element separator character</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
</Property>

<Property name="EscapeSeparator">
<Description>
Release / Escape character</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
</Property>

<Property name="RepetitionSeparator">
<Description>
Repetition separator character</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
</Property>

<Property name="SegmentTerminator">
<Description>
Segment Terminator character(s)</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
</Property>

<Property name="Name">
<Description>
Raw type name of document</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {Name}=##class({%%CLASSNAME}).getName({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="TypeVersion">
<Description>
Raw type version name of message found at MSH:12 in message content</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {TypeVersion}=##class({%%CLASSNAME}).getTypeVersion({ID},{ParentId}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="Identifier">
<Description>
Unique document identification string found in document content</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {Identifier}=##class({%%CLASSNAME}).getIdentifier({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="SegCount">
<Description>
Count of segments composing this document</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {SegCount}=$G($$$vaExtentGbl({ID},"segs"),0) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ChildCount">
<Description>
Number of Children</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ChildCount}=##class({%%CLASSNAME}).getChildCount({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentIds">
<Description>
A $List of the Ids of all the enclosing parent documents of this nested document, if nested,
in order from from immediate to outermost
E.g. for Id of enclosing EncounterBatch if we are an Encounter</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ParentIds}=##class({%%CLASSNAME}).getParentIds({ParentId},1) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="RawContent">
<Description>
The raw text content of the document. Note that this is a truncated version suitable for use in SQL results and visual inspection,
but not a complete or definitive representation of the document.</Description>
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {RawContent}=##class({%%CLASSNAME}).getSegsAsString({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
<Parameter name="MAXLEN" value="10000"/>
</Property>

<Property name="DocTypeCategory">
<Description>
the category portion of the DocType</Description>
<Type>%String</Type>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="DocTypeName">
<Description>
Stored raw document type name ; the secondary type name portion of the DocType</Description>
<Type>%String</Type>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="FullSize">
<Description><![CDATA[
Size in bytes of the message content (assuming 1-byte segment terminators, including segments >32k)]]></Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="%maps">
<Description>
A local array of orefs
"orefs" - a local map of integer ids to segment objects
And either a subscript into ^CacheTemp for this object's LVD maps (for notes on LVD implementation see EnsEDI.inc)
or local storage for these additional maps:
"runtimeIndex" - array for runtime index to segment; will always be defined unless mapRuntimePath is defined
"runtimePath" - array for runtime path to segment
"bidirectionalLink" - array for runtime path and index linkage</Description>
<MultiDimensional>1</MultiDimensional>
<Transient>1</Transient>
</Property>

<Property name="%ClonedId">
<Description><![CDATA[
Id of parent object if we are a mutable clone (also used as a legal subscript that will result in $G(xxx(..%ClonedId))="" instead of a <SUBSCRIPT> error)]]></Description>
<Type>%CacheString</Type>
<Internal>1</Internal>
<InitialExpression>0</InitialExpression>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentInterchange">
<Type>EnsLib.EDI.EDIFACT.Document</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentHeaderSeg">
<Type>EnsLib.EDI.EDIFACT.Segment</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentHeaderSegId">
<Description>
Id of the header segment of the Interchange within which this TransactionSet arrived</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ParentHeaderSegId}=##class({%%CLASSNAME}).getHeaderSegId($P({ParentId},":")) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentTrailerSeg">
<Type>EnsLib.EDI.EDIFACT.Segment</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentTrailerSegId">
<Description>
Id of the end segment of the Interchange within which this TransactionSet arrived</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ParentTrailerSegId}=##class({%%CLASSNAME}).getTrailerSegId($P({ParentId},":")) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentGroupSeg">
<Type>EnsLib.EDI.EDIFACT.Segment</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentGroupSegId">
<Description>
Id of the group start segment of the FunctionalGroup in the Interchange within which this TransactionSet arrived</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ParentGroupSegId}=##class({%%CLASSNAME}).getGroupSegId({ParentId}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentGroupEndSeg">
<Type>EnsLib.EDI.EDIFACT.Segment</Type>
<Calculated>1</Calculated>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="ParentGroupEndSegId">
<Description>
Id of the group end segment of the FunctionalGroup in the Interchange within which this TransactionSet arrived</Description>
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ParentGroupEndSegId}=##class({%%CLASSNAME}).getGroupEndSegId({ParentId}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Transient>1</Transient>
<ReadOnly>1</ReadOnly>
</Property>

<Property name="Attachments">
<Description>
Attachment streams associated with this document</Description>
<Type>Ens.StreamContainer</Type>
<Collection>array</Collection>
</Property>

<Method name="ComponentSeparatorGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$$$COMSEP(..Separators)
]]></Implementation>
</Method>

<Method name="ElementSeparatorGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$$$ELESEP(..Separators)
]]></Implementation>
</Method>

<Method name="EscapeSeparatorGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$$$ESCSEP(..Separators)
]]></Implementation>
</Method>

<Method name="RepetitionSeparatorGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$$$REPSEP(..Separators)
]]></Implementation>
</Method>

<Method name="SegmentTerminatorGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tSegTerminator=$$$SEGTERM(..Separators)
	If ""=tSegTerminator { Set tUNA=..getSegmentByIndex(1) Set:$IsObject(tUNA) tSegTerminator=tUNA.UNASegmentTerminator }
	Set:""=tSegTerminator tSegTerminator=$$$EDIFACTDefSegTerminator
	Quit tSegTerminator
]]></Implementation>
</Method>

<Method name="NameGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$Case(..GetValueAt("1:0"), "UNA":"Interchange", "UNB":"Interchange", "UNG":"Group", "UNO":"Object", "UIH":..GetValueAt("1:1.1"), :..GetValueAt("1:2.1"))
]]></Implementation>
</Method>

<Method name="getName">
<ClassMethod>1</ClassMethod>
<FormalSpec>pId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:""=pId ""
	Set tSegId=$G($$$vaExtentGbl(pId,"segs",1))
	Quit:""=tSegId ""
	Set data=$G($$$vaSegment(tSegId))
	Quit $Case($$$vaDataSegName(data)
			, "UNA":"Interchange"
			, "UNB":"Interchange"
			, "UIB":"Interchange"
			, "UNG":"Group"
			, "UNO":"Object"
			, "UIH":$$$vaDataUIHTypeName(data)
			, :$$$vaDataTypeName(data))
]]></Implementation>
</Method>

<Method name="TypeVersionGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tSegName=..GetValueAt("1:0")
	Quit $Case(tSegName
		, "UNA":$TR($P(..GetValueAt("2:1",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,1,2),$$$EDIFACTDefComponentSeparator)
		, "UNB":$TR($P(..GetValueAt("1:1",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,1,2),$$$EDIFACTDefComponentSeparator)
		, "UIB":$TR($P(..GetValueAt("1:1",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,1,2),$$$EDIFACTDefComponentSeparator)
		, "UNG":$TR($P(..GetValueAt("1:7",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,1,2),$$$EDIFACTDefComponentSeparator)
		, "UNO":"OBJECT"
		, "UIH":$TR($P(..GetValueAt("1:1",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,2,3),$$$EDIFACTDefComponentSeparator)
		, :$TR($P(..GetValueAt("1:2",$$$EDIFACTDefSeparators),$$$EDIFACTDefComponentSeparator,2,3),$$$EDIFACTDefComponentSeparator))
]]></Implementation>
</Method>

<Method name="getTypeVersion">
<ClassMethod>1</ClassMethod>
<FormalSpec>pId:%CacheString,pParentId:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:""=pId ""
	Set tSegId=$G($$$vaExtentGbl(pId,"segs",1))
	Quit:""=tSegId ""
	Set data=$G($$$vaSegment(tSegId))
	Quit $Case($$$vaDataSegName(data)
			, "UNA":$$$vaDataUNBTypeVersion($G($$$vaSegment(+(0_$G($$$vaExtentGbl(pId,"segs",2))))))
			, "UNB":$$$vaDataUNBTypeVersion(data)
			, "UIB":$$$vaDataUIBTypeVersion(data)
			, "UNG":$$$vaDataUNGTypeVersion(data)
			, "UNO":"OBJECT"
			, "UIH":$$$vaDataUIHTypeVersion(data)
			, :$$$vaDataTypeVersion(data))
]]></Implementation>
</Method>

<Method name="IdentifierGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$Case(..GetValueAt("1:0"), "UNA":..GetValueAt("2:5"), "UNB":..GetValueAt("1:5"), "UIB":..GetValueAt("1:3.1"), "UNG":..GetValueAt("1:5"), "UNO":..GetValueAt("1:1"), "UIH":..GetValueAt("1:3,$$$EDIFACTDefSeparators"), :..GetValueAt("1:1"))
]]></Implementation>
</Method>

<Method name="getIdentifier">
<ClassMethod>1</ClassMethod>
<FormalSpec>pId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:""=pId ""
	Set tSegId=$G($$$vaExtentGbl(pId,"segs",1))
	Quit:""=tSegId ""
	Set data=$G($$$vaSegment(tSegId))
	Quit $Case($$$vaDataSegName(data)
			, "UNA":$$$vaDataUNBIdentifier($G($$$vaSegment(+(0_$G($$$vaExtentGbl(pId,"segs",2))))))
			, "UNB":$$$vaDataUNBIdentifier(data)
			, "UIB":$$$vaDataUIBIdentifier(data)
			, "UNG":$$$vaDataUNGIdentifier(data)
			, "UNO":$$$vaDataUNOIdentifier(data)
			, :$$$vaDataIdentifier(data))
]]></Implementation>
</Method>

<Method name="SegCountGet">
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	If $D($$$vaM("runtimeIndex")) Quit $$$vaM("runtimeIndex")
	Set count=0,path="" For  Set path=$O($$$vaM("runtimePath",path)) Quit:path=""  Set count=count+1
	Quit count
]]></Implementation>
</Method>

<Method name="RawContentGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ..OutputToString()
]]></Implementation>
</Method>

<Method name="ParentInterchangeGet">
<CodeMode>expression</CodeMode>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.EDIFACT.Document).%OpenId(..ParentInterchangeGetObjectId())
]]></Implementation>
</Method>

<Method name="ParentInterchangeGetObjectId">
<Description>
Required for AutoForm</Description>
<CodeMode>expression</CodeMode>
<FormalSpec>force:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$P(..TopParentId,":")
]]></Implementation>
</Method>

<Method name="ParentHeaderSegGet">
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Quit:""=$P(..ParentInterchangeGetObjectId(),":") $$$NULLOREF
	Set tInterchange=..ParentInterchange
	Set tSeg=tInterchange.GetSegmentAt(1)
	Set:"UNA"=tSeg.GetValueAt(0) tSeg=tInterchange.GetSegmentAt(2)
	Quit tSeg
]]></Implementation>
</Method>

<Method name="ParentHeaderSegIdGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:""=$P(..ParentInterchangeGetObjectId(),":") ""
	Set tInterchange=..ParentInterchange
	Set tSegId=tInterchange.GetSegmentIdAt(1)
	Set:"UNA"=tInterchange.GetValueAt("1:0") tSegId=tInterchange.GetSegmentIdAt(2)
	Quit tSegId
]]></Implementation>
</Method>

<Method name="getHeaderSegId">
<ClassMethod>1</ClassMethod>
<FormalSpec>pParentId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tParentIds=..getParentIds(pParentId,1), tNumParents=$LL(tParentIds)
	Set tInterchangeId=$P($LG(tParentIds,tNumParents),":")
	Quit $S(""=tInterchangeId:"", 1:$G($$$vaExtentGbl(tInterchangeId,"segs",1)))
]]></Implementation>
</Method>

<Method name="ParentTrailerSegGet">
<CodeMode>expression</CodeMode>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[$S(""=$P(..ParentInterchangeGetObjectId(),":"):$$$NULLOREF, 1:..ParentInterchange.GetSegmentAt(..ParentInterchange.SegCount))
]]></Implementation>
</Method>

<Method name="ParentTrailerSegIdGet">
<CodeMode>expression</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$S(""=..ParentId:"", 1:..ParentInterchange.GetSegmentIdAt(..ParentInterchange.SegCount))
]]></Implementation>
</Method>

<Method name="getTrailerSegId">
<ClassMethod>1</ClassMethod>
<FormalSpec>pParentId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tParentIds=..getParentIds(pParentId,1), tNumParents=$LL(tParentIds)
	Set tInterchangeId=$P($LG(tParentIds,tNumParents),":")
	Quit $S(""=tInterchangeId:"", 1:$G($$$vaExtentGbl(tInterchangeId,"segs",$G($$$vaExtentGbl(tInterchangeId,"segs"),0))))
]]></Implementation>
</Method>

<Method name="ParentGroupSegGet">
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set tId=..ParentId, tIndex=$P(tId,":",2), tId=$P(tId,":")  Quit:""=tId ""
	Set tParent=..%OpenId(tId)  Quit:'$IsObject(tParent) $$$NULLOREF
	Quit tParent.GetSegmentAt(tIndex-1)
]]></Implementation>
</Method>

<Method name="ParentGroupSegIdGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tId=..ParentId, tIndex=$P(tId,":",2), tId=$P(tId,":")  Quit:""=tId ""
	Set tParent=..%OpenId(tId)  Quit:'$IsObject(tParent) ""
	Quit tParent.GetSegmentIdAt(tIndex-1)
]]></Implementation>
</Method>

<Method name="getGroupSegId">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec>pId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$S($Case($F(pId,":"), 0:1 ,2:1, $L(pId)+1:1, :0):"", 1:$G($$$vaExtentGbl($P(pId,":"),"segs",$P(pId,":",2)-1)))
]]></Implementation>
</Method>

<Method name="ParentGroupEndSegGet">
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set tId=..ParentId, tId=$P(tId,":"), tIndex=$P(tId,":",2)  Quit:""=tId ""
	Set tParent=..%OpenId(tId)  Quit:'$IsObject(tParent) ""
	Quit tParent.GetSegmentAt(tIndex+1)
]]></Implementation>
</Method>

<Method name="ParentGroupEndSegIdGet">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tId=..ParentId, tIndex=$P(tId,":",2), tId=$P(tId,":")  Quit:""=tId ""
	Set tParent=..%OpenId(tId)  Quit:'$IsObject(tParent) ""
	Quit tParent.GetSegmentIdAt(tIndex+1)
]]></Implementation>
</Method>

<Method name="getGroupEndSegId">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec>pId:%CacheString</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[$S($Case($F(pId,":"), 0:1, 2:1, $L(pId)+1:1, :0):"", 1:$G($$$vaExtentGbl($P(pId,":"),"segs",$P(pId,":",2)+1)))
]]></Implementation>
</Method>

<Method name="GetNextIndex">
<Description>
Gets the next index in an array</Description>
<FormalSpec><![CDATA[pPath:%String,pIndex:%String,&pStatus:%Status=$$$OK]]></FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set f=$F(pPath,"()")  If 'f Set pStatus=$$$ERROR($$$EnsErrGeneral,"Can't iterate on SegmentPath '"_pPath_"'") Quit ""
	Set tSegmentPath=$P(pPath,":",1)
	If f-1>$L(tSegmentPath) { ; '()' was found in PropertyPath not SegmentPath
		Set tPropertyPath=$P(pPath,":",2)
		Set tSegObj=..GetSegmentAt(tSegmentPath,.pStatus) Quit:$$$ISERR(pStatus) ""
		Quit tSegObj.GetNextIndex(tPropertyPath,pIndex,.pStatus)
	} Else {
		Set tHead=$E(pPath,1,f-2), tLen=$L(tHead)
		Quit:"("=tHead $S(+pIndex<..SegCount:pIndex+1,1:"") ; iterate by index if path is just "()"
		Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
		If '$D($$$vaM("loopIndex",tHead)) {
			#; Build LoopIndex node
			Set path=tHead For { Set path=$O($$$vaM("runtimePath",path))  Quit:path=""
				Quit:$E(path,1,tLen)'=tHead
				Set $$$vaM("loopIndex",tHead,$E(path,tLen+1,$F(path,")",tLen)-2))=""
			}
			If '$D($$$vaM("loopIndex",tHead)) Set $$$vaM("loopIndex",tHead)=0
		}
		Quit $O($$$vaM("loopIndex",tHead,pIndex))
	}
]]></Implementation>
</Method>

<Method name="GetNextGroupPath">
<Description>
Gets the next path in a group</Description>
<FormalSpec><![CDATA[pGroup:%String,pPath:%String,&pStatus:%Status=$$$OK]]></FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:$$$vaIsIndex(pGroup) ""
	If pGroup[":"||($L(pPath)<$L(pGroup)) Set pStatus=$$$ERROR($$$EnsErrGeneral,"Can't iterate in Group '"_pGroup_"' on Path '"_pPath_"'") Quit ""
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
	Set nextpath=$O($$$vaM("runtimePath",pPath))
	Quit:$E(nextpath,1,$L(pGroup))'=pGroup||$Case($E(nextpath,$L(pGroup)+1),"(":0,".":0,:1) ""
	Quit nextpath
]]></Implementation>
</Method>

<Method name="SetValueAt">
<FormalSpec>pValue:%String,pSegmentPropertyPath:%String,pAction:%String="set",pKey:%String=""</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	If pSegmentPropertyPath["()" {
		Set tSC=$$$OK
		Set tFind=$F(pSegmentPropertyPath,"()")
		Set tHead=$E(pSegmentPropertyPath,1,tFind-3), tTail=$E(pSegmentPropertyPath,tFind,*)
		Set k=$P(pKey,","), pKey=$P(pKey,",",2,$L(pKey,","))
		If k { Set tSC=..SetValueAt(.pValue,tHead_"("_(k)_")"_tTail,pAction,pKey) Quit:$$$ISERR(tSC) }
		Else {
			Set i="" For { Set i=..GetNextIndex(tHead_"()",i) Quit:i=""
				Set tNewPath=tHead_"("_(i)_")"_tTail
				Set tSC=..SetValueAt(.pValue,tNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
			}
		}
		Quit tSC
	}
	Set tGrpPath=$P(pSegmentPropertyPath,":"), tPropPath=$P(pSegmentPropertyPath,":",2)
	Set tSegPath=..GetNextGroupPath(tGrpPath,tGrpPath)
	If ""'=tSegPath { ; if there are group sub-elements
		For {
			Set tNewPath=tSegPath_$S(""=tPropPath:"",1:":"_tPropPath)
			Set tSC=..SetValueAt(.pValue,tNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
			Set tSegPath=..GetNextGroupPath(tGrpPath,tSegPath,.tSC) Quit:$$$ISERR(tSC)
			Quit:""=tSegPath
		}
		Quit tSC
	} Else {
		Quit:(pAction="remove")&&(""=tPropPath) ..RemoveSegmentAt(tGrpPath)
		Set tSegObj=..GetMutableSegmentAt(tGrpPath,.tSC)  Quit:$$$ISERR(tSC) tSC  $$$ASSERT($IsObject(tSegObj))
		Quit tSegObj.SetValueAt(.pValue,tPropPath,pAction,pKey)
	}
]]></Implementation>
</Method>

<Method name="GetValueAt">
<FormalSpec>pSegmentPropertyPath:%String,pSeparators:%String,*pStatus:%Status</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK, tSeparators=$G(pSeparators,..Separators)
	Set tSegmentPath=$P(pSegmentPropertyPath,":"), tPropertyPath=$P(pSegmentPropertyPath,":",2)
	If ""=tPropertyPath&&(tSegmentPath["*") {
		Quit:$Case(tSegmentPath,"*":1,"(*)":1,:0) ..SegCount
		Set tLen=$L(tSegmentPath)
		If $E(tSegmentPath,tLen-2,tLen)="(*)" {
			Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
			Set count=0, (path,path0)=$E(tSegmentPath,1,tLen-2), tLen0=$L(path0), i=0
			For { Set path=$O($$$vaM("runtimePath",path))  Quit:path=""||(path0'=$E(path,1,tLen0))
				Set ti=+$E(path,tLen0+1,*)  Set:ti'=i&&ti count=count+1,i=ti
			}
			Quit count
		}
		If $E(tSegmentPath,tLen-1,tLen)=".*" {
			Set count=0,(path,path0)=$E(tSegmentPath,1,tLen-2),tLen0=$L(path0)
			Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
			For { Set path=$O($$$vaM("runtimePath",path))  Quit:path=""||(path0'=$E(path,1,tLen0))  Set count=count+1 }
			Quit count
		}
		Quit $$$ERROR($$$EnsErrGeneral,"Invalid segment count value path '"_tSegmentPath_"'")
	}
	Set tSegObj=..GetSegmentAt(tSegmentPath,.pStatus)  Quit:'$IsObject(tSegObj) ""  $$$ASSERT($$$ISOK(pStatus))
	Quit tSegObj.GetValueAt(tPropertyPath,tSeparators,.pStatus)
]]></Implementation>
</Method>

<Method name="GetSegmentPath">
<Description>
Given a segment index, find the corresponding segment path</Description>
<FormalSpec>pIndex:%Integer,*pStatus:%Status</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	If '$D($$$vaM("bidirectionalLink")) {
		If '$D($$$vaM("runtimePath")) { Set pStatus=$$$ERROR($$$EnsErrGeneral,"Document is in index-only mode")  Quit "" }
		Else { Set pStatus=$$$ERROR($$$EnsErrGeneral,"Document is in path-only mode")  Quit "" }
	}
	Set pStatus=$$$OK
	Set tVal=$G($$$vaM("bidirectionalLink",+pIndex))
	Set:""=tVal pStatus=$$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")
	Quit tVal
]]></Implementation>
</Method>

<Method name="GetSegmentIndex">
<Description>
Given a segment path, find the corresponding segment index</Description>
<FormalSpec>pPath:%String,*pStatus:%Status</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	If '$D($$$vaM("bidirectionalLink")) {
		If '$D($$$vaM("runtimePath")) { Set pStatus=$$$ERROR($$$EnsErrGeneral,"Document is in index-only mode")  Quit "" }
		Else { Set pStatus=pStatus=$$$ERROR($$$EnsErrGeneral,"Document is in path-only mode")  Quit "" }
	}
	Set pStatus=$$$OK
	Set tVal=$G($$$vaM("bidirectionalLink",pPath))
	Set:""=tVal||(tVal'=+tVal) pStatus=$$$ERROR($$$EnsErrGeneral,"Path "_pPath_" not found")
	Quit tVal
]]></Implementation>
</Method>

<Method name="GetValuesArray">
<Description>
Finds all values matching a SegPath:PropertyPath string that contains zero or more () implicit iterators</Description>
<FormalSpec><![CDATA[pSegmentPropertyPath:%String,pSeparators:%String,&pArray:%String,*pStatus:%Status]]></FormalSpec>
<Implementation><![CDATA[
	Set pStatus=$$$OK  Kill pArray
	Do ..getValsArray(pSegmentPropertyPath,.pSeparators,.pArray,.pStatus)
]]></Implementation>
</Method>

<Method name="getValsArray">
<Description>
Finds all values matching a SegPath:PropertyPath string that contains zero or more () implicit iterators</Description>
<FormalSpec><![CDATA[pSegmentPropertyPath:%String,pSeparators:%String,&pArray:%String,*pStatus:%Status]]></FormalSpec>
<Implementation><![CDATA[
	Set $ZT="Trap"
	Set f=$F(pSegmentPropertyPath,"()")
	If 'f { Set tVal=..GetValueAt(pSegmentPropertyPath,.pSeparators,.pStatus)  Set:""'=tVal pArray(tVal)=""  Quit }
	Set tHead=$E(pSegmentPropertyPath,1,f-3)
	Set tTail=$E(pSegmentPropertyPath,f,*)

	Set i="" For { Set i=..GetNextIndex(tHead_"()",i,.pStatus)  Quit:i=""
		Set tNewPath=tHead_"("_(i)_")"_tTail
		Do ..getValsArray(tNewPath,.pSeparators,.pArray,.tSC)
		Set:$$$ISERR(tSC) pStatus=$$$ADDSC(pStatus,tSC)
	}
	Quit
Trap
	Set $ZT="", pStatus=$$$SystemError
	Quit
]]></Implementation>
</Method>

<Method name="GetValues">
<Description>
Finds all values matching a SegPath:PropertyPath string that contains zero or more () implicit iterators
Supports SegPath values with (), (n) to choose a specific one of the given type, or just plain (same as seg() or seg(*)).</Description>
<FormalSpec><![CDATA[pSegmentPropertyPath:%String,pSeparators:%String,pValSepString:%String="<>",*pStatus:%Status]]></FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK
	Set f=$F(pSegmentPropertyPath,"()")  Quit:'f ..GetValueAt(pSegmentPropertyPath,.pSeparators,.pStatus)
	Set tHead=$E(pSegmentPropertyPath,1,f-3)
	Set tTail=$E(pSegmentPropertyPath,f,*)
	Set tVals=""
	Set i="" For { Set i=..GetNextIndex(tHead_"()",i,.pStatus)  Quit:i=""
		Set tNewPath=tHead_"("_(i)_")"_tTail
		Set tVal=..GetValues(tNewPath,.pSeparators,pValSepString,.tSC)
		Set:""'=tVal tVals=$S(""=tVals:"",1:tVals_pValSepString)_tVal
		Set:$$$ISERR(tSC) pStatus=$$$ADDSC(pStatus,tSC)
	}
	Quit tVals
]]></Implementation>
</Method>

<Method name="FindSegmentValuesArray">
<Description>
Finds all values matching a SegName:PropertyPath string, where the SegName is a simple segment type name
 (not a full schema-based seg path); PropertyPath describes a field or subfield within the segment.
Supports SegName = '*' to match any segment, and SegName(n) to match only the n'th segment of the given type.</Description>
<FormalSpec><![CDATA[pSegmentPropertyPath:%String,pSeparators:%String,&pArray:%String,*pStatus:%Status,pSchemaCategory:%String=""]]></FormalSpec>
<Implementation><![CDATA[
	Set pStatus=$$$OK  Kill pArray
	Set tSegName=$P(pSegmentPropertyPath,":"), tPropPath=$P(pSegmentPropertyPath,":",2)
	Set tSegIndex=$P(tSegName,"(",2), tSegName=$P($P($P(tSegName,"("),"-"),"!"), tSegIndex=$ZStrip($P(tSegIndex,")"),"<>W","*")
	Do:$ZStrip(tPropPath,"*A")'=tPropPath&&(""'=..DocType)&&(""=..BuildMapStatus) ..BuildMap(0) ; get seg types if available
	Set tIndex="" For i=1:1 { Set tSegObj=..FindSegment(tSegName,.tIndex,.pStatus)  Quit:""=tIndex
		Continue:(""'=tSegIndex)&&(i'=tSegIndex) ; if they asked for a specific number, forsake all others
		Do tSegObj.FindValuesArray(tPropPath,.pSeparators,.pArray,.pSchemaCategory,.pStatus)  Quit:$$$ISERR(pStatus)
		Quit:i=tSegIndex ;all done
	}
]]></Implementation>
</Method>

<Method name="FindSegmentValues">
<Description>
Finds all values matching a SegName:PropertyPath string, where the SegName is a simple segment type name
 (not a full schema-based seg path); PropertyPath describes a field or subfield within the segment.
Supports SegName = '*' to match any segment, and SegName(n) to match only the n'th segment of the given type.</Description>
<FormalSpec><![CDATA[pSegmentPropertyPath:%String,pSeparators:%String,pValSepString:%String="<>",*pStatus:%Status,pSchemaCategory:%String=""]]></FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK
	Set tSegName=$P(pSegmentPropertyPath,":"), tPropPath=$P(pSegmentPropertyPath,":",2)
	Set tSegIndex=$P(tSegName,"(",2), tSegName=$P($P($P(tSegName,"("),"-"),"!"), tSegIndex=$ZStrip($P(tSegIndex,")"),"<>W","*")
	Do:$ZStrip(tPropPath,"*A")'=tPropPath&&(""'=..DocType)&&(""=..BuildMapStatus) ..BuildMap(0) ; get seg types if available
	Set (tVals,tIndex)="" For i=1:1 { Set tSegObj=..FindSegment(tSegName,.tIndex,.pStatus)  Quit:""=tIndex
		Continue:(""'=tSegIndex)&&(i'=tSegIndex) ; if they asked for a specific number, forsake all others
		Set tVal=tSegObj.FindValues(tPropPath,.pSeparators,pValSepString,.pSchemaCategory,.pStatus)  Quit:$$$ISERR(pStatus)
		Set:""'=tVal tVals=$S(""=tVals:"",1:tVals_pValSepString)_tVal
		Quit:i=tSegIndex ;all done
	}
	Quit tVals
]]></Implementation>
</Method>

<Method name="FindSegment">
<Description>
Gets the next segment with the given name.
Supports SegName = '*' to match any segment</Description>
<FormalSpec><![CDATA[pSegName:%String,&pIndex:%String="",*pStatus:%Status]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK, tId=..%Id()  Set:'tId tId=..%ClonedId
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Set seg=""  For index=+pIndex+1:1:$$$vaM("runtimeIndex") { Set seg=$$$vaSegLookthru(index,tId)  Continue:""=seg
		If $$$vaIsOref(seg) {
			Set tSegObj=..%maps("orefs",index)
			If (pSegName="*")||(tSegObj.Name=pSegName) Set pIndex=index  Quit
		} Else {
			Set segid=$P(seg,"|"), data=$G($$$vaSegment(segid))
			If (pSegName="*")||(pSegName=$$$vaDataSegName(data)) {
				#; Same code as in getSegmentByIndex
				Set pIndex=index
				Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB(segid,(..IsMutable&&(tId=..%ClonedId)),$P(seg,"|",2)))
				Set ..%maps("orefs",pIndex)=tSegObj
				Set $$$vaM("runtimeIndex",pIndex)="@"
				Set path=$G($$$vaM("bidirectionalLink",pIndex)) Set:""'=path $$$vaM("runtimePath",path)="@"_pIndex
				Quit
			}
		}
	}
	If +pIndex<index Set pIndex=""  Quit $$$NULLOREF
	Quit tSegObj
]]></Implementation>
</Method>

<Method name="getSegmentByIndex">
<FormalSpec>pIndex:%Integer,*pStatus:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Set pStatus=$$$OK, tId=..%Id()  Set:'tId tId=..%ClonedId
	Set seg=$$$vaSegLookthru(pIndex,tId)
	If seg="" Set pStatus=$$$ERROR($$$EnsErrGeneral,"Segment Index "_pIndex_" is out of bounds") Quit $$$NULLOREF
	Quit:$$$vaIsOref(seg) ..%maps("orefs",pIndex)
	Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB($P(seg,"|"),(..IsMutable&&(tId=..%ClonedId)),$P(seg,"|",2)))
	Set ..%maps("orefs",pIndex)=tSegObj
	Set $$$vaM("runtimeIndex",pIndex)="@"
	Set path=$G($$$vaM("bidirectionalLink",pIndex)) Set:""'=path $$$vaM("runtimePath",path)="@"_pIndex
	Quit tSegObj
]]></Implementation>
</Method>

<Method name="getSegmentByPath">
<FormalSpec>pPath:%String,*pStatus:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
	Set seg=$G($$$vaM("runtimePath",pPath))
	If seg="" Set pStatus=$$$ERROR($$$EnsErrGeneral,"No segment found at path '"_pPath_"'") Quit $$$NULLOREF
	Quit:$$$vaIsOref(seg) ..%maps("orefs",$E(seg,2,*))
	Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB($P(seg,"|"),(..IsMutable&&'..%Id()&&..%ClonedId),$P(seg,"|",2)))
	Set index=$G($$$vaM("bidirectionalLink",pPath))
	If index { Set seg="@"_index, $$$vaM("runtimeIndex",index)="@" }
	Else { Set index=$O(..%maps("orefs",""))-1, seg="@"_index}
	Set ..%maps("orefs",index)=tSegObj
	Set $$$vaM("runtimePath",pPath)=seg
	Quit tSegObj
]]></Implementation>
</Method>

<Method name="getSegmentIdByIndex">
<FormalSpec>pIndex:%Integer,*pStatus:%Status</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK, tId=..%Id()  Set:'tId tId=..%ClonedId
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Set seg=$$$vaSegLookthru(pIndex,tId)
	If seg="" Set pStatus=$$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds") Quit ""
	Quit:'$$$vaIsOref(seg) $P(seg,"|")
	Quit ..%maps("orefs",pIndex).ID
]]></Implementation>
</Method>

<Method name="getSegmentIdByPath">
<FormalSpec>pPath:%String,*pStatus:%Status</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set pStatus=$$$OK
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
	Set seg=$G($$$vaM("runtimePath",pPath))
	Quit:'$$$vaIsOref(seg) $P(seg,"|")
	Quit ..%maps("orefs",$E(seg,2,*)).ID
]]></Implementation>
</Method>

<Method name="getMutableSegmentByIndex">
<FormalSpec>pIndex:%Integer,*pStatus:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Set pStatus=$$$OK, i%BuildMapStatus="", tId=..%Id()  Set:'tId tId=..%ClonedId
	Set seg=$$$vaSegLookthru(pIndex,tId)
	If seg="" Set pStatus=$$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")  Quit $$$NULLOREF
	If $$$vaIsOref(seg) {
		Set tSegObj=..%maps("orefs",pIndex)
		If tSegObj.IsMutable Set tSegObj.Separators=..Separators  Quit tSegObj
		Kill ..%maps("orefs",pIndex)
		Set seg=tSegObj.ID_"|"_tSegObj.DocType
	}
	;Set tSegObj=..NewSegment(pPath)
	Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB($P(seg,"|"),1,$P(seg,"|",2)))
	If '$IsObject(tSegObj)  Set pStatus=%objlasterror  Quit $$$NULLOREF
	Set tSegObj.Separators=..Separators
	Set ..%maps("orefs",pIndex)=tSegObj
	Set $$$vaM("runtimeIndex",pIndex)="@"
	Set path=$G($$$vaM("bidirectionalLink",pIndex)) Set:""'=path $$$vaM("runtimePath",path)="@"_pIndex
	Quit tSegObj
]]></Implementation>
</Method>

<Method name="getMutableSegmentByPath">
<FormalSpec>pPath:%String,*pStatus:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	If (..DocTypeCategory="")||(..DocTypeName="") Set pStatus=$$$ERROR($$$EnsErrGeneral,"Cannot recognize path before DocType is set")  Quit $$$NULLOREF
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
	Set pStatus=$$$OK, i%BuildMapStatus=""
	Set seg=$G($$$vaM("runtimePath",pPath))
	If $$$vaIsOref(seg) {
		Set index=$E(seg,2,*)
		Set tSegObj=..%maps("orefs",index)
		If tSegObj.IsMutable Set tSegObj.Separators=..Separators  Quit tSegObj
		Kill ..%maps("orefs",index)
		Set seg=$S(""=tSegObj.ID:"",1:tSegObj.ID_$S(""=tSegObj.DocType:"", 1:"|"_tSegObj.DocType))
	}
	If ""=seg {
		;Set tSegObj=..NewSegment(pPath)
		Set schema=$G($$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"map",..convertRuntimePathToSchemaPath(pPath)))
		If schema="" Set pStatus=$$$ERROR($$$EnsErrGeneral,"Path '"_pPath_"' is not mapped in schema for DocType '"_..DocType_"'")  Quit $$$NULLOREF
		Set tSegType=..DocTypeCategory_":"_..DocTypeName_":"_$P(schema,"|",2), tSegName=$P($P($P(tSegType,":",3),"-"),"!")
		If $ZCVT(tSegName,"U")'=tSegName Set pStatus=$$$ERROR($$$EnsErrGeneral,"Cannot instantiate abstract segment type "_tSegType)  Quit $$$NULLOREF
		Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,tSegType,$E(..Separators,1,4)_tSegName))
		If '$IsObject(tSegObj) Set pStatus=%objlasterror  Quit $$$NULLOREF
		Kill $$$vaM("runtimeIndex"), $$$vaM("bidirectionalLink") ; we are operating only by PathMap now.
		Set index=$O(..%maps("orefs",""))-1, seg="@"_index
	} Else {
		Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB($P(seg,"|"),1,$P(seg,"|",2)))
		If '$IsObject(tSegObj) Set pStatus=%objlasterror  Quit $$$NULLOREF
		Set index=$G($$$vaM("bidirectionalLink",pPath))
		If index { Set seg="@"_index, $$$vaM("runtimeIndex",index)="@" }
		Else { Set index=$O(..%maps("orefs",""))-1, seg="@"_index }
	}
	Set tSegObj.Separators=..Separators
	Set ..%maps("orefs",index)=tSegObj
	Set $$$vaM("runtimePath",pPath)=seg
	If ..AutoBuildMap { Do ..BuildMap(0) }
	Else {
		Set i%BuildMapStatus=""
		#; Add relevant loopIndex node(s) if any
		Set tHead="" For { Set tHead=$O($$$vaM("loopIndex",tHead))  Quit:""=tHead
			Set tLen=$L(tHead)  If tHead=$E(pPath,1,tLen) Set $$$vaM("loopIndex",tHead,$E(pPath,tLen+1,$F(pPath,")",tLen)-2))=""
		}
	}
	Quit tSegObj
]]></Implementation>
</Method>

<Method name="setSegmentByIndex">
<FormalSpec>pSegObj:EnsLib.EDI.EDIFACT.Segment,pIndex:%Integer,pInsert:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Quit:(pIndex\1'=pIndex)||(pIndex<1)||(pIndex>($$$vaM("runtimeIndex")+1)) $$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")

	If pInsert {
		Set tId=..%Id()  Set:'tId tId=..%ClonedId  For i=$$$vaM("runtimeIndex"):-1:pIndex { ; slide up all segments to make room for inserted one
			Set $$$vaM("runtimeIndex",i+1)=$$$vaSegLookthru(i,tId)
			If $D(..%maps("orefs",i)) Set ..%maps("orefs",i+1)=..%maps("orefs",i)  Kill ..%maps("orefs",i)
		}
		Set path=""
	} Else {
		Set path=$G($$$vaM("bidirectionalLink",pIndex))  Set:""'=path $$$vaM("runtimePath",path)="@"_pIndex
	}
	If pInsert||(pIndex=($$$vaM("runtimeIndex")+1)) Set $$$vaM("runtimeIndex")=$$$vaM("runtimeIndex")+1

	Set $$$vaM("runtimeIndex",pIndex)="@"
	Set pSegObj.DocType="" ; setting by index, the SegType might not match its new position
	Set ..%maps("orefs",pIndex)=pSegObj

	Kill:""=path $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex") ; we are operating only by IndexMap now.
	If ..AutoBuildMap { Do ..BuildMap(0) } Else { Set i%BuildMapStatus="" }
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="setSegmentByPath">
<FormalSpec>pSegObj:EnsLib.EDI.EDIFACT.Segment,pPath:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Quit:(..DocTypeCategory="")||(""=..DocTypeName) $$$ERROR($$$EnsErrGeneral,"Cannot recognize path before DocType is set")
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)

	Set schema=$G($$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"map",..convertRuntimePathToSchemaPath(pPath)))
	Quit:""=schema $$$ERROR($$$EnsErrGeneral,"Path '"_pPath_"' is not mapped in schema for DocType '"_..DocType_"'")
	Set tSegType=..DocTypeCategory_":"_..DocTypeName_":"_$P(schema,"|",2), tSegName=$P($P($P(tSegType,":",3),"-"),"!")
	Quit:tSegName'=pSegObj.Name $$$ERROR($$$EnsErrGeneral,"Cannot set segment named '"_pSegObj.Name_"' at position "_pPath)
	Set pSegObj.DocType=tSegType ; setting by path, Set the SegType to match its new position

	Set index=$G($$$vaM("bidirectionalLink",pPath))
	If index { Set seg="@"_index, $$$vaM("runtimeIndex",index)="@" }
	Else {
		Set seg=$G($$$vaM("runtimePath",pPath))
		If $$$vaIsOref(seg) { Set index=$E(seg,2,*) }
		Else {
			Set index=$O(..%maps("orefs",""))-1, seg="@"_index
			Kill $$$vaM("runtimeIndex"), $$$vaM("bidirectionalLink") ; we are operating only by PathMap now.
		}
	}
	Set ..%maps("orefs",index)=pSegObj
	Set $$$vaM("runtimePath",pPath)=seg
	If ..AutoBuildMap { Do ..BuildMap(0) }
	Else {
		Set i%BuildMapStatus=""
		#; Add relevant loopIndex node(s) if any
		Set tHead="" For { Set tHead=$O($$$vaM("loopIndex",tHead))  Quit:""=tHead
			Set tLen=$L(tHead)  If tHead=$E(pPath,1,tLen) Set $$$vaM("loopIndex",tHead,$E(pPath,tLen+1,$F(pPath,")",tLen)-2))=""
		}
	}
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="setSegmentIdByIndex">
<FormalSpec>pSegId:%String,pIndex:%Integer,pInsert:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Quit:(pIndex\1'=pIndex)||(pIndex<1)||(pIndex>($$$vaM("runtimeIndex")+1)) $$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")

	If pInsert {
		Set tId=..%Id()  Set:'tId tId=..%ClonedId  For i=$$$vaM("runtimeIndex"):-1:pIndex { ; slide up all segments to make room for inserted one
			Set $$$vaM("runtimeIndex",i+1)=$$$vaSegLookthru(i,tId)
			If $D(..%maps("orefs",i)) Set ..%maps("orefs",i+1)=..%maps("orefs",i)  Kill ..%maps("orefs",i)
		}
		Set path=""
	} Else {
		Set path=$G($$$vaM("bidirectionalLink",pIndex))  Set:""'=path $$$vaM("runtimePath",path)="@"_pIndex
	}
	If pInsert||(pIndex=($$$vaM("runtimeIndex")+1)) Set $$$vaM("runtimeIndex")=$$$vaM("runtimeIndex")+1

	Set $$$vaM("runtimeIndex",pIndex)=pSegId
	
	Kill:""=path $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex") ; we are operating only by IndexMap now.
	If ..AutoBuildMap { Do ..BuildMap(0) } Else { Set i%BuildMapStatus="" }
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="setSegmentIdByPath">
<FormalSpec>pSegId:%String,pPath:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Quit:(..DocTypeCategory="")||(..DocTypeName="") $$$ERROR($$$EnsErrGeneral,"Cannot recognize path unless DocType is set")
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)

	Set schema=$G($$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"map",..convertRuntimePathToSchemaPath(pPath)))
	Quit:""=schema $$$ERROR($$$EnsErrGeneral,"Path '"_pPath_"' is not mapped in schema for DocType '"_..DocType_"'")
	Set newseg=pSegId_"|"_..DocTypeCategory_":"_..DocTypeName_":"_$P(schema,"|",2)
	
	Set index=$G($$$vaM("bidirectionalLink",pPath))
	If index { Kill ..%maps("orefs",index)  Set $$$vaM("runtimeIndex",index)=newseg }
	Else {
		Set seg=$G($$$vaM("runtimePath",pPath))
		If $$$vaIsOref(seg) { Kill ..%maps("orefs",$E(seg,2,*)) }
		Else {
			Kill $$$vaM("runtimeIndex"), $$$vaM("bidirectionalLink") ; we are operating only by PathMap now.
		}
	}
	Set $$$vaM("runtimePath",pPath)=newseg
	If ..AutoBuildMap { Do ..BuildMap(0) } Else { Set i%BuildMapStatus="" }
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="removeSegmentByIndex">
<FormalSpec>pIndex:%Integer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Set tId=..%Id()  Set:'tId tId=..%ClonedId
	Set seg=$$$vaSegLookthru(pIndex,tId)

	Quit:""=seg $$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")

	For i=pIndex:1:$$$vaM("runtimeIndex")-1 { ; slide all segments down over removed one
		Set $$$vaM("runtimeIndex",i)=$$$vaSegLookthru(i+1,tId)
		If $D(..%maps("orefs",i+1)) Set ..%maps("orefs",i)=..%maps("orefs",i+1)  Kill ..%maps("orefs",i+1)
	}
	Kill $$$vaM("runtimeIndex",$$$vaM("runtimeIndex")), ..%maps("orefs",$$$vaM("runtimeIndex"))
	Set $$$vaM("runtimeIndex")=$$$vaM("runtimeIndex")-1

	Kill $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex") ; we are operating only by IndexMap now.
	If ..AutoBuildMap { Do ..BuildMap(0) } Else { Set i%BuildMapStatus="" }
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="removeSegmentByPath">
<FormalSpec>pPath:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Quit:(..DocTypeCategory="")||(..DocTypeName="") $$$ERROR($$$EnsErrGeneral,"Cannot recognize path before DocType is set")
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)

	Set seg=$G($$$vaM("runtimePath",pPath))  If seg="" Quit $$$ERROR($$$EnsErrGeneral,"No segment found at path '"_pPath_"'")
	If $$$vaIsOref(seg) { Kill ..%maps("orefs",$E(seg,2,*)) }
	Kill $$$vaM("runtimePath",pPath)

	Kill $$$vaM("runtimeIndex"), $$$vaM("bidirectionalLink") ; we are operating only by PathMap now.
	If ..AutoBuildMap { Do ..BuildMap(0) }
	Else {
		Set i%BuildMapStatus=""
		If pPath["(" {
			#; Invalidate relevant loopIndex sub-arrays if any
			Set tPathHead=$P(pPath,"(",$L(pPath,"(")-1)
			Set tHead="" For { Set tHead=$O($$$vaM("loopIndex",tHead))  Quit:""=tHead
				If tHead[tPathHead Kill $$$vaM("loopIndex",tHead)
			}
		}
	}
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="commitSegmentByIndex">
<Description>
collapse segment object into just ID; Save if necessary</Description>
<FormalSpec>pIndex:%Integer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath()
	Quit:(pIndex<1)||(pIndex>$$$vaM("runtimeIndex")) $$$ERROR($$$EnsErrGeneral,"Index "_pIndex_" is out of bounds")
	Set seg=$G($$$vaM("runtimeIndex",pIndex))
	Quit:'$$$vaIsOref(seg) $$$OK
	Set tSegObj=..%maps("orefs",pIndex)
	If tSegObj.IsMutable Set tSC=tSegObj.SaveData(..Separators) Quit:$$$ISERR(tSC) tSC
	Set newseg=tSegObj.ID_$S(""=tSegObj.DocType:"", 1:"|"_tSegObj.DocType)
	Set $$$vaM("runtimeIndex",pIndex)=newseg
	Set path=$G($$$vaM("bidirectionalLink",pIndex)) Set:""'=path $$$vaM("runtimePath",path)=newseg
	Kill ..%maps("orefs",pIndex)
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="commitSegmentByPath">
<Description>
collapse segment object into just Id; Save if necessary</Description>
<FormalSpec>pPath:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Do:'$D($$$vaM("runtimePath")) ..BuildMap(0)
	Set seg=$G($$$vaM("runtimePath",pPath))
	If seg="" Quit $$$ERROR($$$EnsErrGeneral,"No segment found at path '"_pPath_"'")
	If '$$$vaIsOref(seg) Quit $$$OK
	Set index=$E(seg,2,*)
	Set tSegObj=..%maps("orefs",index)
	If tSegObj.IsMutable Set tSC=tSegObj.SaveData(..Separators) Quit:$$$ISERR(tSC) tSC

	Set newseg=tSegObj.ID_$S(""=tSegObj.DocType:"", 1:"|"_tSegObj.DocType)
	Set $$$vaM("runtimePath",pPath)=newseg
	Kill ..%maps("orefs",index)
	Set index=$G($$$vaM("bidirectionalLink",pPath)) Set:""'=index $$$vaM("runtimeIndex",index)=newseg
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="convertRuntimePathToSchemaPath">
<FormalSpec>pPath:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tOutput=pPath
	Set f=0 For {
		Set f=$F(tOutput,"(",f) Quit:f=0
		Set g=$F(tOutput,")",f) If g=0 Set tOutput="" quit
		Set tOutput=$E(tOutput,1,f-1)_$E(tOutput,g-1,*)
		Set f=g
	}
	Quit tOutput
]]></Implementation>
</Method>

<Method name="getOrderKeyFromRuntimePath">
<Description>
Given a runtime path, this method generates the key used for collation</Description>
<FormalSpec>pRuntimePath:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	#; Parse the path to get the schema path and the subscript values
	Set tLen=$Length(pRuntimePath,"."), (tSchemaPath,tDummy)="", tRuntimeIndex=0
	For tI=1:1:tLen {
		#; Pick out each piece
		Set tPiece=$P(pRuntimePath,".",tI), tPos=1, tChar=$E(tPiece,tPos), (tID,tOrd)=""

		#; Extract the ID (including !'key field' spec if present)
		While tChar?1(1A,1N,1"!",1"=") {
			Set tID=tID_tChar, tPos=tPos+1, tChar=$E(tPiece,tPos)
		}
		#; Must have ID
		If tID="" Set tSchemaPath=""  Quit ; invalid pRuntimePath

		If tChar="-" {
			Set tID=tID_tChar, tPos=tPos+1, tChar=$E(tPiece,tPos)
			While tChar?1N {
				Set tOrd=tOrd_tChar, tPos=tPos+1, tChar=$E(tPiece,tPos)
			}
			#; Must have ordinal
			If tOrd="" Set tSchemaPath=""  Quit ; invalid pRuntimePath
			Set tID=tID_tOrd
		}
		#; If subscripted, extract the subscripts
		Set tNum="" If tChar="(" {
			Set tPos=tPos+1, tChar=$E(tPiece,tPos)
			While tChar?1N {
				Set tNum=tNum_tChar,tPos=tPos+1,tChar=$E(tPiece,tPos)
			}
			If tChar'=")" Set tSchemaPath=""  Quit ; invalid pRuntimePath
			Set tPos=tPos+1, tChar=$E(tPiece,tPos)
			
			#; Can't be any characters beyond the subscript
			If tChar'="" Set tSchemaPath=""  Quit ; invalid pRuntimePath
			
			Set tRuntimeIndex($I(tRuntimeIndex))=tNum
		}
		If tI=tLen {
			If tNum {
				Set tSchemaPath=tSchemaPath_tID_"()", tDummy=tDummy_tID_"("_tNum_")"
			} Else {
				Set tSchemaPath=tSchemaPath_tID, tDummy=tDummy_tID
			}
		} Else {
			If tNum {
				Set tSchemaPath=tSchemaPath_tID_"().", tDummy=tDummy_tID_"("_tNum_")."
			} Else {
				Set tSchemaPath=tSchemaPath_tID_".", tDummy=tDummy_tID_"."
			}
		}
	}
	#; Pick out the template if we have one
	Quit:""=tSchemaPath ""
	Set tKey=$P($G($$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"map",tSchemaPath)),"|")  Quit:""=tKey ""

	#; substitute value for corresponding * placeholder in template
	Set tPos=1 For tI=1:1:tRuntimeIndex {
		Set tPos=$F(tKey,"*",tPos) Quit:'tPos
		Set $E(tKey,tPos-1)=$$$NUM(tRuntimeIndex(tI),8)
	}
	#; If couldn't find a replacement position then path is invalid
	If tPos=0 Quit ""

	#; If the repetition subscript is not specified for repeats then subsitute default
	If $E(tKey,*)="*" {
		Set tKey=$P(tKey,"*")_$$$NUM(1,8)
	}
	#; If there are remaining unfilled substitution parameters then key is invalid
	If tKey["*" Quit ""
	Quit tKey
]]></Implementation>
</Method>

<Method name="buildRuntimeIndexFromPath">
<FormalSpec>pClearSegTypes:%Boolean=0</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	$$$ASSERT('$D($$$vaM("runtimeIndex"))&&'$D($$$vaM("bidirectionalLink")))
	Set tPath="" For { Set tPath=$O($$$vaM("runtimePath",tPath))  Quit:""=tPath
		Set tOrderKey=..getOrderKeyFromRuntimePath(tPath)  Continue:""=tOrderKey
		Set $$$vaM("OrderKeyToRuntimePath",tOrderKey)=tPath
	}
	#; Re-Order mapOrefs according to new index sequence.
	Set key="",index=0 For { Set key=$O($$$vaM("OrderKeyToRuntimePath",key),1,tPath)  Quit:key=""
		Set seg=$$$vaM("runtimePath",tPath)
		Set index=index+1
		If $$$vaIsOref(seg) {
			Set oldindex=$E(seg,2,*)
			Set tSegObj=..%maps("orefs",oldindex)
			Set:pClearSegTypes tSegObj.DocType=""
			If oldindex'=index {
				Set $$$vaM("runtimePath",tPath)="@"_index  Kill ..%maps("orefs",oldindex)
				#; Migrate ..mapOrefs if needed rather than doing it in place, because re-ordering in Path mode may have occurred after runtimeIndex map was killed
				If $D(..%maps("orefs",index)) { Set tMapOrefs(index)=tSegObj } Else { Set ..%maps("orefs",index)=tSegObj }
			}
			Set $$$vaM("runtimeIndex",index)="@"
		} Else {
			Set:pClearSegTypes seg=$P(seg,"|")
			Set $$$vaM("runtimeIndex",index)=seg
		}
		Set $$$vaM("bidirectionalLink",index)=tPath, $$$vaM("bidirectionalLink",tPath)=index
	}
	Kill $$$vaM("OrderKeyToRuntimePath")
	Merge ..%maps("orefs")=tMapOrefs
	Set $$$vaM("runtimeIndex")=index, $$$vaM("runtimeIndex",0)="" ; set a marker for negative path indices
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnConstructClone">
<FormalSpec><![CDATA[object:%RegisteredObject,deep:%Boolean=0,&cloned:%String]]></FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	$$$vaMgetIndex

#ifndef LOCALMAPS
	#; copy runtime maps from old instance
	Merge $$$vaM("runtimePath")=$$$vaMobj(object,"runtimePath")
	Merge $$$vaM("bidirectionalLink")=$$$vaMobj(object,"bidirectionalLink")
	Set tId=object.%Id()  Merge:tId $$$vaM("runtimeIndex")=$$$vaExtentGbl(tId,"segs") ; no lookthru to other guy's Id
	Merge $$$vaM("runtimeIndex")=$$$vaMobj(object,"runtimeIndex")
#endif	
	#; Clone segment objects so the clone can continue to use them without changing the original's data or properties
	Set index="" For { Set index=$O(object.%maps("orefs",index),1,tSegObj)  Quit:""=index
		Set ..%maps("orefs",index)=tSegObj.%ConstructClone()
	}
	Set i%IsMutable=1, ..ParentId="" ; mark it mutable, don't keep parent relationships
	Set i%%ClonedId=object.%ClonedId  Set:'..%ClonedId i%%ClonedId=object.%Id()  Set:'..%ClonedId i%%ClonedId=0
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnNew">
<Description>
create an object based on id=initvalue but editable</Description>
<FormalSpec>initvalue:%CacheString=""</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSegmentIds=$LG(initvalue,1), ..Separators=$LG(initvalue,2), i%Source=$LG(initvalue,3), i%ParentId=$LG(initvalue,4)
	Set:""=..Separators ..Separators=$$$EDIFACTDefSeparators
	$$$vaMgetIndex
	Set $$$vaM("runtimeIndex")=$LL(tSegmentIds), $$$vaM("runtimeIndex",0)="" ; set a marker for negative path indices
	For i=1:1:$$$vaM("runtimeIndex") { Set $$$vaM("runtimeIndex",i)=$LI(tSegmentIds,i) }
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnOpen">
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tId=..%Id()
	Set:+..ParentId'=$P(..ParentId,":") ..ParentId=$LG(..ParentId) // change from 4.0 %parentIds format
	$$$vaMgetIndex
	Set cnt=$G($$$vaExtentGbl(tId,"segs")), $$$vaM("runtimeIndex")=cnt, $$$vaM("runtimeIndex",0)="" ; set a marker for negative path indices
	If 'cnt { Set ..Separators=$$$EDIFACTDefSeparators }
	Else { Set seg1id=$$$vaExtentGbl(tId,"segs",1), ..Separators=$E($$$vaSegment(seg1id),1,4)_$G($$$vaSegmentExt(seg1id,"term")) }
	Set i%DocTypeCategory=$P(..DocType,":",1)
	Set i%DocTypeName=$P(..DocType,":",2)
	#; No automatic BuildMap here - allow cheap instantiation for portal etc; do BuildMap() only when called for
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnAddToSaveSet">
<FormalSpec>depth:%Integer=3,insert:%Integer=0,callcount:%Integer=0</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	Set ..TimeCreated = $$$timeUTC
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnAfterSave">
<FormalSpec>insert:%Boolean</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK, tId=..%Id()
	Do:'$D($$$vaM("runtimeIndex"))&&$D($$$vaM("runtimePath")) ..buildRuntimeIndexFromPath()
	Set count=+$G($$$vaM("runtimeIndex"))  For index=1:1:count { Set seg=$$$vaSegLookthru(index,..%ClonedId)
		If $$$vaIsOref(seg) {
			Set tSegObj=..%maps("orefs",index)
			Set tSC=tSegObj.SaveData(..Separators)  Quit:$$$ISERR(tSC)
			Set segid=tSegObj.ID
		} Else {
			Set segid=$P(seg,"|")
		}
		Set:segid $$$vaExtentGbl(tId,"segs",index)=segid, $$$vaSegmentRef(segid,tId)=""
	}
	For index=count+1:1:+$G($$$vaExtentGbl(tId,"segs")) { Kill $$$vaExtentGbl(tId,"segs",index) } ; Kill leftovers if we shrank
	Set $$$vaExtentGbl(tId,"segs")=count
	Set i%%ClonedId=0
	Quit tSC
]]></Implementation>
</Method>

<Method name="PokeDocType">
<CodeMode>expression</CodeMode>
<FormalSpec>pDocType:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[..DocTypeSet(pDocType,0)
]]></Implementation>
</Method>

<Method name="DocTypeSet">
<FormalSpec>pDocType:%String,pBuildMap:%Boolean=1</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:pDocType=..DocType&&$D($$$vaM("runtimePath")) $$$OK ; nothing is changed

	#; convert runtimePath to runtimeIndex and then Kill runtimePath
	Do:'$D($$$vaM("runtimeIndex"))&&$D($$$vaM("runtimePath")) ..buildRuntimeIndexFromPath(1) ; 1 = clear types
	Kill $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex")
	Set i%DocType=pDocType
	Set i%DocTypeCategory=$P(pDocType,":",1)
	Set i%DocTypeName=$P(pDocType,":",2)
	Do:pBuildMap ..BuildMap()
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="BuildMap">
<Description>
pKeepParsingAfterError means keep trying to parse after errors are encountered; returned Status will contain all errors encountered</Description>
<FormalSpec>pKeepParsingAfterError:%Boolean=1</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	If ((""=..DocTypeCategory)||(""=..DocTypeName)) {
		Set i%BuildMapStatus=$S(""=..DocType:"", 1:$$$ERROR($$$EnsEDIErrMapDocType,"EDIFACT",..DocType))
	} Else {
		Quit:$D($$$vaM("runtimePath"))&&(""'=..BuildMapStatus) ..BuildMapStatus ; already done
		Set i%BuildMapStatus=""
	}
	Do:'$D($$$vaM("runtimeIndex")) ..buildRuntimeIndexFromPath(1) ; 1 = clear types
	Kill $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex")

	Quit:""=..DocType $$$OK
	Quit:""'=..BuildMapStatus ..BuildMapStatus

	Set tSchema=$G($$$vaSchemaGbl(..DocTypeCategory,..DocTypeName))
	If tSchema="" {
		Set i%BuildMapStatus=$$$ERROR($$$EnsEDIErrMapDocType,"EDIFACT",..DocType)
		Quit ..BuildMapStatus
	}
	Set tId=..%Id()  Set:'tId tId=..%ClonedId
	Set tCurrSeg=1, %seglastmatch=0, %pathlastmatch=""
	
    //
    //
    // Change: Do not display an error that the UNA Segment in the Interchange is missing or can not be handled!!!
    //
    // Created by DL, ISC Switzerland
    //
    // Prodlog: 78179, release planned for 2010.2.
    //
    // Start of Change 
    If ("Interchange"=..Name) {
        Set tISA=..GetSegmentAt(1)
        If $IsObject(tISA) {   
            Set:"UNA"=tISA.Name tCurrSeg=2
        }
    }
    // End of Change
	
	Set tSC=..buildRuntimePathFromIndex(tId,"",$Name($$$vaSchemaGbl)_"("""_..DocTypeCategory_""","""_..DocTypeName_""",""array"")","top",.tCurrSeg,0,"|",$$$OK,pKeepParsingAfterError)
	$$$ASSERT(%seglastmatch=(tCurrSeg-1))
	#; Map leftover segments
	Set tSegments=$$$vaM("runtimeIndex")
	If tCurrSeg<=tSegments {
		For i=tCurrSeg:1:tSegments {
			Set $$$vaM("runtimePath","leftoversegs("_(i+1-tCurrSeg)_")")=i
		}
		If pKeepParsingAfterError||$$$ISOK(tSC) {
			#; Find current Segment's Type Name
			Set seg=$$$vaSegLookthru(tCurrSeg,tId)
			If $$$vaIsOref(seg) {
				Set tSegObj=..%maps("orefs",tCurrSeg)
				Set currsegname=tSegObj.Name
			} Else {
				Set segid=$P(seg,"|"), data=$G($$$vaSegment(segid))
				Set currsegname=$$$vaDataSegName(data)
			}
			If tCurrSeg=1 { Set lastname="" }
			Else {
				#; Find previous Segment's Type Name
				Set seg=$$$vaSegLookthru(tCurrSeg-1,tId)
				If $$$vaIsOref(seg) {
					Set tSegObj=..%maps("orefs",tCurrSeg-1)
					Set lastname=tSegObj.Name
				} Else {
					Set segid=$P(seg,"|"), data=$G($$$vaSegment(segid))
					Set lastname=$$$vaDataSegName(data)
				}
			}
			Set lastmatch=$S(""'=lastname&&%seglastmatch:%seglastmatch_" ("_%pathlastmatch_")", 1:"0")
			Set tSC=$$$ADDSC(tSC,$$$ERROR($$$EnsEDIErrMapSegUnrecog,currsegname,lastmatch))
		}
	}
	Kill %seglastmatch, %pathlastmatch
	Set i%BuildMapStatus=tSC
	Quit tSC
]]></Implementation>
</Method>

<Method name="buildRuntimePathFromIndex">
<Description><![CDATA[
Build a segment map for the current segment index array based on the document schema<br>
If <var>pKeepParsingAfterError</var> is false then stop parsing when first error is encountered<br>]]></Description>
<FormalSpec><![CDATA[pId:%String,pPath:%String,pContentArray:%String,pType:%String,&pCurrSeg:%Integer,pParentGrpOpt:%Boolean,pLoopNames:%String,pSC:%Status,pKeepParsingAfterError:%Boolean]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSegments=$$$vaM("runtimeIndex"), currsegname=""
	Set type=$P(pType,"(",1,$L(pType,"(")), len=$L(type), tIsUnion="union"=$E(type,len+1-$L("union"),len)
	Set tGrpOpt=(pParentGrpOpt||$G(@pContentArray@("opt"),0)), tFirstReq="", tGrpSeg=pCurrSeg
	For i=1:1:$G(@pContentArray) { ; loop over sub-elements of the root element at this level
		Set pIContents=$Name(@pContentArray@(i))
		Set opt=$G(@pIContents@("opt"),0), tFirstReq=$S(""=tFirstReq&&'opt:1, ""=tFirstReq:"", 1:0)
		Set type=@pIContents@("type")
		Set segtype=$P(type,":",4)
		Set isrep=$P(segtype,"(",2), tMaxReps=$Case(isrep, ")":0, "":1, :+isrep), isrep=(""'=isrep), tRequiredReps='opt
		Set segtype=$P($P(segtype,"("),"-") ; strip off ordinal and parens
		Set keyfields=$P(segtype,"!",2), segtype=$P(segtype,"!") ; split off key fields indicator
		Set segname=$P(@pIContents@("name"),"(")
		Set subs=$G(@pIContents,0)
		Set tISeg=pCurrSeg
		For rep=1:1 { Quit:rep>tMaxReps&&tMaxReps ; loop for repetitions of the current sub-element
			Set tBaseSeg=pCurrSeg
			Set tIPath=$S(""=pPath:"",1:pPath_".")_segname_$S(isrep:"("_rep_")",1:"")
			#;If isrep&&(rep=1)&&(i=1)&&opt Set pSC=$$$ADDSC(pSC,$$$ERROR($$$EnsEDIErrMapGeneral,"Schema error at "_tIPath_" - the first element in a repeating group must not be optional"))  Quit

			If subs {
				Set pSC=..buildRuntimePathFromIndex(pId,tIPath,pIContents,type,.pCurrSeg,tGrpOpt||(rep>tRequiredReps),pLoopNames,pSC,pKeepParsingAfterError)
			} Else {
				#; Find current Segment's Type Name
				If pCurrSeg>tSegments {
					Set currsegname=""
				} Else {
					Set seg=$$$vaSegLookthru(pCurrSeg,pId)
					If $$$vaIsOref(seg) {
						Set tSegObj=..%maps("orefs",pCurrSeg)
						Set data=$E(tSegObj.Separators,1,4)_tSegObj.GetValueAt()
					} Else {
						Set segid=$P(seg,"|"), data=$G($$$vaSegment(segid))
					}
					Set currsegname=$$$vaDataSegName(data)
					Set pLoopNames=$Case(currsegname,
						"LS":pLoopNames_$$$SEGELEM(data,1)_"|", ; add the Loop name
						"LE":$P(pLoopNames,"|",1,$L(pLoopNames,"|")-2)_"|", ; subtract the Loop name ; // check if valid
						 :pLoopNames)
				}
				#; Check for segment type match
				If segtype=currsegname &&(""=keyfields
				 || $$keyfieldsMatch(keyfields,data)) {	
					#; Set seg address/schema at path into runtimePath
					Set schema=$P($P(type,":",2,4),"(")
					Set seg=$$$vaSegLookthru(pCurrSeg,pId)
					If $$$vaIsOref(seg) {
						Set $$$vaM("runtimePath",tIPath)="@"_pCurrSeg
						Set ..%maps("orefs",pCurrSeg).DocType=schema
					} Else {
						Set seg=$P(seg,"|")_"|"_schema
						Set $$$vaM("runtimeIndex",pCurrSeg)=seg
						Set $$$vaM("runtimePath",tIPath)=seg
					}
					Set $$$vaM("bidirectionalLink",pCurrSeg)=tIPath, $$$vaM("bidirectionalLink",tIPath)=pCurrSeg

					Set %seglastmatch=pCurrSeg, %pathlastmatch=tIPath
					Set:pCurrSeg<=tSegments pCurrSeg=pCurrSeg+1, currsegname=""
				}
			}
			If tBaseSeg=pCurrSeg { ; found no match in repeat loop
				Set:rep<tRequiredReps&&'tIsUnion&&'tGrpOpt pSC=$$$ADDSC(pSC,$$$ERROR($$$EnsEDIErrMapSegCount,tRequiredReps,tIPath,pCurrSeg_$S(""=$G(currsegname):"",1:" ("_currsegname_")")))
				Quit
			} Else {
				Set tGrpOpt=0
				Quit:pCurrSeg>tSegments
			}
		}
		Quit:$$$ISERR(pSC)&&'pKeepParsingAfterError
		If tISeg=pCurrSeg { ; found no match at element i
			If 'opt&&'tIsUnion {
				Quit:i=1
				Set:'tGrpOpt pSC=$$$ADDSC(pSC,$$$ERROR($$$EnsEDIErrMapRequired,tIPath,pCurrSeg_$S(""=$G(currsegname):"",1:" ("_currsegname_")")))
				Quit:tFirstReq||'pKeepParsingAfterError
			}
		} Else {
			Set tGrpOpt=0
			Quit:tIsUnion
		}
	}
	If tIsUnion {
		If tGrpSeg=pCurrSeg { ; found no match in any union element
			Set:'tGrpOpt pSC=$$$ADDSC(pSC,$$$ERROR($$$EnsEDIErrMapRequiredUnion,pPath,pCurrSeg_$S(""=$G(currsegname):"",1:" ("_currsegname_")")))
		}
	}
	Quit pSC
keyfieldsMatch(pKeyFields,pData) ; local routine that returns true if all keyfields match the data
	Set tMatch=1, nFlds=$L(pKeyFields,"&") For iFld=1:1:nFlds { Set tKey=$P(pKeyFields,"&",iFld)  Continue:""=tKey
		Set tFld=$P(tKey,"="), tVal=$P(tKey,"=",2)
		If ""=tVal||'tFld||(tVal'=$$$SEGELEM(pData,tFld)) Set tMatch=0  Quit
	}
	Quit tMatch
]]></Implementation>
</Method>

<Method name="DumpMaps">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set DocType=..DocType w ! zw DocType
	w !,"DocTypeCategory,DocTypeName="_..DocTypeCategory_","_..DocTypeName
	Set BuildMapStatus=..BuildMapStatus w ! zw BuildMapStatus
	If ""'=..DocTypeCategory&&(""'=..DocTypeName) {
		Merge mapSchemaPath=$$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"map") w ! zw mapSchemaPath
		Merge mapContentArray=$$$vaSchemaGbl(..DocTypeCategory,..DocTypeName,"array") w ! zw mapContentArray
	}
	Merge mapRuntimeIndex=$$$vaM("runtimeIndex") w ! zw mapRuntimeIndex
	Merge mapRuntimePath=$$$vaM("runtimePath") w ! zw mapRuntimePath
	Merge mapBidirectionalLink=$$$vaM("bidirectionalLink") w ! zw mapBidirectionalLink
	Merge mapLoopIndex=$$$vaM("loopIndex") w ! zw mapLoopIndex
 	Merge mapOrefs=..%maps("orefs") w ! zw mapOrefs
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="GetContentArray">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec>*pContents,pMode:%String,pDocType:%String,pLevel:%Integer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).GetContentArray(.pContents,.pMode,.pDocType,.pLevel)
]]></Implementation>
</Method>

<Query name="EnumerateDocTypes">
<Description><![CDATA[
Returns a list of available DocTypes for this document class.<br>
The DocType is returned as the first column in the result set.<br>
The Category parameter can be used to restrict the list.<br>
If Category is:
 0 - return only DocTypes in standard categories
 + - return only DocTypes in user-defined categories
 empty - return DocTypes from all categories
 a category name - return only DocTypes in the named category
 a partial name suffixed with '%' - return only DocTypes in categories matching the partial category name
 other - return nothing]]></Description>
<Type>%Query</Type>
<FormalSpec>Category:%String=""</FormalSpec>
<Parameter name="CONTAINID" value="0"/>
<Parameter name="ROWSPEC" value="Type:%String"/>
</Query>

<Method name="EnumerateDocTypesExecute">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary,Category:%String=""]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).DocStructuresExecute(.qHandle, Category, "EDIFACT")
]]></Implementation>
</Method>

<Method name="EnumerateDocTypesFetch">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&qHandle:%Binary,&Row:%List,&AtEnd:%Integer=0]]></FormalSpec>
<PlaceAfter>EnumerateDocTypesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=##class(EnsLib.EDI.SEF.Schema).DocStructuresFetch(.qHandle,.Row,.AtEnd)
	Set:""'=$G(Row) Row=$LB($LG(Row))
	Quit tSC
]]></Implementation>
</Method>

<Method name="EnumerateDocTypesClose">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary]]></FormalSpec>
<PlaceAfter>EnumerateDocTypesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).DocStructuresClose(.qHandle)
]]></Implementation>
</Method>

<Query name="EnumerateTypeCategories">
<Description><![CDATA[
Returns a list of document type schema categories for the document class.<br>
The Standard parameter can be used to restrict the list.<br>
If Standard is:
 0 - return only standard categories
 + - return only user-defined categories
 empty - return all categories
 a category name - return only the named category
 a partial name suffixed with '%' - return only categories matching the partial category name
 other - return nothing]]></Description>
<Type>%Query</Type>
<FormalSpec>Standard:%String=""</FormalSpec>
<Parameter name="CONTAINID" value="0"/>
<Parameter name="ROWSPEC" value="Category:%String,Description:%String,IsStandard:%Boolean"/>
</Query>

<Method name="EnumerateTypeCategoriesExecute">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary,Standard:%String=""]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).TypeCategoriesExecute(.qHandle, Standard, "EDIFACT")
]]></Implementation>
</Method>

<Method name="EnumerateTypeCategoriesFetch">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&qHandle:%Binary,&Row:%List,&AtEnd:%Integer=0]]></FormalSpec>
<PlaceAfter>EnumerateTypeCategoriesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=##class(EnsLib.EDI.SEF.Schema).TypeCategoriesFetch(.qHandle,.Row,.AtEnd)
	Quit tSC
]]></Implementation>
</Method>

<Method name="EnumerateTypeCategoriesClose">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary]]></FormalSpec>
<PlaceAfter>EnumerateTypeCategoriesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).TypeCategoriesClose(.qHandle)
]]></Implementation>
</Method>

<Query name="EnumerateSegTypes">
<Description><![CDATA[
Returns a list of schema categories and segment types and segment fields for the document class.<br>
The Standard and Level parameters can be used to restrict the list.<br>
If Standard is:
 0 - return only standard categories
 + - return only user-defined categories
 empty - return all categories
 a category name - return only SegTypes in the named category
 a category name:segment type name - return only information about the named SegType
 a partial name suffixed with '%' - return only SegTypes in categories matching the partial category name
 other - return nothing
If Level is:
 0 - return all segment names
 n - return the given number of levels of nested field names within each segment
 empty - return all levels of nested field names within each segment]]></Description>
<Type>%Query</Type>
<FormalSpec>Standard:%String="",Level:%String=""</FormalSpec>
<Parameter name="CONTAINID" value="0"/>
<Parameter name="ROWSPEC" value="SegType:%String,Field:%String,Description:%String,IsStandard:%Boolean"/>
</Query>

<Method name="EnumerateSegTypesExecute">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary,Standard:%String="",Level:%String=""]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).SegTypesExecute(.qHandle, Standard, Level, "EDIFACT")
]]></Implementation>
</Method>

<Method name="EnumerateSegTypesFetch">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&qHandle:%Binary,&Row:%List,&AtEnd:%Integer=0]]></FormalSpec>
<PlaceAfter>EnumerateSegTypesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=##class(EnsLib.EDI.SEF.Schema).SegTypesFetch(.qHandle,.Row,.AtEnd)
	Quit tSC
]]></Implementation>
</Method>

<Method name="EnumerateSegTypesClose">
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec><![CDATA[&qHandle:%Binary]]></FormalSpec>
<PlaceAfter>EnumerateSegTypesExecute</PlaceAfter>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).SegTypesClose(.qHandle)
]]></Implementation>
</Method>

<Method name="GetAlias">
<Description>
This method computes the Alias string for a property name, given the property's node in the Content Array.</Description>
<ClassMethod>1</ClassMethod>
<CodeMode>expression</CodeMode>
<FormalSpec>pContentArrayName:%String,pArrayPos:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[##class(EnsLib.EDI.SEF.Schema).GetAlias(pContentArrayName,pArrayPos)
]]></Implementation>
</Method>

<Method name="checkDocType">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&pDocType:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK
	Set category=$P(pDocType,":",1)
	Set secondary=$P(pDocType,":",2)
	If (""=category)||(""=secondary)||(""=$G($$$vaSchemaGbl(category,secondary))) {
		Set tSC=$$$ERROR($$$EnsEDIErrMapDocType,"EDIFACT",pDocType)
	}
	Quit tSC
]]></Implementation>
</Method>

<Method name="getSegsAsString">
<Description>
This method is for use from the RawContent property's SQL Compute invocation</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>pId:%String,pMaxLen:%Integer=10000,pStartOffset:%Integer=1</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	#; Use delimiters from first segment, translate all subsequent delims to those
	Set str=""  For index=1:1:+$G($$$vaExtentGbl(pId,"segs")) { Set segid=$$$vaExtentGbl(pId,"segs",index), data=$$$vaSegment(segid)
		If index=1 {
			Set tSeparators=$E(data,1,4)
			Set tSegTerminator=$G($$$vaSegmentExt($$$vaExtentGbl(pId,"segs",index),"term"),$$$EDIFACTDefSegTerminator)
		}
		Set:tSeparators'=$E(data,1,4) data=##class(EnsLib.EDI.EDIFACT.Segment).replaceSeparators(data, tSeparators)
		If pStartOffset>1 {
			If pStartOffset>($L(data)-4+$L(tSegTerminator)) { Set pStartOffset=pStartOffset-($L(data)-4+$L(tSegTerminator))  Continue }
			Else { Set pStartOffset=1, data=$E(data,pStartOffset,*) }
		}
		If pMaxLen-$L(str)>=($L(data)-4+$L(tSegTerminator)) { Set str=str_$E(data,4,*)_tSegTerminator }
		Else { Set str=str_$E(data_tSegTerminator,5,4+pMaxLen-$L(str)) }
		Quit:$L(str)>=pMaxLen
	}
	Quit str
]]></Implementation>
</Method>

<Method name="OutputToFile">
<FormalSpec>pFilename:%String,pOverwrite:%Boolean,pSeparators:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=##Class(%IO.FileStream).%New()
	Do tIOStream.Open(pFilename,$S($G(pOverwrite):"NEW",1:"AEW"),5,,.tSC)  Quit:$$$ISERR(tSC) tSC
	Quit ..OutputToIOStream(tIOStream, .pSeparators)
]]></Implementation>
</Method>

<Method name="OutputToDevice">
<FormalSpec>pSeparators:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tDeviceStream=##class(%IO.DeviceStream).AttachNew(,.tSC)  Quit:$$$ISERR(tSC) tSC
	Quit ..OutputToIOStream(tDeviceStream, .pSeparators)
]]></Implementation>
</Method>

<Method name="OutputToLibraryStream">
<FormalSpec>pLibStream:%Stream.Object,pSeparators:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=$S(pLibStream.%Extends("%IO.I.CharacterStream"):pLibStream, 1:##Class(%IO.MetaCharacterStream).%New(pLibStream))
	Quit ..OutputToIOStream(tIOStream, .pSeparators)
]]></Implementation>
</Method>

<Method name="OutputToString">
<FormalSpec>pSeparators:%String,*pStatus:%Status</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=##Class(%IO.StringStream).%New()
	Set pStatus = ..OutputToIOStream(tIOStream, .pSeparators)
	Do tIOStream.Rewind()
	Quit tIOStream.Read()
]]></Implementation>
</Method>

<Method name="OutputToIOStream">
<FormalSpec>pIOStream:%IO.I.CharacterStream,pSeparators:%String,pFlush:%Boolean=1</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK
	Set tSeparators=$S(""=$G(pSeparators):..Separators, 1:pSeparators)  Set:""=tSeparators tSeparators=$$$EDIFACTDefSeparators Set:""=$$$SEGTERM(tSeparators) tSeparators=tSeparators_..SegmentTerminator
	Do:'$D($$$vaM("runtimeIndex"))&&$D($$$vaM("runtimePath")) ..buildRuntimeIndexFromPath()
	For i=1:1:$G($$$vaM("runtimeIndex")) { Set tSeg=..getSegmentByIndex(i)
		If 'tSeg.IsChildHolder(.tRef) { Set tSC=tSeg.OutputToIOStream(pIOStream, tSeparators) }
		Else {
			Set tChild=$$$NULLOREF For { Set tChild=..NextChild(tChild,tRef)  Quit:tChild=$$$NULLOREF
				Set tSC=tChild.OutputToIOStream(pIOStream, tSeparators)  Quit:$$$ISERR(tSC)
			}
		}
		Do ..commitSegmentByIndex(i)
	}
	If pFlush Do pIOStream.Flush(.tSC1)  Set:$$$ISOK(tSC) tSC=tSC1
	Quit tSC
]]></Implementation>
</Method>

<Method name="FullSizeGet">
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	Do:'$D($$$vaM("runtimeIndex"))&&$D($$$vaM("runtimePath")) ..buildRuntimeIndexFromPath()
	Set tLen=0 For i=1:1:$G($$$vaM("runtimeIndex")) { Set tSeg=..getSegmentByIndex(i)
		If 'tSeg.IsChildHolder(.tRef) { Set tLen=tLen+tSeg.FullSize+1 }
	}
	Quit tLen
]]></Implementation>
</Method>

<Method name="GetFullSize">
<ClassMethod>1</ClassMethod>
<FormalSpec>pMsgId</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	Set tLen=0 For i=1:1:$$$vaExtentGbl(pMsgId,"segs") {
		#; Add segment size: - 5 separators + 1 terminator
		Set segid=$$$vaExtentGbl(pMsgId,"segs",i), tLen = tLen + $L($$$vaSegment(segid)) - 4
		#; Get extra from any segs > 32k
		For j=1:1 { Set segid=$$$vaExtentGbl(pMsgId,"segs",i)  Quit:'$D($$$vaSegmentExt(segid,j),extra)
			w i,".",j,".",$L(extra),!
			Set tLen = tLen + $L(extra)
		}
	}
	Quit tLen
]]></Implementation>
</Method>

<Method name="ImportFromFile">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[pFilename:%String,pDocNum:%Integer=1,*pStatus:%Status,&pConfigItem:%String]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=##Class(%IO.FileStream).%New()
	Do tIOStream.Open(pFilename,,5,,.pStatus)  Quit:$$$ISERR(pStatus) $$$NULLOREF
	$$$sysTRACE("Opened file '"_pFilename_"'")
	Set tDoc=$$$NULLOREF  For i=1:1:pDocNum {
		If tIOStream.AtEnd Set pStatus=$$$ERROR($$$EnsErrGeneral,"Fewer than "_pDocNum_" documents in file "_pFilename)  Quit
		Set tDoc=..ImportFromIOStream(tIOStream,.pStatus,.pConfigItem)  Quit:$$$ISERR(pStatus)
	}
	Quit:$$$ISERR(pStatus) $$$NULLOREF
	Quit tDoc
]]></Implementation>
</Method>

<Method name="ImportFromDevice">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[*pStatus:%Status,&pConfigItem:%String]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	Set tDeviceStream=##class(%IO.DeviceStream).AttachNew(,.tSC)  Quit:$$$ISERR(tSC) tSC
	Quit ..ImportFromIOStream(tDeviceStream,.pStatus,.pConfigItem)
]]></Implementation>
</Method>

<Method name="ImportFromLibraryStream">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[pLibStream:%Stream.Object,*pStatus:%Status,&pConfigItem:%String]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=$S(pLibStream.%Extends("%IO.I.CharacterStream"):pLibStream,1:##Class(%IO.MetaCharacterStream).%New(pLibStream))
	Quit ..ImportFromIOStream(tIOStream,.pStatus,.pConfigItem)
]]></Implementation>
</Method>

<Method name="ImportFromString">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[pString:%String,*pStatus:%Status,&pConfigItem:%String]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	Set tIOStream=##Class(%IO.StringStream).%New(pString)
	Quit ..ImportFromIOStream(tIOStream,.pStatus,.pConfigItem)
]]></Implementation>
</Method>

<Method name="ImportFromIOStream">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[pIOStream:%IO.I.CharacterStream,*pStatus:%Status=$$$OK,&pConfigItem:%String=""]]></FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	If ""'=pConfigItem {
		If $IsObject(pConfigItem) {
			Set tInst=pConfigItem
		} Else {
			Set tInst=##class(Ens.Host).GetShadowInstance(pConfigItem,.pStatus)  Quit:$$$ISERR(pStatus) $$$NULLOREF
		}
		If 'tInst.%Extends("EnsLib.EDI.EDIFACT.Service.Standard") Set pStatus=$$$ERROR($$$EnsErrGeneral,"Config Item class "_tInst.%ClassName(1)_" found For "_pConfigItem_" is not not an EDI document Service")  Quit $$$NULLOREF
	} Else {
		Set tInst=##class(Ens.Host).GetShadowInstance("class ||EnsLib.EDI.EDIFACT.Service.FileService",.pStatus)  Quit:$$$ISERR(pStatus) $$$NULLOREF
	}
	#; Get a new parser based on a Service; OnInit not called for shadow service instances
	Set tInst.%ForwardBatchWhole=2 ; don't save&purge intermediate TransactionSet objects, leave them all in memory in the Document
	If '$IsObject(tInst.%Parser) Set tInst.%Parser=##class(EnsLib.EDI.EDIFACT.Parser).%New(tInst)  $$$ASSERT($IsObject(tInst.%Parser))
	Set:tInst.TolerateNewlines tInst.%Parser.Whitespace=$C(13,10)
	Set:""=tInst.ReplyMode tInst.ReplyMode="Never"

	If tInst'=pConfigItem { ; override some default properties if we created the shadow instance
		Set tInst.SearchTableClass=""
	}
	#; call the parser
	Set pStatus=tInst.%Parser.ParseIOStream(pIOStream,.tDoc)
	Set pConfigItem=tInst ; allow repeated calls on the same parser
	Quit tDoc
]]></Implementation>
</Method>

<Method name="OutputHTML">
<Description>
Display Segments as HTML, using DocType info if available</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK
	Set tSeparators=..Separators  Set:""=tSeparators tSeparators=$$$EDIFACTDefSeparators Set:""=$$$SEGTERM(tSeparators) tSeparators=tSeparators_..SegmentTerminator  Set $$$SEGTERM(tSeparators)=$ZStrip($$$SEGTERM(tSeparators),"*CW")
	&html<
	<table border="0" cellspacing="0" cellpadding="0" cols="2" width="100%"><tr><td align="center"><div class="Text" style="margin: 3px;">>
	If ""'=..DocType {
		Do:""=..BuildMapStatus||'$D($$$vaM("runtimePath")) ..BuildMap()
		Set tDesc=##class(EnsLib.EDI.SEF.Schema).GetDescription("DS:"_..DocType)
		&html<EDIFACT <b>#($ZCVT(..Name,"O","HTML"))#</b> document - Id = <b>#(..%Id())#</b>, DocType = '<a#($S(""=tDesc:"",1:" title='"_$ZCVT(tDesc,"O","HTML")_"'")_..getLink(..DocType))#><b>#($ZCVT(..DocType,"O","HTML"))#</b></a>'
			<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#($S(""=tDesc:"", 1:"'<b><i>"_$ZCVT(tDesc,"O","HTML")_"</i></b>', "))#<b>#(..SegCount)#</b> Segments#(..linkParents())#>
		If $$$ISERR(..BuildMapStatus) {
			Set tErr=$ZCVT($$GetOneErrorText^%apiOBJ(..BuildMapStatus),"O","HTML")
			&html<<br>&nbsp;&nbsp;&nbsp;BuildMapStatus = '<b>#(tErr)#</b>'>
			For i=2:1 { Set tErr=$$GetOneErrorText^%apiOBJ(..BuildMapStatus,i)  Quit:""=tErr
				&html<<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'#($ZCVT(tErr,"O","HTML"))#'>
			}
		}
	} Else {
		&html<EDIFACT <b>#($ZCVT(..Name,"O","HTML"))#</b> document - Id = <b>#(..%Id())#</b>, DocType = <b>''</b>, <b>#(..SegCount)#</b> Segments#(..linkParents())#>
	}
	&html<</div></td></tr></table>>
	Do:'$D($$$vaM("runtimeIndex"))&&$D($$$vaM("runtimePath")) ..buildRuntimeIndexFromPath()
	Set tCnt=$G($$$vaM("runtimeIndex"))
	If tCnt<=0 { &html<<center>No Segments</center>> }
	Else {
		&html<<table class="EDIDocumentTable" BORDER="0" CELLSPACING="0" CELLPADDING="0">>
		For i=1:1:tCnt {
			If i>300&&(i<=(tCnt-100)) {
				If i=301 { &html<<TR CLASS="EDIDocumentTableRow"><TD CLASS="EDIDocumentTableExpandor">&nbsp;</TD>>
							&html<<td class='EDIDocumentTableSegnum'>...&nbsp;</td><td class='EDIDocumentTableSegid' SegID='...'> </td>>
							&html<<td class='EDIDocumentTableSegname'>&nbsp;</td>>
							&html<<td>Segments 301 to #(tCnt-100)# not shown ...</td></TR>> }
				Continue
			}
			Set tPath=$G($$$vaM("bidirectionalLink",i),i)
			Set seg=..getSegmentByIndex(i)
			&html<<TR CLASS="EDIDocumentTableRow"><TD CLASS="EDIDocumentTableExpandor">&nbsp;</TD>>
			Set tSC=seg.outputHTMLSeg(tSeparators,i,tPath,$this) Quit:$$$ISERR(tSC)
			&html<</TR>>
			Do ..commitSegmentByIndex(i)
		}
		&html<</table>>
	}
	Write:$$$ISERR(tSC) $ZCVT($$$StatusDisplayString(tSC),"O","HTML")
	Quit tSC
]]></Implementation>
</Method>

<Method name="linkParents">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set tOutStr=""
	Set tChildCount=..ChildCount
	Set:tChildCount tOutStr=tOutStr_", <b>"_tChildCount_"</b> "_$S(tChildCount>1:"child documents", 1:"child document")
	Set tNumParents=$LL(..ParentIds)
	If tNumParents {
		Set tOutStr=tOutStr_", "_$S(tNumParents>1:"parent documents ", 1:"parent document ")
		Set tParent=..Parent
		While $IsObject(tParent) {
			Set tOutStr=tOutStr_": <a target='_blank' title='EDIFACT Document Database Id = "_tParent.%Id()_"', Type Name = '"_tParent.Name_"' method=get href="_##class(%CSP.Page).Link("EDIDocumentView.csp?CLASS="_tParent.%ClassName(1)_"&NAME="_$ZCVT("EDIFACT Document","O","URL")_"&ORIGIN=EDIDoc&EDIDOCID="_tParent.%Id()_"&DOCSPEC=Stored#doc_content")_">&lt;"_tParent.%Id()_"&gt;</a>"
			Set tParent=tParent.Parent
		}
	}
	Quit tOutStr
]]></Implementation>
</Method>

<Method name="getLink">
<ClassMethod>1</ClassMethod>
<FormalSpec>pDocType</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Quit:""=pDocType||'##class(EnsLib.EDI.SEF.Schema).ElementExists("DS:"_pDocType) ""
	Quit " href='"_##class(%CSP.Page).Link("EnsLib.EDI.SEF.HTMLViewer.cls?DocType="_pDocType)_"' target='_blank'"
]]></Implementation>
</Method>

<Method name="CopyValues">
<FormalSpec>pSource:EnsLib.EDI.EDIFACT.Document,pSourcePath:%String,pTargetPath:%String,pAction:%String,pKey:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tSourceWild=$F(pSourcePath,"()"), tTargetWild=$F(pTargetPath,"()")
	If tSourceWild||tTargetWild {
		Set tSourceHead=$E(pSourcePath,1,tSourceWild-3), tSourceTail=$E(pSourcePath,tSourceWild,*)
		Set tTargetHead=$E(pTargetPath,1,tTargetWild-3), tTargetTail=$E(pTargetPath,tTargetWild,*)
		If tSourceWild {
			Set i="" For { Set i=pSource.GetNextIndex(tSourceHead_"()",i,.tSC) Quit:i=""
				Set tSourceNewPath=tSourceHead_"("_(i)_")"_tSourceTail
				Set tTargetNewPath=$S(tTargetWild:tTargetHead_"("_(i)_")"_tTargetTail,1:pTargetPath)
				Set tSC=..CopyValues(pSource,tSourceNewPath,tTargetNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
			}
		} Else {
			Set i="" For { Set i=..GetNextIndex(tTargetHead_"()",i,.tSC) Quit:i=""
				Set tTargetNewPath=tTargetHead_"("_(i)_")"_tTargetTail
				Set tSC=..CopyValues(pSource,pSourcePath,tTargetNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
			}
		}
	} Else {
		Set tSourceGrpPath=$P(pSourcePath,":"), tSourcePropPath=$P(pSourcePath,":",2)
		Set tTargetGrpPath=$P(pTargetPath,":"), tTargetPropPath=$P(pTargetPath,":",2)
		Set tSrcSegPath=pSource.GetNextGroupPath(tSourceGrpPath,tSourceGrpPath)
		Set tTrgSegPath=..GetNextGroupPath(tTargetGrpPath,tTargetGrpPath)
		If (""'=tSrcSegPath)||(""'=tTrgSegPath) { ; if there are group sub-elements
			If (""'=tSrcSegPath) {
				For {
					Set tSourceNewPath=tSrcSegPath_$S(""=tSourcePropPath:"",1:":"_tSourcePropPath)
					Set tTargetNewPath=tTargetGrpPath_$E(tSrcSegPath,1+$L(tSourceGrpPath),$L(tSrcSegPath))_$S(""=tSourcePropPath:"",1:":"_tSourcePropPath)
					Set tSC=..CopyValues(pSource,tSourceNewPath,tTargetNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
					Set tSrcSegPath=pSource.GetNextGroupPath(tSourceGrpPath,tSrcSegPath,.tSC) Quit:$$$ISERR(tSC)
					Quit:""=tSrcSegPath
				}
			} Else {
				For {
					Set tTargetNewPath=tTrgSegPath_$S(""=tTargetPropPath:"",1:":"_tTargetPropPath)
					Set tSC=..CopyValues(pSource,pSourcePath,tTargetNewPath,pAction,pKey) Quit:$$$ISERR(tSC)
					Set tTrgSegPath=..GetNextGroupPath(tTargetGrpPath,tTrgSegPath,.tSC) Quit:$$$ISERR(tSC)
					Quit:""=tTrgSegPath
				}
			}
		} Else {
			If ""'=tSourcePropPath {
				Set tSC=..SetValueAt(pSource.GetValueAt(pSourcePath),pTargetPath,pAction,pKey)
			} Else { ; create clone segment object for id or oref
				Set tId=pSource.GetSegmentIdAt(pSourcePath,.tSC)  Quit:$$$ISERR(tSC) tSC
				If tId'="" {
					Set tSegObj=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB(tId,1,"",1))
					Set:$IsObject(tSegObj) tSC=..SetSegmentAt(tSegObj,pTargetPath)
				} Else {
					Set tSegObj=pSource.GetSegmentAt(pSourcePath,.tSC)  Quit:$$$ISERR(tSC) tSC
					Set:$IsObject(tSegObj) tSC=..SetSegmentAt(tSegObj.%ConstructClone(),pTargetPath)
				}
			}
		}
	}
	Quit tSC
]]></Implementation>
</Method>

<Method name="Purge">
<ClassMethod>1</ClassMethod>
<FormalSpec>*pDeletedCount:%Integer,pDaysToKeep:%Integer=7,pDummy:%Boolean=0</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	If 0=pDaysToKeep Do ..KillGlobals(.pDeletedCount,1,0)  Quit $$$OK

	New %tDoNotDeleteDate,%tID,%tTime  Set %tDoNotDeleteDate = $$$timeUTCHtoUTC($s($ztimezone'<0:($H-pDaysToKeep+1)_","_($ztimezone*60),1:($H-pDaysToKeep)_","_($ztimezone*60+86400)))
	Set SQLCODE=0, pDeletedCount=0
	&sql(Declare C1 Cursor for
		Select ID,TimeCreated Into :%tID,:%tTime From EnsLib_EDI_EDIFACT.Document Order By ID)
	&sql(OPEN C1) For { &sql(FETCH C1)  Quit:SQLCODE
		If $$$timeCmp(%tTime,%tDoNotDeleteDate)<0 {
			&sql(Delete From EnsLib_EDI_EDIFACT.Document Where ID=:%tID)
			Set pDeletedCount=pDeletedCount+%ROWCOUNT
		}
	} Set tCode=SQLCODE &sql(CLOSE C1) Set:'SQLCODE SQLCODE=tCode
	Quit:SQLCODE&&(SQLCODE'=100) $$$ERROR($$$EnsErrGeneral,"Purge error at ID "_%tID_"; SQLCODE = "_SQLCODE)
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnDelete">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	New %tID  Set %tID=$$$oidPrimary(oid)
	Do ##class(EnsLib.EDI.EDIFACT.SearchTable).RemoveIndex(%tID,%tID,1)
	For index=1:1:+$G($$$vaExtentGbl(%tID,"segs")) Set segid=$$$vaExtentGbl(%tID,"segs",index) Kill $$$vaSegmentRef(segid,%tID) If '$D($$$vaSegmentRefs(segid)) Kill $$$vaSegment(segid)
	&sql(Delete From EnsLib_EDI_EDIFACT.Document Where OriginalDocId=:%tID)
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="OnDelete">
<Code><![CDATA[	New %tID,index,segid  Set %tID={%%ID}
	Do ##class(EnsLib.EDI.EDIFACT.SearchTable).RemoveIndex(%tID,%tID,1)
	For index=1:1:+$G($$$vaExtentGbl(%tID,"segs")) Set segid=$$$vaExtentGbl(%tID,"segs",index) Kill $$$vaSegmentRef(segid,%tID) If '$D($$$vaSegmentRefs(segid)) Kill $$$vaSegment(segid)
	&sql(Delete From EnsLib_EDI_EDIFACT.Document Where OriginalDocId=:%tID)
	Quit]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="KillGlobals">
<ClassMethod>1</ClassMethod>
<FormalSpec>*pDeletedCount,pKeepExtentCount=0,pDisplayLog=1</FormalSpec>
<Implementation><![CDATA[
	Set pDeletedCount=..TotalCount()
	Set tExtentCount=$G($$$vaExtentGbl)
	Write:pDisplayLog !,"Killing ",..%ClassName(1)," extent ("_pDeletedCount_"/"_tExtentCount_")"
	Do ..%KillExtent()
	Set:pKeepExtentCount $$$vaExtentGbl=tExtentCount

	Do ##class(EnsLib.EDI.EDIFACT.SearchTable).%KillExtent()

	Set globals($Name($$$vaSegmentGbl))=""

	Set global="" For { Set global=$O(globals(global))  Quit:""=global
		Kill tExtentCount  Set:pKeepExtentCount tExtentCount=$S($D(@global)#2:@global,1:$$topNodesSum(global))
		Write:pDisplayLog !,"Killing ",global,"("_$G(tExtentCount)_")"
		Kill @global
		If $D(tExtentCount) Set @global=tExtentCount
	}
	Quit
topNodesSum(global)
	Set tSum=0,cnt=0,sub="" For { Set sub=$O(@global@(sub),1,cnt) Quit:""=sub  Set tSum=tSum+cnt }
	Quit tSum
]]></Implementation>
</Method>

<Method name="TotalCount">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	&sql(SELECT COUNT(*) INTO :tCount From EnsLib_EDI_EDIFACT.Document)
	Quit tCount
]]></Implementation>
</Method>

<Method name="%OnClose">
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	#; Kill Segment storage if not %Save'd and segment not used by other Documents
	Set tId=..%Id()
	If ""=tId {
		If $D($$$vaM("runtimeIndex")) {
			For index=1:1:$$$vaM("runtimeIndex") { Set seg=$G($$$vaM("runtimeIndex",index))
				If '$$$vaIsOref(seg) { Set segid=$P(seg,"|") }
				Else {
					Set tSegObj=..%maps("orefs",index)
					Set segid=$S(tSegObj.%Cloned:"", 1:tSegObj.ID) ; don't delete ID from cloned segs because the ID does not really belong to them
				}
				Kill:""'=segid&&'$D($$$vaSegmentRefs(segid)) $$$vaSegment(segid)
			}
		} Else {
			Set path="" For { Set path=$O($$$vaM("runtimePath",path),1,seg) Quit:""=path
				If '$$$vaIsOref(seg) { Set segid=$P(seg,"|") }
				Else {
					Set tSegObj=..%maps("orefs",$E(seg,2,*))
					Set segid=$S(tSegObj.%Cloned:"", 1:tSegObj.ID) ; don't delete ID from cloned segs because the ID does not really belong to them
				}
				Kill:""'=segid&&'$D($$$vaSegmentRefs(segid)) $$$vaSegment(segid)
			}
		}
	}
	If 'tId||$D($$$vaExtentGbl(tId)) $$$vaMkill  ; ..%maps can be undefined when aborting %OpenId() of nonexistent Id
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="AddFunctionalGroup">
<FormalSpec>pGS:EnsLib.EDI.EDIFACT.Segment,*pGroupSegIndex:%Integer=""</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:"Interchange"'=..Name $$$ERROR($$$EnsErrGeneral,"Can only add FunctionalGroups to an Interchange document, not a "_..Name)
	Set tSC=..AppendSegment(pGS) Quit:$$$ISERR(tSC) tSC
	Set tDataElementSeparator=$$$ELESEP(..Separators)
	Set tPlaceholder=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,"",$E(..Separators,1,4)_"TransactionSetDocsRef"_tDataElementSeparator_(..SegCount+1)_tDataElementSeparator))
	Set tSC=..AppendSegment(tPlaceholder) Quit:$$$ISERR(tSC) tSC
	Set pGroupSegIndex=..SegCount
	Set tGE=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,"",$E(..Separators,1,4)_"GE"_tDataElementSeparator_0_tDataElementSeparator_pGS.GetValueAt(6)))
	Set tSC=..AppendSegment(tGE) Quit:$$$ISERR(tSC) tSC
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="AddTransactionSet">
<Description>
Add a TransactionSet to the Interchange. Add it to a group given the segment index of the placeholder segment between GS and GE segments.</Description>
<FormalSpec>pTxnSet:EnsLib.EDI.EDIFACT.Document,pGroupSegIndex:%Integer,pAttachment:%Stream.Object=$$$NULLOREF</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:"Interchange"'=..Name $$$ERROR($$$EnsErrGeneral,"Can only add TransactionSets to an Interchange document, not a "_..Name)
	Set pTxnSet.ParentId=..getId()_":"_pGroupSegIndex
	Set pTxnSet.IsMutable=0
	Set tSC=pTxnSet.%Save()

	#; Add to count of children in the group placeholder segment and the GE segment
	Set tSC=..SetValueAt(1+..GetValueAt(pGroupSegIndex_":2"),pGroupSegIndex_":2") Quit:$$$ISERR(tSC) tSC
	Set tSC=..SetValueAt(1+..GetValueAt((pGroupSegIndex+1)_":1"),(pGroupSegIndex+1)_":1") Quit:$$$ISERR(tSC) tSC

	#; Add attachments if any into the Interchange
	If $IsObject(pAttachment) {
		If pAttachment.%Extends("%Collection.AbstractListOfObj") {
			For i=1:1:pAttachment.Count() {
				Set tSC=..AddAttachment(pAttachment.GetAt(i))  Quit:$$$ISERR(tSC)
			}
		} Else { Set tSC=..AddAttachment(pAttachment)  Quit:$$$ISERR(tSC) tSC }
	}
	Quit tSC
]]></Implementation>
</Method>

<Method name="AddEndSegment">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set tDataElementSeparator=$$$ELESEP(..Separators)
	If "Interchange"=..Name {
		Set tNumGroups=0 For i=1:1:..SegCount { Set:"GS"=..GetValueAt(i_":0") tNumGroups=tNumGroups+1 }
		Set tIEA=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,"",$E(..Separators,1,4)_"IEA"_tDataElementSeparator_tNumGroups_tDataElementSeparator_..GetValueAt("1:13")))
		Set tSC=..AppendSegment(tIEA) Quit:$$$ISERR(tSC) tSC
	} Else {
		Set tSE=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,"",$E(..Separators,1,4)_"SE"_tDataElementSeparator_(..SegCount+1)_tDataElementSeparator_..GetValueAt("1:2")))
		Set tSC=..AppendSegment(tSE) Quit:$$$ISERR(tSC) tSC
	}
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="NewReplyDocument">
<FormalSpec>pDocType:%String="",pLocalApplicationID:%String,*pSC:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Document</ReturnType>
<Implementation><![CDATA[
	Kill %objlasterror
	Set pSC=$$$OK, tReplyDoc=..%New($LB("",..Separators))
	If '$IsObject(tReplyDoc) Set pSC=$$$ERROR($$$EnsErrGeneral,"Failed to instantiate reply document for doc "_..%Id()_"; status = "_$G(%objlasterror,$$$OK))  Quit $$$NULLOREF
	Set:""=pDocType pDocType=..DocType
	If "Interchange"=..Name {
		Set tISA=..GetSegmentAt(1)
		If $IsObject(tISA) {
			Set:"UNA"=tISA.Name tISA=..GetSegmentAt(2)
			If $IsObject(tISA) {
				Set tReplyHeaderSeg=..NewReplyHeaderSeg(tISA,pLocalApplicationID,.pSC)
				Do:$IsObject(tReplyHeaderSeg) tReplyDoc.AppendSegment(tReplyHeaderSeg)
			}
		}
	} Else {
		If ""=pDocType {
			Set tParentISA=..ParentHeaderSeg
			Set:$IsObject(tParentISA) pDocType=$P(tParentISA.DocType,":")_":997"
		}
		Set tST=##class(EnsLib.EDI.EDIFACT.Segment).%New($LB("",1,"",$E(..Separators,1,4)_"ST"_$$$ELESEP(..Separators)_"997"))
		Do:$IsObject(tST) tReplyDoc.AppendSegment(tST)
	}
	Set tReplyDoc.DocType=pDocType
	Quit tReplyDoc
]]></Implementation>
</Method>

<Method name="NewReplyHeaderSeg">
<ClassMethod>1</ClassMethod>
<FormalSpec>pOriginalHeaderSeg:EnsLib.EDI.EDIFACT.Segment,pLocalApplicationID:%String="",*pSC</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK
	Do {
		Set tReplyHeaderSeg=pOriginalHeaderSeg.%ConstructClone()  If '$IsObject(tReplyHeaderSeg) Set tSC=%objlasterror  Quit

		If "UIB"=pOriginalHeaderSeg.Name {
			Set tSenderField=6
			Set tDateField=8
			Set tMsgIdField="3.1"
			Set tReplyField=""
		} Else {
			Set tSenderField=2
			Set tDateField=4
			Set tMsgIdField=5
			Set tReplyField=9
		}
		Set tRcvrField=tSenderField+1, tTimeH=$H
			
		#; Determine the ID that we should use as Sender in this reply
		#; - support indirection and escaping to allow @ to represent the caller's ID value
		Set tRcvrID=$P(pLocalApplicationID,":",1), tRcvrQual=$P(pLocalApplicationID,":",2), tRcvrIntID=$P(pLocalApplicationID,":",3), tRcvrIntSID=$P(pLocalApplicationID,":",4)
		If pLocalApplicationID["@" {
			Set pos=1 For { Set pos=$F(tRcvrID,"\",pos)  Quit:'pos  Set c=$E(tRcvrID,pos)
				Set tNew=$Case(c, "@":-1, "\":"\", :"\"_c), $E(tRcvrID,pos-1,pos)=tNew, pos=pos+$L(tNew)-1
			} Set tRcvrID=$Replace($Replace(tRcvrID,"@",pOriginalHeaderSeg.GetValueAt(tRcvrField_".1")),-1,"@")
			Set pos=1 For { Set pos=$F(tRcvrQual,"\",pos)  Quit:'pos  Set c=$E(tRcvrQual,pos)
				Set tNew=$Case(c, "@":-1, "\":"\", :"\"_c), $E(tRcvrQual,pos-1,pos)=tNew, pos=pos+$L(tNew)-1
			} Set tRcvrQual=$Replace($Replace(tRcvrQual,"@",pOriginalHeaderSeg.GetValueAt(tRcvrField_".2")),-1,"@")
			Set pos=1 For { Set pos=$F(tRcvrIntID,"\",pos)  Quit:'pos  Set c=$E(tRcvrIntID,pos)
				Set tNew=$Case(c, "@":-1, "\":"\", :"\"_c), $E(tRcvrIntID,pos-1,pos)=tNew, pos=pos+$L(tNew)-1
			} Set tRcvrIntID=$Replace($Replace(tRcvrIntID,"@",pOriginalHeaderSeg.GetValueAt(tRcvrField_".3")),-1,"@")
			Set pos=1 For { Set pos=$F(tRcvrIntSID,"\",pos)  Quit:'pos  Set c=$E(tRcvrIntSID,pos)
				Set tNew=$Case(c, "@":-1, "\":"\", :"\"_c), $E(tRcvrIntSID,pos-1,pos)=tNew, pos=pos+$L(tNew)-1
			} Set tRcvrIntSID=$Replace($Replace(tRcvrIntSID,"@",pOriginalHeaderSeg.GetValueAt(tRcvrField_".4")),-1,"@")
		}
		Set tCS=tReplyHeaderSeg.CS, tReplyerID=tRcvrID_tCS_tRcvrQual_tCS_tRcvrIntID_tCS_tRcvrIntSID

		#; Set the Receiver ID for this reply as the Sender ID that came to us
		Set tOriginalSenderID=pOriginalHeaderSeg.GetValueAt(tSenderField,,.tSC)  Quit:$$$ISERR(tSC)
		Set tSC=tReplyHeaderSeg.SetValueAt(tOriginalSenderID,tRcvrField)  Quit:$$$ISERR(tSC)
		
		#; Set the Sender ID for this reply as the replyer ID we just determined based on the Receiver ID that came to us
		While tCS=$E(tReplyerID,*) { Set tReplyerID=$E(tReplyerID,1,*-1) }
		Set tSC=tReplyHeaderSeg.SetValueAt(tReplyerID,tSenderField)  Quit:$$$ISERR(tSC)
		
		#; Date & Time
		Set tSC=tReplyHeaderSeg.SetValueAt($E($ZDate(tTimeH,8),3,8),tDateField_".1")  Quit:$$$ISERR(tSC)
		Set tSC=tReplyHeaderSeg.SetValueAt($TR($ZTime($P(tTimeH,",",2),2),":"),tDateField_".2")  Quit:$$$ISERR(tSC)
		
		#; Get a new interchange control number for this interchange
		Set tInterchangeControlNumber=..NewControlID(0,tOriginalSenderID,tReplyerID,"I")
		Set tSC=tReplyHeaderSeg.SetValueAt(tInterchangeControlNumber,tMsgIdField)  Quit:$$$ISERR(tSC)
		
		#; Set whether ACK is required for this message
		Set tSC=tReplyHeaderSeg.SetValueAt(0,tReplyField)  Quit:$$$ISERR(tSC)
	} While 0
	Set pSC=tSC
	Quit tReplyHeaderSeg
]]></Implementation>
</Method>

<Method name="NewReplyGroupSeg">
<Description>
Create a new group segment as a reply corresponding to an original GS segment</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>pOriginalGS:EnsLib.EDI.EDIFACT.Segment,*pSC:%Status</FormalSpec>
<ReturnType>EnsLib.EDI.EDIFACT.Segment</ReturnType>
<Implementation><![CDATA[
	Set tSC=$$$OK, tTimeH=$H
	do {
		Set tReplyGS=pOriginalGS.%ConstructClone()  If '$IsObject(tReplyGS) Set tSC=%objlasterror  Quit

		#; Swap Sender/Receiver Code (TO DO: May have to consult BusinessService)
		Set tSC=tReplyGS.SetValueAt($E($ZDate(tTimeH,8),3,8),$$$GSDate)  Quit:$$$ISERR(tSC)
		Set tSC=tReplyGS.SetValueAt($Translate($ZTime($P(tTimeH,",",2),2),":"),$$$GSTime)  Quit:$$$ISERR(tSC)
		
		Set tOriginalSender=pOriginalGS.GetValueAt($$$GSApplicationSendersCode)
		Set tOriginalReceiver=pOriginalGS.GetValueAt($$$GSApplicationReceiversCode)

		Set tSC=tReplyGS.SetValueAt(..NewControlID(0,tOriginalSender,tOriginalReceiver,"G"),$$$GSGroupControlNumber)  Quit:$$$ISERR(tSC)

		Set tSC=tReplyGS.SetValueAt(tOriginalReceiver,$$$GSApplicationSendersCode)  Quit:$$$ISERR(tSC)
		Set tSC=tReplyGS.SetValueAt(tOriginalSender,$$$GSApplicationReceiversCode)  Quit:$$$ISERR(tSC)
	} while (0)
	Set pSC=tSC
	Quit tReplyGS
]]></Implementation>
</Method>

<Method name="NewControlID">
<Description>
Get an new unique control number. Control numbers are classified into interchange control numbers "I" and
group control numbers "G".</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>pInbound:%Boolean=0,pReceiverID:%String,pSenderID:%String,pType:%String="H"</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	; $$$NUM($TR($ZH,"."),12)
	Set pReceiverID=$ZStrip(pReceiverID,"<>W"), pSenderID=$ZStrip(pSenderID,"<>W")
	Set:""=pReceiverID pReceiverID="0"
	Set:""=pSenderID pSenderID="0"
	Set tControlNumber=$Increment(^EnsEDI.ControlNumber(pInbound,pReceiverID,pSenderID,pType))
	Set ^EnsEDI.ControlNumber(pInbound,pReceiverID,pSenderID,pType,tControlNumber)=$Piece($Horolog,",")_"|"_$ZHorolog
	Quit tControlNumber
]]></Implementation>
</Method>

<Method name="AddAttachment">
<FormalSpec>pStream:%Stream.Object</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Set:'pStream.%IsA("Ens.StreamContainer") pStream=##class(Ens.StreamContainer).%New(pStream)
	Set tFilename=$G(pStream.Stream.Attributes("Filename"))
	Set:""=tFilename&&pStream.Stream.%Extends("%Library.FileStreamAdaptor") tFilename=pStream.Filename, pStream.Stream.Attributes("Filename")=tFilename
	Quit:""=tFilename $$$ERROR($$$EnsErrGeneral,"Attachment stream must contain 'Filename' Attribute")
	Set tOld=..Attachments.GetObjectIdAt(tFilename)
	If ""'=tOld $$$LOGWARNING("Overwriting attachment "_tOld.%Id()_" with same filename '"_tFilename_"' as new attachment "_pAttachment.%Id()_" in Interchange "_$this_"/"_..%Id())
	Quit ..Attachments.SetAt(pStream,tFilename)
]]></Implementation>
</Method>

<Method name="Clear">
<Description>
Delete All Content and reset all properties</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:'..IsMutable $$$ERROR($$$EnsErrGeneral,"Object is immutable")
	Set tSC=..%OnClose()  Quit:$$$ISERR(tSC) tSC
	Kill $$$vaM("runtimeIndex"), $$$vaM("runtimePath"), $$$vaM("bidirectionalLink"), $$$vaM("loopIndex")
	Set $$$vaM("runtimeIndex")=0
	Set i%BuildMapStatus=""
	Set ..Source=""
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="getId">
<Description>
The same as %Id(), but allocates the Id even if the object hasn't been saved already</Description>
<CodeMode>generator</CodeMode>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	$$$GENERATE(" If ..%Id()="""" Do ..%IdSet($increment("_$$$EXTidlocation($$$pEXT,%class)_"))")
	$$$GENERATE(" Quit ..%Id()")
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="GetManagerLinks">
<Description>
Returns an array of links to manager pages for this type of VDoc; item 0 is the family description</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>*pColumns</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set iCol=0
	Set pColumns(iCol,"page")="http://www.unece.org/trade/untdid/welcome.htm"
	Set pColumns(iCol,"name")=$$$Text("UN/EDIFACT")
	Set pColumns(iCol,"desc")=$$$Text("United Nations Directories for Electronic Data Interchange for Administration, Commerce and Transport ")
	
	Set iCol=iCol+1
	Set pColumns(iCol,"page")=##class(%CSP.Page).Link("SEF/EDISchemaMain.csp?FAMILY=EDIFACT")
	Set pColumns(iCol,"name")=$$$Text("Schema Structures")
	Set pColumns(iCol,"desc")=$$$Text("View schema definitions for various types of EDIFACT documents")

	Set iCol=iCol+1
	Set pColumns(iCol,"page")=##class(%CSP.Page).Link("EDIDocumentView.csp?NAME=EDIFACT Document&CLASS=EnsLib.EDI.EDIFACT.Document")
	Set pColumns(iCol,"name")=$$$Text("Document Viewer")
	Set pColumns(iCol,"desc")=$$$Text("View EDIFACT Documents from a variety of sources and test them with various DocType schema definitions and Data Transformations")

	Quit 1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^EnsLib.EDI.EDIFACT.DocumentD</DataLocation>
<DefaultData>DocumentDefaultData</DefaultData>
<IdLocation>^EnsLib.EDI.EDIFACT.DocumentD</IdLocation>
<IndexLocation>^EnsLib.EDI.EDIFACT.DocumentI</IndexLocation>
<StreamLocation>^EnsLib.EDI.EDIFACT.DocumentS</StreamLocation>
<Data name="Attachments">
<Attribute>Attachments</Attribute>
<Structure>subnode</Structure>
<Subscript>"Attachments"</Subscript>
</Data>
<Data name="DocumentDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ParentId</Value>
</Value>
<Value name="3">
<Value>DocType</Value>
</Value>
<Value name="4">
<Value>IsMutable</Value>
</Value>
<Value name="5">
<Value>TimeCreated</Value>
</Value>
<Value name="6">
<Value>Source</Value>
</Value>
<Value name="7">
<Value>OriginalDocId</Value>
</Value>
</Data>
</Storage>
</Class>


<CSP name="dispo/index.html" application="/csp/allianceprod/" default="1"><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-de" lang="de-de">
	<head>
		<meta http-equiv="refresh" content="0; URL=http://localhost:57773/dispo/Alliance.Ens.DispCons.Login.cls">
	</head>
</html>
]]></CSP>


<CSPBase64 name="dispo/pic/Thumbs.db" application="/csp/allianceprod/" default="1">
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA
EAAAAgAAAAIAAAD+////AAAAAAAAAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////9
////CQAAABUAAAAEAAAABQAAAAYAAAAHAAAACAAAAAoAAAAQAAAACwAAAAwAAAANAAAADgAAAA8A
AAARAAAAGQAAABIAAAATAAAAFAAAABYAAAD+////FwAAABgAAAAaAAAAIQAAABsAAAAcAAAAHQAA
AB4AAAAfAAAAIAAAACIAAAD+////IwAAAP7/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////1IA
bwBvAHQAIABFAG4AdAByAHkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAWAAUA//////////8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDEMBiJ3MoB
AwAAAIA2AAAAAAAAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAQAAgH///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAZgMAAAAAAAAyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAACAQEAAAAEAAAA/////wAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAXAwAAAAAAADMAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAIB////////
////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGwAAAHUDAAAAAAAAAQAA
AAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAP7///8PAAAA
EAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAD+////HAAAAB0AAAAe
AAAAHwAAACAAAAAhAAAAIgAAACMAAAAkAAAAJQAAACYAAAAnA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F9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcY
GRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWaBAAAAggAAAIMAAACEAAAAhQAAAIYA
AACHAAAAiAAAAP7///+KAAAAiwAAAIwAAACNAAAAjgAAAI8AAACQAAAAkQAAAJIAAACTAAAAlAAA
AJUAAACWAAAA/v///5gAAACZAAAAmgAAAJsAAACcAAAAnQAAAJ4AAACfAAAAoAAAAKEAAACiAAAA
owAAAKQAAAD+////pgAAAKcAAACoAAAAqQAAAKoAAACrAAAArAAAAK0AAACuAAAArwAAALAAAACx
AAAAsgAAAP7///+0AAAAtQAAALYAAAC3AAAAuAAAALkAAAC6AAAAuwAAAMoAAAC9AAAAvgAAAL8A
AADAAAAAwQAAAMIAAADDAAAAxAAAAMUAAADGAAAAxwAAAMgAAADJAAAA/v///9kAAADMAAAAzQAA
AM4AAADPAAAA0AAAANEAAADSAAAA0wAAANQAAADVAAAA1gAAANcAAADYAAAA/v////7/////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////2doaWpzdHV2d3h5eoOEhYaHiImKkpOU
lZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T1
9vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAAB
AncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3
ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Sl
pqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEA
AhEDEQA/AP0N17X4LjxB4g0+9jaWW1WNLW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AAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACxG3tvKAXMAdABhAHQAVwBoAGkAdABlAC4AZwBp
AGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAA=
</CSPBase64>


<CSPBase64 name="dispo/pic/garbage.gif" application="/csp/allianceprod/" default="1">
R0lGODlhEAAQAPcAAEJCQkpKSlJSUlpaWmNjY2tra3Nzc3t7e4SEhISEjIyMjJSUjJSUlJSclJS1
1pycnJylnKWcnKWlpa2lpa2tra2t77W1tbW9vb29vb29xsbGxs7OztbW1t7e3ufn5+/v7/f39///
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////yH5BAEAAA4ALAAAAAAQABAA
AAiuAB0IFFhBA4WDFQYqdOBhgwYLEh4oOKBgoYMOHjJYoCCBwcQCBhZq+LABAwUIHg8UELDQwoYO
DiEyQEAgwEKTFiBKRLCyosINFkyiRGBgQAAJCzlwALEh4kwDR5NuYCohQkoCSBVy2OBBg1OiA7IO
5KCBA4avRRkkxVAyogKeAg5USCiQwwWTblUGwEqBroOcFiY8WHCgZoEHDPw6wIA4gUoCByhgmLtw
ruXLcwMCADs=
</CSPBase64>


<CSPBase64 name="dispo/pic/stat10.gif" application="/csp/allianceprod/" default="1">
R0lGODlhDgAOAIcAAAIDAgUJBAUJBQcNBgkNCAgQBgkQBwkTBwsXCAwRCw8VDhQZExUdEw0lBg0g
CA8jCRIuCBM3BxYzDDM5MTQ8MTU/MhpFCxpPBxZRAhdSAxdXABhYAhhdABxsAB5yAB94ADhANjxB
OjxGOVNcUFRZUl9fX2FpX2dwZHR5cyKCACOFACqgACqjAC2sAC2vADC4ADG7ADG+ADLAAICAgISG
hJCTkJiYmKCgoKioqLS0tL6/vsDAwMTExMzMzNDQ0NTU1NjY2Nzc3OTk5Ozs7PDw8Pj4+P///wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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N56CI8J3WvAbjSgJOspceUD
VIuAvT0GUhk48hcctQxS8yBnEUyX4KYBYZrgXgO2JoK7DjhiC7lEH+zsGzjFKEhGQWwZXM+DGxq4
oYO7dOguFxTM8h9q5QgbKsWErJO5QRBNgZwFcMMBoIOUACkFYhxw+WD9nE3tciCTdvfOeBoQNoi+
gRsMwjTADRPCtR+a+yQ0Twcy42nI9Xx3iWOVPfh6R9xyH68NN145DOFqBdfbAPhASkEVClgdHE5l
PsW6A09VZM8eEBEmb2qhmfv7KL9xmuxiJynZT4XkI/oSPrP0oUsEqvdZdRM9rV11l1sSQ+0d28Ef
6R2spQXYtoa5RVff9PRoL6qkVQ+ONvsDd8P3gieOHcDE5AyevXiNyXgUC2lxAXuIVw98tV5IKSE4
g8fF4G8wUKNnQY61F//HAWMMANBy7na8p38oftC91JzLbiEWi2F+jVDQmqYq90rRdzlYHH8Qfz82
N9Dgb4PP54OUEpaVB61EukvwfyMAgFWUkcevZqdW0vUouk/B8p6N4B/6PQBDLlU0bKl8dwAAAABJ
RU5ErkJggg==
</CSPBase64>


<CSPBase64 name="dispo/pic/stat10_old.png" application="/csp/allianceprod/" default="1">
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK
T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU
kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX
Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB
eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt
AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC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AAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAP8ALAAAAAAOAA4A
AAiBAH8I7CFjQwMHHGj4EMgQhwIKI1iwGCGBQY6GAUrE2MhRhICLPRKY4EgyhogFPkBMKFkywgwI
I1lyHKFhgAuZHFkoAPAC58YWBx6c8BmDhIUPF4hWCLGDgAqcJw7w+GEDwQqWKAzcYFiDQIYUMGCk
wFDABkOBOjo8ADDggYcdDAMCADs=
</CSPBase64>


<CSPBase64 name="dispo/pic/stat20.png" application="/csp/allianceprod/" default="1">
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADXklEQVQ4jWWTW2hbBQCGv3PpSU7O
aU/Sy7aGaVvrSmNblVVpcWzgoBZXcCqbJTjiELQilFkvww3HJoKbCKv4svWhwws+VESYIG7KFDeh
os6Jqy1d26Rturamt6TJyeWcJMcH3ajsf/z5///p+wXHcdgot9BdcW/jpiebHqx/dLO/vAZw/p5f
mRm5Fv5+ajx2PusMrW7MCxsH7ql94bnu5x87sb3tgVrVowPCvyEczHSK34evRYbOfXssMjv42R0D
zc0vnwj1PnXc560kb9vc8gUBbLuA4wiUGRqrKzEG+784Ojp29iSACFC9KRTs3L/juK66KFpJotGb
xGIxYrEY8/OLKFKeZ7oCxBbnSWdsuoI7391ScWAfgKgKQaOpbevJlJkmHJ6mtcWPIueZnZ1jYWER
20oT2t/GHyNhJianmYtGyeQsmtr8p1QhWCqqutOFq1gTnZnl+l836D/zJU93PYTmEZmYjOBWHDyq
i4Z6P6/0PE5PaDeRyQiiR6hXPcVOSfMFeiV3oTVtmtiWxfJqnJ9/HeNQz17GJ2bY98QOZFliPWky
PbPA62+dIZ02SZkpkon0kqBVdn1tVEl7SjUNl8uNoihksha1d2/h7Ok+dF0l9NIpxsZn0DwuRFHA
ti0s22LpZua8hLshmMmuNeRti0KhQDabw+1SOPLqswQaaykUi8iyxMjoFPFEEsvKkUymiMfXyGXF
MblE0SIlioUsSVh2HgWRY4dD7Olo5823BzDKN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