Quintiq file version 2.0
|
#parent: #root
|
Method ReceivingPanelMaterials (
|
NamedValueTree requestnvt
|
) as stream[NamedValueTree]
|
{
|
TextBody:
|
[*
|
logfile( "--------------------------------------1------------------------------------------------" );
|
nameValue := requestnvt.Root();
|
|
bodyHandle := requestnvt.GetHandle( "Body" );
|
restHandle := requestnvt.GetHandle( "Rest" );
|
restPayloadHandle := requestnvt.GetHandle( "RestPayload" );
|
|
bodyNameValue := nameValue.Child( bodyHandle );
|
restNameValue := bodyNameValue.Child( restHandle );
|
restPayloadNameValue := restNameValue.Child( restPayloadHandle );
|
|
businessTypeHandle := requestnvt.GetHandle( "businessType" );
|
businessTypeNameValue := restPayloadNameValue.Child( businessTypeHandle );
|
|
businessType := businessTypeNameValue.GetValueAsString();
|
|
if ( businessType = "车载" ) {
|
PanelMaterialVehicle::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "汽车电子" ) {
|
PanelMaterialAutomotiveElectronics::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "天华" ) {
|
PanelMaterialTianHua::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "运动健康" ) {
|
PanelMaterialSportsHealth::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "专显" ) {
|
PanelMaterialSpecializedDisplay::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "IT" ) {
|
PanelMaterialIT::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "TM17" ) {
|
PanelMaterialTM17::ReceiveDataGeneration( this, requestnvt );
|
} else if ( businessType = "TM18" ) {
|
PanelMaterialTM18::ReceiveDataGeneration( this, requestnvt );
|
}
|
|
|
info( "---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" );
|
|
|
replynvt := LibInt_MessageAccessor::CreateEmptyMessage();
|
LibInt_MessageAccessor::SetHeaderProperty( replynvt, "Content-Type", "application/json" );
|
|
rootNamedValue := replynvt.Root();
|
bodyHandle := replynvt.GetHandle( "Body" );
|
petHandle := replynvt.GetHandle( "Pet" );
|
bodyNamedValue := rootNamedValue.Child( bodyHandle );
|
petNamedValue := bodyNamedValue.AddChild( petHandle );
|
categoryHandle := replynvt.GetHandle( "Category" );
|
categoryNamedValue := petNamedValue.AddChild( categoryHandle );
|
categoryIDHandle := replynvt.GetHandle( "Id" );
|
categoryIDNamedValue := categoryNamedValue.AddChild( categoryIDHandle );
|
categoryIDNamedValue.SetValue( 3 );
|
categoryNameHandle := replynvt.GetHandle( "Name" );
|
categoryNameNamedValue := categoryNamedValue.AddChild( categoryNameHandle );
|
categoryNameNamedValue.SetValue( "Cat" );
|
petNameHandle := replynvt.GetHandle( "Name" );
|
petNameValue := petNamedValue.AddChild( petNameHandle );
|
petNameValue.SetValue( "Pet1" );
|
petIdHandle := replynvt.GetHandle( "PetId" );
|
petIdNameValue := petNamedValue.AddChild( petIdHandle );
|
petIdNameValue.SetValue( 1 );
|
|
photoUrlHandle := replynvt.GetHandle( "PhotoUrl" );
|
photoUrlNameValue := petNamedValue.AddChild( photoUrlHandle );
|
urlHandle := replynvt.GetHandle( "Url" );
|
photoUrlNameValue.AddChild( urlHandle, "url1" );
|
|
statusHandle := replynvt.GetHandle( "Status" );
|
statusNameValue := petNamedValue.AddChild( statusHandle );
|
statusNameValue.SetValue( "available" );
|
|
tagHandle := replynvt.GetHandle( "Tag" );
|
tagNameValue := petNamedValue.AddChild( tagHandle );
|
tagIdHandle := replynvt.GetHandle( "Id" );
|
tagNameValue.AddChild( tagIdHandle, 123 );
|
tagNameHandle := replynvt.GetHandle( "Name" );
|
tagNameValue.AddChild( tagNameHandle, "tag1" );
|
|
|
info( replynvt.ToString() );
|
|
|
return emit( replynvt );
|
*]
|
}
|