Page tree

If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Skip to end of metadata
Go to start of metadata

Using this document, the developer can migrate classic e-Business controls to e-Business 6.0.

For this, we have taken an example of DirectoryMember control from classic e-Business and migrated it to e-Business 6.0. Same steps can be followed for other classic e-Business controls as well.

The DirectoryMember control is accessible to the Company Administrator. The control displays a list of members within the company. The Company Administrator can see the members list and delink a person from the company.

Migrate Classic e-Business Controls to e-Business 6.0

Follow the below steps to migrate classic e-Business controls to e-Business 6.0:

  1. Display Members list
    1. Display Members List in classic e-Business: The classic e-Business calls the method LoadMember() which in return executes an SQL to get the member list. This member list binds to a Telerik Grid to show data in a tabular form.

Given below is the LoadMember() method in classic e-Business.

Given below is the image of the directory members list in classic e-Business.

b. Display Members List in e-Business 6.0: The e-Business 6.0 uses the REST API to fetch data. 

  • Build a GET service named "DirectoryMembers" which can return the dataset bound to Telerik Grid, by using below components:
  1. Route
  2. InputEntityDefinition
  3. OutputEntityDefinition
  4. Business Logic
  5. Security


Use the below JSON endpoint structure to generate the e-Business 6.0 service.

"getAllDirectoryMembers": {

      "route": {

        "httpMethod": "GET",

        "segments": {

          "DirectoryMembers": {

            "isLiteral": true,

            "type": "string",

            "security": {

              "IsCompanyAdmin": {

                "type": "WebGroup",

                "parameters": {

                  "groupList": [ "Company Administrator" ]

                }

              }

            }

          }

        },

        "description": "Retrieves the list of directory members."

      },

      "inputEntityDefinition": null,

      "outputEntityDefinition": {

        "isCollection": true,

        "$ref": "#/entityDefinitions/directoryMembersOutput",

        "name": "directoryMembersOutput"

      },

      "businessLogic": {

        "allDirectoryMembersRetrieval": {

          "executionType": "processFlow",

          "processFlowProperties": {

            "processFlowName": "Execute Data Object",

            "processFlowParameters": {

              "DataObjectName": "spGeteBusiness6_0DirectoryMemberDetails",

              "authenticatedAttributes": "@AuthenticatedAttributes"

            }

          }

        },

        "getDirectoryMembersRetrieval": {

          "executionType": "processFlow",

          "processFlowProperties": {

            "processFlowName": "Retrieve Directory Member Details",

            "processFlowParameters": {

              "PersonId": "@AuthenticatedAttributes.AuthenticatedPrincipalRecordId",

              "MembershipStatus": "",

              "Month": "3",

              "DirectoryMembersDataTable": "@parent.allDirectoryMembersRetrieval.outputDataObjectTable"

            }

          }

        }

      }

    }, 


Output Fields Definition:


"entityDefinitions": {

    "directoryMembersOutput": {

      "fields": {

        "id": {

          "type": "long"

        },

        "email": {

          "type": "string"

        },

        "companyId": {

          "type": "long"

        },

        "memberType": {

          "type": "string"

        },

        "title": {

          "type": "string"

        },

        "firstLast": {

          "type": "string"

        },

        "address": {

          "type": "string"

        },

        "startDate": {

          "type": "string",

          "sourceField": "JoinDate"

        },

        "endDate": {

          "type": "string",

          "sourceField": "DuesPaidThru"

        }

      }

    }

  }


  • Business Logic Explanation- To get the directory member details we build a stored procedure named as 'spGeteBusiness6_0DirectoryMemberDetails' and then execute it through a process flow named as 'Execute data object'. This data is then passed to a newly built process component named 'Retrieve Directory Members Detail' which does a similar manipulation with data like classic e-Business.
  • Postman endpoint execution: We can execute getAllDirectoryMembers endpoint using Postman.

Given below is the image of Postman Endpoint execution in e-Business 6.0. 



Expected Result

We should be able to get a member list using service built above.


  • The stock frontend uses knockout for MVVM binding.

Given below is the image of the directory members list in e-Business 6.0.


2. Delink a person from the company.

a. Delink a person in classic e-Business: The classic e-Business calls a method "RemoveCompanyLinkage" to delink a person from the company. This method is invoked from the button "remove" in classic e-Business.

Given below is the image of RemoveCompanyLinkage method in classic e-Business.

Given below is the list of directory members list to be removed from company in classic e-Business.


b. Delink person from company in e-Business 6.0: To build a service to delink a person from company, follow the below steps:

  • Build a service "PATCH /DirectoryMembers" to delink a person from company. Use the below

"removeDirectoryMemberFromCompany": {

      "route": {

        "httpMethod": "PATCH",

        "segments": {

          "DirectoryMembers": {

            "isLiteral": true,

            "type": "string",

            "security": {

              "IsCompanyAdmin": {

                "type": "WebGroup",

                "parameters": {

                  "groupList": [ "Company Administrator" ]

                }

              }

            }

          }

        },

        "description": "Removes directory member from company"

      },

      "inputEntityDefinition": {

        "name": "GetSinglePersonId",

        "fields": {

          "PersonId": {

            "type": "long",

            "input": {

              "httpMethods": [ "PATCH" ],

              "isCollection": true,

              "source": "body",

              "requiredHttpMethods": [

                "PATCH"

              ]

            }

          }

        }

      },

      "outputEntityDEfinition": null,

      "businessLogic": {

          "subscriptionIDRetrieval": {

            "executionType": "processFlow",

            "processFlowProperties": {

              "processFlowName": "Load Subscription Id",

              "processFlowParameters": {

                "PersonId": "@request.PersonId",

                "CompanyId": 1

              }

            }

          },

          "getDirectoryMembersRetrieval": {

            "executionType": "processFlow",

            "processFlowProperties": {

              "processFlowName": "Remove Directory Member From Company",

              "processFlowParameters": {

                "PersonId": "@request.PersonId",

                "CompanyId": 1,

                "iCnt": 0,

                "SubscriptionId": "@parent.subscriptionIDRetrieval.outputIdDataTable"

              }

            }

          }

        }

      }



  • Business Logic Explanation: There are two main components of the business logic:
  1. "Load Subscription Id" which deals with getting subscription id of the person to be delinked.
  2. "Remove Directory Member from Company" which contains similar logic as that of classic e-Business.
  • Postman endpoint execution: We can execute removeDirectoryMemberFromCompany endpoint using Postman. Given below is the image of Postman Endpoint execution in e-Business 6.0.

Expected Result

We should be able to remove a directory member from company using the service built above.


         Given below is the image showing how to delink a directory member in e-Business 6.0.

Given below is the list of attached process flows, process component and stored procedure packs for reference. 

  • GetDirectoryMemberPack1.cmpack
  • GetDirectoryMemberPack2.cmpack
  • GetDirectoryMemberPack3.cmpack
  • RemoveDirectoryMemberPack1.cmpack


Note:

Following manual instructions need to be followed to update service application record,

  1. Open service application record named as ‘e-Business’.

2. Update the Auth Context info as below.

3. Save the service application record.

 


















  • No labels