CN111708526A - Novel API writing method - Google Patents

Novel API writing method Download PDF

Info

Publication number
CN111708526A
CN111708526A CN202010507637.5A CN202010507637A CN111708526A CN 111708526 A CN111708526 A CN 111708526A CN 202010507637 A CN202010507637 A CN 202010507637A CN 111708526 A CN111708526 A CN 111708526A
Authority
CN
China
Prior art keywords
hiddenapi
api
workflow
parameters
follows
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010507637.5A
Other languages
Chinese (zh)
Other versions
CN111708526B (en
Inventor
吕冬波
刘标勇
徐凯凯
曲申
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Ruitai Information Technology Co ltd
Original Assignee
Suzhou Ruitai Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Ruitai Information Technology Co ltd filed Critical Suzhou Ruitai Information Technology Co ltd
Priority to CN202010507637.5A priority Critical patent/CN111708526B/en
Publication of CN111708526A publication Critical patent/CN111708526A/en
Application granted granted Critical
Publication of CN111708526B publication Critical patent/CN111708526B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a novel API writing method, which is realized by combining a Plugin plug-in and a workflow technology of a HiddenAPI based on a Dynamics365 standard, wherein the HiddenAPI comprises a HiddenAPI host, a HiddenAPI controller, a HiddenAPI logic device, a HiddenAPI context and HiddenAPI parameters, but not an interface for configuring one workflow, so that the development time can be effectively saved, the development efficiency is improved, meanwhile, the service change can be better adapted, when the input parameters and the output parameters of the interface are changed, the workflow does not need to be reconfigured, only corresponding codes need to be adjusted, the workflow is effective after the codes are adjusted and released, local debugging is supported, developers can debug on own local computers without uploading compiled files to a server, the API is developed completely based on a standard development mode of the Dynamics365, the compatibility problem does not exist, the developed functions can be used in a new version 365 of the Dynamics in the future, no adjustment is required.

Description

Novel API writing method
Technical Field
The invention belongs to the technical field related to program development, and particularly relates to a novel API writing method.
Background
The Dynamics365 is customer relationship management software provided by microsoft, and besides a standard business function related to customer relationship management, the software also comprises a series of custom development methods, such as a client script, a server plug-in, a server workflow and the like, when a client application or an external third party application needs to be integrated with the Dynamics365, a corresponding API needs to be provided, the API in the Dynamics365 is mainly realized through an operation type workflow, and in general, developers can create various different workflows and write custom development logic codes in the workflows, so that more interfaces are provided for the outside.
The existing workflow development mode technology of Microsoft Dynamics365 has the following problems:
1. a CodeActivity needs to be written and a workflow is defined, and the definition process of the workflow is slow and very complex;
2. each time an interface is added, a workflow needs to be added, and the system has a large number of workflows which are difficult to perform planning management;
3. when the interface parameters need to be changed, besides the code needs to be adjusted, the configuration of the workflow also needs to be modified, which is equivalent to repeatedly adjusting twice, and the whole development process becomes complicated by the operation;
4. the debugging is inconvenient, the remote debugging is needed on a server, some developers can solve the problems in the CRM by embedding an ashx file or an aspx file, but other problems can be caused because the developers are not in a standard development mode of the Dynamics365, for example, the functions are incompatible after the Dynamics365 is upgraded, and the like.
Disclosure of Invention
The present invention is directed to a novel API authoring method to solve the above-mentioned problems of the background art.
In order to achieve the purpose, the invention provides the following technical scheme:
a novel API writing method is characterized in that the API writing mode is realized by combining a Plugin plug-in based on workflow technology of Dynamics365 standard, and the HiddenAPI comprises a HiddenAPI host, a HiddenAPI controller, a HiddenAPI logic device, a HiddenAPI context and HiddenAPI parameters.
Preferably, the specific flow of the HiddenAPI host in the API writing mode is as follows:
the method comprises the following steps: creating an empty workflow, wherein in general, only one program set is created;
step two: providing a universal plug and registering the universal plug to the workflow;
step three: acquiring an Api name in the hiddenAPI parameter from the Plugin, and finding a corresponding hiddenAPI controller according to the Api name;
step four: acquiring Input in the HiddenAPI parameter from the Plugin and transmitting the Input to the HiddenAPI controller;
step five: executing the logic of the HiddenAPI controller, and returning the result to the caller;
preferably, the HiddenAPI controller in the API writing mode is described in detail as follows:
the description is as follows: generally, a controller with a function comprises each API of the function, each API directly calls the HiddenAPI logic device without other extra actions, and the purpose of the controller is to define the name of the API and execute the logic device.
Preferably, the HiddenAPI logic device in the API writing mode is described in detail as follows:
the description is as follows: and implementing the business logic of each API, and executing specific business logic according to the input HiddenAPI parameters and the HiddenAPI context, wherein the logic of the part is determined by specific business functions, such as storing customers, inquiring orders and the like.
Preferably, the specific description of the context of the HiddenAPI in the API writing mode is as follows:
the description is as follows: defining a context of the HiddenAPI during initialization, wherein the context is transmitted to the controller and the logic device for use;
description II: the context includes the following:
organization service: organizing services, and performing data adding, deleting, searching and changing operations in the logic device through the services;
tracingservice: the log service is used for recording necessary logs by the logic device, so that problem analysis and troubleshooting are facilitated;
UserId: a current user;
BusinessUnitId: the department to which the current user belongs;
LangId: the current language, the logic device performs the action of language translation by the value, if the multi-language is not considered, the parameter is not needed;
preferably, the specific description of the HiddenAPI parameter in the API writing mode is as follows:
the description is as follows: defining standard parameters of the HiddenAPI, wherein the standard parameters comprise input parameters and output parameters;
description II:
inputting parameters:
api: text type, name of API to be executed;
input: JSON type string, incoming value;
LangId: integer, language ID;
outputting parameters:
errorcode: integer, error code;
message: text, error description;
output: JSON type character strings and output results;
preferably, the main principle of the API writing mode is as follows:
an empty workflow and a Plugin mode are adopted to package a group of Api, the empty workflow is used as an entry of all HiddenAPI, and has only a few standard parameters, which is called HostWorkflow, because the workflow is empty and has no logic, a plug-in is added to the workflow, and the plug-in decides which specific API is called according to the parameters of the workflow and returns the result of the corresponding API to the client.
Compared with the prior art, the invention provides a novel API writing method, which has the following beneficial effects:
the invention is based on the workflow technology of the Dynamics365 standard and combines the Plugin plug-in to write the API, compared with the existing API technology, the API technology has the advantages that a large amount of workflow configuration work is reduced, one module configures one workflow instead of one interface, the development time can be effectively saved, the development efficiency is improved, and meanwhile, the API can better adapt to the service change, when the input parameter and the output parameter of the interface change, the workflow does not need to be reconfigured, only the corresponding code needs to be adjusted, the code is effective after being released after being adjusted, and the local debugging is supported, developers can debug in the local machine, the compiled files do not need to be uploaded to a server, the API is developed completely based on the standard development mode of the Dynamics365, the compatibility problem does not exist, the developed function can be used in the new version of the Dynamics365 in the future, no adjustment is required.
All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a novel technical scheme of an API writing method, which comprises the following steps:
a novel API writing method is characterized in that the API writing mode is realized by combining a Plugin plug-in based on workflow technology of Dynamics365 standard, and the HiddenAPI comprises a HiddenAPI host, a HiddenAPI controller, a HiddenAPI logic device, a HiddenAPI context and HiddenAPI parameters.
A novel API writing method comprises the following specific processes of a HiddenAPI host in an API writing mode:
the method comprises the following steps: creating an empty workflow, wherein in general, only one program set is created;
step two: providing a universal plug and registering the universal plug to the workflow;
step three: acquiring an Api name in the hiddenAPI parameter from the Plugin, and finding a corresponding hiddenAPI controller according to the Api name;
step four: acquiring Input in the HiddenAPI parameter from the Plugin and transmitting the Input to the HiddenAPI controller;
step five: executing the logic of the HiddenAPI controller, and returning the result to the caller;
a novel API writing method comprises the following specific description of a HiddenAPI controller in an API writing mode:
the description is as follows: generally, a controller with a function comprises each API of the function, each API directly calls the HiddenAPI logic device without other extra actions, and the purpose of the controller is to define the name of the API and execute the logic device.
A novel API writing method comprises the following specific description of a HiddenAPI logic device in an API writing mode:
the description is as follows: and implementing the business logic of each API, and executing specific business logic according to the input HiddenAPI parameters and the HiddenAPI context, wherein the logic of the part is determined by specific business functions, such as storing customers, inquiring orders and the like.
A novel API writing method comprises the following specific description of the context of the HiddenAPI in the API writing mode:
the description is as follows: defining a context of the HiddenAPI during initialization, wherein the context is transmitted to the controller and the logic device for use;
description II: the context includes the following:
organization service: organizing services, and performing data adding, deleting, searching and changing operations in the logic device through the services;
tracingservice: the log service is used for recording necessary logs by the logic device, so that problem analysis and troubleshooting are facilitated;
UserId: a current user;
BusinessUnitId: the department to which the current user belongs;
LangId: the current language, the logic device performs the action of language translation by the value, if the multi-language is not considered, the parameter is not needed;
a novel API writing method comprises the following specific description of the HiddenAPI parameters in the API writing mode:
the description is as follows: defining standard parameters of the HiddenAPI, wherein the standard parameters comprise input parameters and output parameters;
description II:
inputting parameters:
api: text type, name of API to be executed;
input: JSON type string, incoming value;
LangId: integer, language ID;
outputting parameters:
errorcode: integer, error code;
message: text, error description;
output: JSON type character string and output result.
The working principle and the using process of the invention are as follows: after the method is installed, a group of Api is packaged by adopting an empty workflow and a plug-in mode, the empty workflow is used as an inlet of all HiddenAPI, the empty workflow has only a few standard parameters, and is called HostWorkflow, because the workflow is empty and has no logic, a plug-in is added to the empty workflow, and the plug-in can decide which specific API to call according to the parameters of the workflow and return the result of the corresponding API to the client.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (7)

1. A novel API writing method is characterized in that: the API writing mode is that the HiddenAPI is based on workflow technology of Dynamics365 standard and is realized by combining a Plugin plug-in, and the HiddenAPI comprises a HiddenAPI host, a HiddenAPI controller, a HiddenAPI logic device, a HiddenAPI context and HiddenAPI parameters.
2. A novel API composition method according to claim 1, wherein: the specific flow of the HiddenAPI host in the API writing mode is as follows:
the method comprises the following steps: creating an empty workflow, wherein in general, only one program set is created;
step two: providing a universal plug and registering the universal plug to the workflow;
step three: acquiring an Api name in the hiddenAPI parameter from the Plugin, and finding a corresponding hiddenAPI controller according to the Api name;
step four: acquiring Input in the HiddenAPI parameter from the Plugin and transmitting the Input to the HiddenAPI controller;
step five: the logic of the HiddenAPI controller is executed and the result is returned to the caller.
3. A novel API composition method according to claim 1, wherein: the specific description of the HiddenAPI controller in the API writing mode is as follows:
the description is as follows: generally, a controller with a function comprises each API of the function, each API directly calls the HiddenAPI logic device without other extra actions, and the purpose of the controller is to define the name of the API and execute the logic device.
4. A novel API composition method according to claim 1, wherein: the specific description of the HiddenAPI logic device in the API writing mode is as follows:
the description is as follows: and implementing the business logic of each API, and executing specific business logic according to the input HiddenAPI parameters and the HiddenAPI context, wherein the logic of the part is determined by specific business functions, such as storing customers, inquiring orders and the like.
5. A novel API composition method according to claim 1, wherein: the specific description of the context of the HiddenAPI in the API writing mode is as follows:
the description is as follows: defining a context of the HiddenAPI during initialization, wherein the context is transmitted to the controller and the logic device for use;
description II: the context includes the following:
organization service: organizing services, and performing data adding, deleting, searching and changing operations in the logic device through the services;
tracingservice: the log service is used for recording necessary logs by the logic device, so that problem analysis and troubleshooting are facilitated;
UserId: a current user;
BusinessUnitId: the department to which the current user belongs;
LangId: the current language, the logic, takes the action of language translation with this value, and if multilingual is not considered, this parameter may not be needed.
6. A novel API composition method according to claim 1, wherein: the specific description of the HiddenAPI parameter in the API writing mode is as follows:
the description is as follows: defining standard parameters of the HiddenAPI, wherein the standard parameters comprise input parameters and output parameters;
description II:
inputting parameters:
api: text type, name of API to be executed;
input: JSON type string, incoming value;
LangId: integer, language ID;
outputting parameters:
errorcode: integer, error code;
message: text, error description;
output: JSON type character string and output result.
7. A novel API composition method according to claim 1, wherein: the main principle of the API writing mode is as follows:
an empty workflow and a Plugin mode are adopted to package a group of Api, the empty workflow is used as an entry of all HiddenAPI, and has only a few standard parameters, which is called HostWorkflow, because the workflow is empty and has no logic, a plug-in is added to the workflow, and the plug-in decides which specific API is called according to the parameters of the workflow and returns the result of the corresponding API to the client.
CN202010507637.5A 2020-06-05 2020-06-05 API writing method Active CN111708526B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010507637.5A CN111708526B (en) 2020-06-05 2020-06-05 API writing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010507637.5A CN111708526B (en) 2020-06-05 2020-06-05 API writing method

Publications (2)

Publication Number Publication Date
CN111708526A true CN111708526A (en) 2020-09-25
CN111708526B CN111708526B (en) 2024-03-01

Family

ID=72539001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010507637.5A Active CN111708526B (en) 2020-06-05 2020-06-05 API writing method

Country Status (1)

Country Link
CN (1) CN111708526B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321178A (en) * 2008-07-18 2008-12-10 中兴通讯股份有限公司 Portal workflow engine system and its implementing method
CN101645013A (en) * 2009-09-07 2010-02-10 中兴通讯股份有限公司 Plug-in type service management system and method of integrated service management platform
US20140344391A1 (en) * 2012-12-13 2014-11-20 Level 3 Communications, Llc Content Delivery Framework having Storage Services
CN107515775A (en) * 2016-06-15 2017-12-26 华为技术有限公司 A kind of data transmission method and device
CN108052314A (en) * 2017-12-26 2018-05-18 无线生活(杭州)信息科技有限公司 The method and device that a kind of plug-in unit based on Gradle is packaged
CN110389899A (en) * 2019-06-21 2019-10-29 北京字节跳动网络技术有限公司 Detect square law device, medium and the equipment of the API data type of JS program
CN110912724A (en) * 2018-09-18 2020-03-24 亿阳信通股份有限公司 Parameter-driven automatic service arrangement method and device
CN111240643A (en) * 2019-12-27 2020-06-05 苏州铃空网络科技有限公司 Cross-platform software design method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321178A (en) * 2008-07-18 2008-12-10 中兴通讯股份有限公司 Portal workflow engine system and its implementing method
CN101645013A (en) * 2009-09-07 2010-02-10 中兴通讯股份有限公司 Plug-in type service management system and method of integrated service management platform
US20140344391A1 (en) * 2012-12-13 2014-11-20 Level 3 Communications, Llc Content Delivery Framework having Storage Services
CN107515775A (en) * 2016-06-15 2017-12-26 华为技术有限公司 A kind of data transmission method and device
CN108052314A (en) * 2017-12-26 2018-05-18 无线生活(杭州)信息科技有限公司 The method and device that a kind of plug-in unit based on Gradle is packaged
CN110912724A (en) * 2018-09-18 2020-03-24 亿阳信通股份有限公司 Parameter-driven automatic service arrangement method and device
CN110389899A (en) * 2019-06-21 2019-10-29 北京字节跳动网络技术有限公司 Detect square law device, medium and the equipment of the API data type of JS program
CN111240643A (en) * 2019-12-27 2020-06-05 苏州铃空网络科技有限公司 Cross-platform software design method

Also Published As

Publication number Publication date
CN111708526B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
US10678522B1 (en) Compiler and method for compiling business rules for a serverless runtime environment
US10534586B2 (en) Method, system and apparatus for visual programming of interaction workflows for omni-channel customer contact centers with integrated customer relationship management
WO2019153472A1 (en) Automated interface testing method, device, equipment, and storage medium
CN101482817B (en) Large-particle Java component assembly method based on black box
KR102237877B1 (en) Intelligent software auto development system with real-time collaboration support and method thereof
CN104756086A (en) System and method for debugging domain specific languages
CN111176629A (en) Application development method and device
JP2012512489A (en) User script code conversion for debugging
CN102542382A (en) Method and device for managing business rule
US8752030B1 (en) Process abstraction and tracking, systems and methods
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
CN112328229A (en) Method for quickly creating Jenkins assembly line
US11875146B2 (en) System and method to modify run-time behavior of an application by modification of machine-readable instructions
US11669332B1 (en) Systems and methods for modernizing legacy applications
CN1996375A (en) Method and device for implementing transaction test in host environment
CN115480810A (en) Low-code platform based on cloud protogenesis
CN113419969B (en) Interface automatic formation power guarantee method based on browser plug-in
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN116185425B (en) Event flow arrangement method, device, equipment and medium based on node combination
CN110045952B (en) Code calling method and device
CN104536892B (en) A kind of software on-line debugging method and system
CN111708526A (en) Novel API writing method
CN115951970A (en) Heterogeneous multi-simulation software integrated development environment
CN112783791B (en) Interface test case generation method and device
CN113885844A (en) Business service arranging method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant