Not applicable
We have implemented a better service to support the security, customisation, and functionality in the Mobile Apps to be able to support more extended functionalities for the employees or resources. The architecture and structure is based on the existing Request-flow service, which supports the requests in the Mobile Apps. We support the following in the ResourceFlow service:
The information in this document is based on product update 502.
The following targets are used:
This is needed to keep the shared logic which is currently used in Exact.Service.REST.ESE.Requestflow, Exact.Services.REST.ESE.Documentflow, and Exact.Services.Accountflow.
This contains the resource flow logic and implementations such as OpenNew, Retrieveall, and Action (currently only available for save, delete, and upload picture) service endpoints. It is based on the Exact.Services.REST.ESE.Shared target.
This contains the data contract of the Resource flow service.
This contains the resource flow actions that defines the security and it is where the meta data and values of the resource will come from.
This is important for the upload profile image service which is used to upload a profile image for an employee or resource.
The API can be tested with a REST client. We will also update RequestFlowClient.exe to support the resource flow.
Currently, the following are supported:
All the service calls start with the services/Exact.ResourceFlow.REST.svc endpoint with type POST and have the following headers:
Content-Type : application/json;odata=verbose
Accept : application/json;odata=verbose
DataServiceVersion : 3.0
This can be used to open a resource with pre-filled values and all the fields with properties so the resource can be used in a new state.
URL: http://<synergyUrl>/services/Exact.ResourceFlow.REST.svc/OpenNew
Body: {"InputMessage":{"ResourceType":"E"}}
The resource type is the action input parameter. Based on the resource type the available fields, default values, and others are returned.
Output: The pre-filled resource or an exception in case the user is not allowed to create the resource with that particular resource type.
It has the following structure :
This can be used to open an existing resource. It gives you a list with possible actions such as 'Save', 'Delete', and 'UploadPicture'. It also returns the information if the user has rights to view the resource.
URL: http://<synergyUrl>/services/Exact.ResourceFlow.REST.svc/RetrieveAll
Body: {"InputMessage":{"ResourceID":5741}}
Output: This is the resource information with the following structure (similar to OpenNew):
The resource ID is the ID of the resource to be retrieved.
This can be executed based on the following:
URL: http://<synergyUrl>/services/Exact.ResourcFlow.REST.svc/Action
Body: starts with {"Name": "<Action>","InputMessage":[]}
Based on the action different fields are added.
To save, you have to add the structure in an array : {"Name": "<FieldName","Value": "<Value"}
To save the full body you can use {"Name": "Save","InputMessage":[{"Name": "ID","DataType": "Guid","Value": "<Value"},{"Name": "FirstName","Value": "Jan"}]}5
This is a special action which has the following structure:
URL: http://<synergyUrl>/services/Exact.ResourceFlow.REST.svc/Browse
BODY:
{
"BatchSize": 20,
"LeadingFieldsValues": [],
"SearchColumns": [],
"PropertyName": "Manager",
"ResourceType": "E",
"SessionID": 0,
"ResourceID": 5741
}
The batch size is to let the service know how many rows to return. The leading fields are fields which are related. If you browse on a cost centre, the leading field can be the division.
The PropertyName must match a field name in the resource definition which you have retrieved with OpenNew or RetrieveAll.
The session ID can be used for paging. If you fill in the session ID the server knows which page to return.
The resource ID must be provided so that we know which field of the resource we are browsing.
This is used to upload a profile image.
URL: http://<synergyUrl>/api/files/uploadprofileimage/?resid=5741
The ResID is the resource ID of the employee or resource of which the image is uploaded.
This is a POST with a multi part body where the file is the important element.
There are several ways to upload a file in a multi part such as:
Define a MultipartFormDataContent multi = new MultipartFormDataContent();
You can then add the file as a stream content, for example, StreamContent baContent = new StreamContent(files[i]);
You can also wrap it with ProgressableStreamContent to attach a progress bar to monitor the progress of the upload. Finally, do a post with the Mutipart as the http content as a parameter, for example, await _client.PostAsync(uri, multi, cancellationToken);
The image will be displayed in the resource card of the employee and in the list where the employee is involved.