Get all the day from the input 3 fields and check if it matching with today day then return true or false.
Day comparison script
Groovy script:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.json.JsonSlurper
import groovy.json.JsonException
import groovy.json.JsonOutput
import javax.xml.*;
import groovy.xml.*
def Message processData(Message message)
{def propertyMap = message.getProperties()
String date2 = propertyMap.get("ExectutionDate");
String date3 = propertyMap.get("ExectutionDate1");
String date4 = propertyMap.get("ExectutionDate2");
def date1 = new Date()
String day = date1.getDate()
if (day == date2 || day == date3 || day == date4 )
{ Flag = "true"; }
else {Flag = "false" }
message.setProperty("Flag1", Flag)
message.setProperty("day1", day)
return message;}
No comments:
Post a Comment