Quantcast
Channel: SCN : All Content - SAP Business Process Management
Viewing all articles
Browse latest Browse all 887

tasks.svc: Get task status in SAPUI5

$
0
0

Hi,

 

I'm currently trying to retrieve the status from a task by using oData service "tasks.svc".

But I don't know how I can access that information.

 

In Postman the result of GET request http://<host>:<port>/bpmodata/tasks.svc/TaskCollection(<taskID>)looks like that:

 

Screenshot.jpg

 

 

 

I tried the following in SAPUI5:

 

 

var taskDataSvcURL = "/bpmodata/taskdata.svc/" + taskId;
var oDataModel = new sap.ui.model.odata.ODataModel(                                   taskDataSvcURL, true, false);
// Both ways to retrieve "Status" don't work...
var status = tasksODataModel.read("/TaskCollection('"                         + taskId + "')?$select=Status", null);
status = tasksODataModel.getProperty("Status");
if (status === "COMPLETED" || status === "RESERVED") {  alert(status);

}

 

 

Could you please tell me how I can access the attribute 'Status'?

 

Thanks in advance!

 

Best regards,

Thorsten.


Viewing all articles
Browse latest Browse all 887

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>