Dear Experts,
I am getting data like below.
<Condition GroupType="AllowableAction" Name="Saleable">false</Condition>
<Condition GroupType="AllowableAction" Name="SaleAmendable">false</Condition>
<Condition GroupType="AllowableAction" Name="SaleCancellable">false</Condition>
<Condition GroupType="AllowableAction" Name="ProductAmendable">true</Condition>
<Condition GroupType="AllowableAction" Name="Contractable">false</Condition>
<Condition GroupType="AllowableAction" Name="CommercialAmendable">true</Condition>
<Condition GroupType="LifeCycleEvent" Name="Contracted">true</Condition>
<Condition GroupType="LifeCycleEvent" Name="Gatekeeper Hold">false</Condition>
<Condition GroupType="LifeCycleEvent" Name="VehicleOrderSold">false</Condition>
<Condition GroupType="LifeCycleEvent" Name="Schedule Hold">false</Condition>
I need to create my target node when <Condition GroupType="LifeCycleEvent" Name="VehicleOrderSold">false</Condition> & <Condition GroupType="LifeCycleEvent" Name="Contracted">true</Condition>
Problem here is Vehicle order Sold will also comes like this
<Condition GroupType="LifeCycleEvent" Name="VehicleOrderSold">true.</Condition>
Source structure Condition is an element and GroupType, Name are the attributes of Condition.
In my UDF i need to take 2 input parameters
1) Name ----> In this attribute " Contracted" & "VehicleOrderSold" will come along with other values
2) Condition---> In this element we will get "true" or false.
I tried to achieve this using node functions but successful. Please help on this regard.
Thanks,
Pavan T
Hi Pavan,
A simplistic approach, I used to test your requirement was to concatenate the Condition, Name and GroupType values in a single string and compared them with the values that you wanted. Here is the code I used to perform check. Note that var1 is the concatenated values in that order, with the context for the attributes moved to the parent data type of Condition field.
boolean flag = false;
for ( int i = 0; i <var1.length; i++)
{
if( var1[i].equals("falseVehicleOrderSoldLifeCycleEvent"))
{
flag = true;
}
}
if (flag)
{
for ( int i = 0; i <var1.length; i++)
{
if( var1[i].equals("trueContractedLifeCycleEvent"))
{
result.addValue(var2[i]);
}
}
}
Note: I have returned the var2 value here, which is the Condition field itself.
Regards,
Sanjeev
Hi Pavan,
It looks like a very straight forward requirement which certainly should be resolved through graphical mapping.
Can your share your graphical mapping . I don't think there is an requirement of UDF here at all.
Thanks,
Apu
Add a comment