cancel
Showing results for 
Search instead for 
Did you mean: 

The ODATA Source doesn't work in SAP Custom UI Task

fjrd12_ternium
Explorer

Hi Experts,

I am new on Workflow SACP. I want include a custom UI User Task but i want to include a UploadCollection with files to permit to the user take decision in some documents related to the user decision. In conclusion i need to add an OData source as usual.

I create a WF in the SAP Web IDE like:

After that i can include a task of ui as the item in the menu allow to include in the project folder

It will create a folder with the app as a usual SAPUI5 application. After that i try to use one of my destinations that i used in other applications.

The change is reflected in the manifest.json as is expected.

After the definition i include it in the workflow model and deploy the "workflow custom task" and the "workflow model". Starting the application on the inbox. I can't access to my model app:

I saw it in Network tab with a 404:

https://flpportal-s0020538365trial.dispatcher.hanatrial.ondemand.com/sap/fiori/bpmmyinbox/sap/opu/od...

I had read some entries on blogs that we need to change the URI of the odata source to get connected into MyInboxApp:

https://flpportal-s0020538365trial.dispatcher.hanatrial.ondemand.com/html5apps/projectx/webcontent/U...

https://flpportal-s0020538365trial.dispatcher.hanatrial.ondemand.com/html5apps/projectx/webcontent/U... /$metadata

But i can't reach my odata source. I try to guess which uri at least with the metadata information in a get request and in other way using the component or another advice. For e.g.

https://blogs.sap.com/2017/10/22/part-3-calling-external-service-in-task-ui-of-sap-cloud-platform-wo...

or Component.js

/** 
* Overwrite function of UIComponent because if running in MyInbox-App we need a different URL for our oData-Service
* @param oManifestModels
* @param oManifestDataSources
 */
	_initComponentModels: function(oManifestModels, oManifestDataSources) {
			var service;
			// running in Inbox?
			if (this.getComponentData() && this.getComponentData().startupParameters) {
				var startupParameters = this.getComponentData().startupParameters;
				if (startupParameters.inboxAPI) {
					// yes, prefix the oData URL with the path of the Application
					var prefix = "/" + startupParameters.oParameters.sApplicationPath;
					for (service in oManifestDataSources)
						if (Object.prototype.hasOwnProperty.call(oManifestDataSources, service))
							if (oManifestDataSources[service].uri)
								oManifestDataSources[service].uri = prefix + oManifestDataSources[service].uri;
					for (service in oManifestModels)
						if (Object.prototype.hasOwnProperty.call(oManifestModels, service))
							if (oManifestModels[service].uri)
								oManifestModels[service].uri = prefix + oManifestModels[service].uri;
				}
			}

	UIComponent.prototype._initComponentModels.call(this, oManifestModels, oManifestDataSources);
},

But i can't reach the odata source.

Any idea to override that connection for my destination?

Accepted Solutions (0)

Answers (0)