cancel
Showing results for 
Search instead for 
Did you mean: 

Datafeed completion message

AlexandrosKras
Collaborator III

Hi all,

 

Merry Xmas

Is there any way to have a Datafeed completion message when we run it through a custom object?

For example, it may be a kind of datafeed field update status?

 

Regards -

Alexandros

3 REPLIES 3

DavidPetty
Archer Employee
Archer Employee

Happy Holidays Alexandros

 

You can use the /datafeed/getrecentrundetail REST API to get the status of the data feed inside your custom object.  More details on how to make that call, Data Feed | RSA Link

 Advisory Consultant - Archer, an RSA Business

Hi David,

 

This is my datafeed content:

---------------------------------------------

 

<!DOCTYPE html>
<html>
<head>
<style>
#dpia-btn-generate {
background-color: transparent;
margin: 1% 0% 1% 7%;
}
#alertMsg{
color:#555;
border-radius:10px;
font-family: Tahoma;font-size:12px;
padding:10px 10px 10px 36px;
position: fixed;
top: 0;
left: 0;
height: 1em;
width: 100%;
background-color: #e9ffd9;
z-index: 999;
font-weight:bold;
}
</style>
</head>
<body>
<div id="dpia-toolbar-app-buttons">
<a id="dpia-btn-capture" href="javascript:void(0);" data-check-dirty="false">
<div id="dpia-btn-generate" class="tb-btn" data-icon="&#xE08F" data-icon-pos="left" onclick="executedatafeed();"> COPY ROPA FIELDS</div>
</a>
</div>
<div id="alertMsg" style="display:none"><span>SUCCESS: </span>Task Generation Job has started successful. Please refresh or recalculate the record</div>
</body>
</html>

<script type="text/javascript">

var datafeedGUID = 'E00FF545-1E52-4445-8CB8-9E03FD283440';
var baseURL = 'https://.../RSAarcher'; // Build the base URL from address bar
var restAPICall = {"DataFeedGuid":datafeedGUID, "IsReferenceFeedsIncluded":true};

Sys.Application.add_load( function() {
if (sessionStorage.getItem("status")==200) {
document.getElementById("alertMsg").style.display = "block";
setTimeout( function(){document.getElementById("alertMsg").style.display = "none";}, 5000);
sessionStorage.setItem("status", "100");
}

});

function executedatafeed(){
$.ajax({
type: "POST",
url: baseURL+'/api/core/datafeed/execution',
headers: {
'x-csrf-token': (window.sessionStorage) ? window.sessionStorage.getItem("x-csrf-token") : csrfToken = parent.parent.ArcherApp.globals['xCsrfToken']
},
data: JSON.stringify(restAPICall),
contentType: 'application/json',
processData: false,
dataType: 'json',
success: function() {
sessionStorage.setItem("status", "200");
$('#master_btnApply').click();},

error: function() {alert("An unexpected error has occurred in the system. Please try your request again. If problems persist, please contact your system administrator")}
});
}

</script>

 

 

------------------------------------

Where I can put the next call (and if you can include the script) that would check the last completion (only after it will be completed)?

When you are queuing the feed from your custom object, it is only putting the feed in the queue for execution. If there is no available async thread, it could sit for a while before it even starts. If you need to know when it finishes, you will have to sit on that screen and keep checking the run history as David mentioned, until it shows the new run.