This interface is build to run the interface in adhoc basis and this will run with particular interval or automatically run on the actual duration.
On the interface failure this will not update the current time so on the next run this takes a time from the previous successful run. Due to this we will not miss any timeframe data.
Interface design
- SetParameter- Content modifier
Body:
<Record>
<AdhocRun>${property.AdhocRun}</AdhocRun>
<AdhocRun_Date>${property.AdhocRun_Date}</AdhocRun_Date>
<LastModifiedDateTime_adhoc>${property.last_modified_on_adhoc}</LastModifiedDateTime_adhoc>
<LastModifiedDateTime>${property.ITR_I004_LastSuccessfulRun}</LastModifiedDateTime>
</Record>
3. Time Stamp -Groovy Script:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
def Message processData(Message message)
{
def pMap = message.getProperties();
def whereString = new StringBuffer();
def ITR_I004_LastSuccessfulRun_LV = pMap.get("ITR_I004_Update_LastSuccessfulRun");
def lastRun_var = pMap.get("LastRun")
def AdhocRun_Date_var = pMap.get("AdhocRun_Date")
def AdhocRun_var = pMap.get("AdhocRun")
def last_modified_on_adhoc_var = pMap.get("last_modified_on_adhoc");
def currentDate_var = pMap.get("CurrentDate");
if(AdhocRun_var.equals("false")){
lastRun_var = ITR_I004_LastSuccessfulRun_LV
currentDate_var = currentDate_var
}
else{
lastRun_var = lastRun_var
currentDate_var = AdhocRun_Date_var
}
int Count = 0 ;
message.setHeader("Count", Count);
message.setProperty("LastRun",lastRun_var);
message.setProperty("CurrentDate",currentDate_var);
return message;
}
4. Write Variables
{
"operation": "GetRows",
"conditionalColumns": [{
"name": "UPDATEDDATE",
"value": [
"${property.LastRun}",
"${property.CurrentDate}"
],
"operation": "BETWEEN",
"dataType": "timestamp_ntz"
},
{
"name": "STATUS",
"value": "ACTIVE",
"operation": "EQUALS",
"dataType": "varchar"
}
]
}
Continue with the business logic after this…..
Exception Subprocess:
1. Router:
2. Write Variable:
3. Dummy Content Modifier:
1. When Adhoc is set as true then interface run with manual from and to time
No comments:
Post a Comment