-1

I'm creating a web application using Bonita soft bpm API.

I've called '/API/bpm/userTask/[taskId]/contract' and it returned :

{
    "inputs": [],
    "constraints": []
}

but the task has many input fields in the view.

why the response is like that ?

and what does this method must return?

this is view of the create role task with id 560008 Bonita panel with the view

ui designer :

ui designer

and this is the result of the api call with empty arrays response.

postman

How can I show the view of task (the green box on the right panel) in my web application?

(notice that I can't using the iframe in my web application on another host and ip because of CORS.)

please help me if you have any solution...

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Hossein Badrnezhad
  • 424
  • 1
  • 6
  • 18

1 Answers1

1

When you call the REST API to get task contract definition you get an empty result most likely because you didn't define any contract on the task in your process definition. To define a contract you need to select the task in Bonita Studio, go to "Execution" -> "Contract" tab and define the contract.

Defining a form for a task does not lead to the contract creation. The usual sequence of steps is:

  1. Define a Business Data Model (BDM)
  2. Create a new diagram/process definition
  3. Declare a business variable in your process definition
  4. Generate a contract for process / tasks based on business variables using the provided wizard
  5. Generate a task / process instantiation form based on the contract and customize it

You can associate URL in your application with task defined in Bonita and use the REST API to generate the appropriate form in your application. But such solution is likely to have similar issue related to CORS. So my recommendation would be to take a look at Bonita documentation regarding CORS configuration and use Bonita forms.

Antoine Mottier
  • 1,185
  • 1
  • 8
  • 13