Quintiq file version 2.0
|
#parent: #root
|
Method GetSetOfInterest (LibDMF_SystemOnChannel soc_i, String setTypeName_i, String setName_i,
|
Boolean setFoundRequired_i, output String feedback_o) as LibDMF_Set
|
{
|
Description: 'Retrieve the Set in the DataManager which the SOC is interested in, returns null if not used in DataManager.'
|
TextBody:
|
[*
|
set := null( LibDMF_Set );
|
root := this.CommunicationChannelRoot();
|
|
if( root.IsDataManager() )
|
{
|
set := LibDMF_Set::FindSet( setName_i );
|
|
// Retrieve IntegrationEvent
|
event := root.EventGetLast( soc_i.DatasetKind(), soc_i.DatasetName() );
|
activityDetails := setName_i + " for System " + soc_i.SystemName() + "; Channel = " + this.Name();
|
|
// 1. checks if set exists
|
if( isnull( set ) )
|
{
|
// log the set not found
|
feedback_o := "Non-existent Set " + activityDetails;
|
|
// check whether to terminate the transaction
|
if( setFoundRequired_i )
|
{
|
root.EventLogActivityError( event,
|
"Finding Set " + activityDetails,
|
feedback_o );
|
}
|
else
|
{
|
// log warning
|
root.EventLogActivityWarning( event,
|
feedback_o );
|
}
|
}
|
else
|
{
|
// 2. checks if the SOC is interested
|
if( not soc_i.ChecksForInterest( set ) )
|
{
|
// reset to null
|
set := null( LibDMF_Set );
|
|
// log the soc does not have interest on set or settype
|
feedback_o := "No interest specified for Set " + activityDetails;
|
|
// check whether to terminate the transaction
|
if( setFoundRequired_i )
|
{
|
root.EventLogActivityError( event,
|
"Matching interested Set " + activityDetails,
|
feedback_o );
|
}
|
else
|
{
|
// log warning
|
root.EventLogActivityWarning( event,
|
feedback_o );
|
}
|
}
|
else
|
{
|
// log successful
|
root.EventLogActivity( event,
|
"Found interested Set " + activityDetails );
|
}
|
}
|
}
|
|
return set;
|
*]
|
}
|