One moment please...
 
Exact Synergy Enterprise   
 

ResourceFlow service in Exact Synergy Enterprise

Menu path

Not applicable

Introduction

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:

  • View mode (Retrieve All)
  • Open new with default values
  • Actions - Save, Delete, and UploadPicture
  • Browse

What version are you using?

The information in this document is based on product update 502.

Roles and rights

Not applicable

Technical information

Targets

The following targets are used:

  • Exact.Services.REST.ESE.Shared.dll
  • Exact.Services.REST.ESE.ResourceFlow.dll
  • Exact.ResourceFlow.dll
  • Exact.ResourceFlow.data.dll
  • Exact.MobileApps.WebAPI.dll (for image upload)
  • Exact.ResourceFlow.REST.svc (Services folder)

Exact.Services.REST.ESE.Shared

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.

Exact.Services.REST.ESE.Resourceflow

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.

Exact.ResourceFlow.data.dll

This contains the data contract of the Resource flow service.

Exact.Resourceflow.dll

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.

Exact.MobileApps.WebAPI.dll / Addattachment controller

This is important for the upload profile image service which is used to upload a profile image for an employee or resource.

API Usage and support

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:

  • OpenNew
  • RetrieveAll
  • Action

General

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

OpenNew

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 :

  • Actions (all available actions in this state)
    • results - [Action], Name and Caption
  • Header (contains generic resource related information such as created, modified, type, and others)
  • Fields (list of the resource fields)
    • results - [List of Field] : data such as rights, caption, type (string, integer, boolean, and others), selection options, browser information.

RetrieveAll

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):

  • Actions (all the available actions in this state)
    • results - [Action], Name, and Caption
  • Header (contains all the document related information)
  • Fields (list of the resource fields)
    • results - [Resource field] data such as rights, caption, type (string, integer, boolean, and others), and selection options such as browser information.

The resource ID is the ID of the resource to be retrieved.

Actions

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

Browse

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.

UploadProfileimage

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.

     
 Main Category: Attachments & notes  Document Type: Online help main
 Category:  Security  level: All - 0
 Sub category:  Document ID: 31.369.545
 Assortment:  Date: 11-07-2023
 Release:  Attachment:
 Disclaimer