Search code examples
bonita

how to use rest api to create extension api on Bonita BPM


I have one extension api, I upload it form web/resource/REST API, affter upload, it works well. however, I used the code to upload, i used the PageAPI.createPage() to upload extension, it upload success, but it doesn' work, I check the file on server, from the server, I can't find the extension from the ${BONITA_HOME}\bonita\client\tenants\1\work, it only exist on ${BONITA_HOME}\bonita\client\tenants\1\temp, debug, the files is invode the pageAPI servlet, and invode the PageDataStore.createEngieenPage(), so my question is how can i use the REST API to add extension and deploy it?


Solution

  • In order to deploy a Bonita REST API extension programmatically you need to:

    • Call the loginservice REST API for authentication
    • Send the file to a temporary folder on server side using the uploadPage servlet
    • Register the new REST API extension by calling the portal/page REST API

    I create a basic Groovy script that demonstrate that.