# Deploying an app using the rest interface

**URL:** <https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037>\
**Category:** Uncategorized\
**Created:** [December 12, 2018, 10:11am UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037 "2018-12-12T10:11:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 12, 2018, 10:11am UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/1 "2018-12-12T10:11:14Z")

</div>

I have 2 issues.  
Issue1:  
I have a script that packages a process and forms into a zip.  
I would like to deploy this zip in flowable-modeler but don’t find any documentation on what endpoint I should use.

Issue2:  
When I use a get on flowable-modeler in postman I get redirected to the identity manager.  
When I use the same URL in a browser that is authenticated it works as designed.  
The URL I’m using is: [https://flowable-dev/flowable-modeler/app/rest/models](https://flowable-dev/flowable-modeler/app/rest/models)

How do I set authentication in postman?

---

<div class="post-metadata">

**Author:** ![xcaptain](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/xcaptain/32/1286_2.png) [@xcaptain](https://forum.flowable.org/u/xcaptain)\
**Post date:** [December 12, 2018, 12:34pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/2 "2018-12-12T12:34:58Z")

</div>

I have the same issue and get solved, you can see my thread [How to use rest api in docker](https://forum.flowable.org/t/how-to-use-rest-api-in-docker/2977/9)

To use rest api you have to either setup `flowable-rest` or `flowable-task`, to pass http basic authentication you can use something like

```auto
curl -i 'http://admin:test@localhost:8080/flowable-task/process-api/repository/deployments'

```

or

```auto
curl -i --user admin:test 'http://localhost:8080/flowable-task/process-api/repository/deployments'

```

You got redirected because you are using the application api which require cookie based authentication

---

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 12, 2018, 2:03pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/3 "2018-12-12T14:03:33Z")

</div>

Hi xcapitain.

I did some experimenting this morning and now I’m even more confused…

I deploy an app using the following command:  
The zip file is created by exporting an app in modeler.

> curl -X POST   
> [https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments](https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments)   
> -H ‘authorization: Basic c2xhZzpmbGF0ZWFydGhpc3ffffwu’   
> -H ‘cache-control: no-cache’   
> -H ‘content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW’   
> -F file=@test.zip

The result is

> {  
> “id”: “404ee9c0-fe12-11e8-874a-0050569058ff”,  
> “name”: “test”,  
> “deploymentTime”: “2018-12-12T14:31:37.658+01:00”,  
> “category”: null,  
> “url”: “[https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments/404ee9c0-fe12-11e8-874a-0050569058ff](https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments/404ee9c0-fe12-11e8-874a-0050569058ff)”,  
> “tenantId”: “”  
> }

I use the following link to check if it is deployed.

> [https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments?name=test](https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments?name=test)  
> {  
> “data”: [  
> {  
> “id”: “404ee9c0-fe12-11e8-874a-0050569058ff”,  
> “name”: “test”,  
> “deploymentTime”: “2018-12-12T14:31:37.658+01:00”,  
> “category”: null,  
> “url”: “[https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments/404ee9c0-fe12-11e8-874a-0050569058ff](https://flowable-dev.newtec.eu/flowable-task/app-api/app-repository/deployments/404ee9c0-fe12-11e8-874a-0050569058ff)”,  
> “tenantId”: “”  
> }  
> ],  
> “total”: 1,  
> “start”: 0,  
> “sort”: “id”,  
> “order”: “asc”,  
> “size”: 1  
> }

Now when I go to flowable-modelere or flowable app the app or process doesn’t show up.  
Any idea what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![xcaptain](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/xcaptain/32/1286_2.png) [@xcaptain](https://forum.flowable.org/u/xcaptain)\
**Post date:** [December 12, 2018, 2:59pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/4 "2018-12-12T14:59:44Z")

</div>

Try

```auto
curl --user admin:test 'http://localhost:8080/flowable-task/process-api/repository/process-definitions'

```

Can you see the process definition list?

If not you can try to build app in flowable-modeler and then deploy to flowable task.

---

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 12, 2018, 3:13pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/5 "2018-12-12T15:13:14Z")

</div>

Using the following URl i can see my deployments:

> [https://flowable-dev.newtec.eu/flowable-task/process-api/repository/process-definitions?name=aaa](https://flowable-dev.newtec.eu/flowable-task/process-api/repository/process-definitions?name=aaa)

I don’t see the process in flowable task or flowable modeler.  
I can however start the process using the following url:

> [https://flowable-dev.newtec.eu/flowable-rest/service/runtime/process-instances](https://flowable-dev.newtec.eu/flowable-rest/service/runtime/process-instances)

This will create a task that is visible in flowable-task.

It’s almost like flowable rest and flowable task are using a different engine or database

---

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 12, 2018, 4:13pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/6 "2018-12-12T16:13:04Z")

</div>

I found an easy reproducible way

Start the docker container:

> docker run -p 8080:8080 flowable/all-in-one

import the process:

> curl -X POST   
> [http://localhost:8080/flowable-task/app-api/app-repository/deployments](http://localhost:8080/flowable-task/app-api/app-repository/deployments)   
> -H ‘authorization: Basic YWRtaW46dGVzdA==’   
> -H ‘cache-control: no-cache’   
> -H ‘content-type: multipart/form-data;’  
> -F file=@aaa.zip

Check modeler for the process, form or app. They aren’t there.

start the process:

> curl -X POST   
> [http://localhost:8080/flowable-task/process-api/runtime/process-instances](http://localhost:8080/flowable-task/process-api/runtime/process-instances)   
> -H ‘authorization: Basic YWRtaW46dGVzdA==’   
> -H ‘cache-control: no-cache’   
> -H ‘content-type: application/json’   
> -d ‘{“processDefinitionKey”:“aaa”}’

Check task… there is your task, but the form is missing resulting in a nice dump.

The zip can be downloaded with the following [sharepoint link](https://newteccy-my.sharepoint.com/personal/slag_newtec_eu/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fslag%5Fnewtec%5Feu%2FDocuments%2Faaa%2Ezip&parent=%2Fpersonal%2Fslag%5Fnewtec%5Feu%2FDocuments&slrid=fe55ab9e-8077-0000-4ca3-098cf79d4d8b)

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [December 13, 2018, 8:11am UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/7 "2018-12-13T08:11:38Z")

</div>

Hey,

I would like to clarify some things. The `flowable-task` and `flowable-modeler` application do not share the same DB tables. Which means that if you deploy an app only to `flowable-task` then you won’t see the models in `flowable-modeler`.

If `flowable-rest` and `flowable-task` are configured with the same DB, then they should have the exact same data, which means that if you deploy to `flowable-rest` then you should be able to see it in `flowable-task`.

Have a look at the [Flowable UI Modeler](https://www.flowable.org/docs/userguide/index.html#flowableModelerApp) section of our documentation. There are 2 ways to export an app. One export creates a zip which can be used for importing an app to other `flowable-modeler` application. And the second one exports a bar which should be used for deploying to the engines.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 13, 2018, 1:00pm UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/8 "2018-12-13T13:00:44Z")

</div>

Right now my development flow is as folows.

I create a bpm drawing and forms in modeler. I download it and manually it in an eclipse project.

In eclipse I write some javascript in the bpmn file. Write some test code, maybe modify a form a bit.  
Once I’m happy I deploy it to the task engine and start the process and test it manually.

Offcourse sometimes I want to make big changes and then I like a GUI. So I would like to import my process back into modeler.

This is an issue since I can’t import a bar file into modeler or a zip into flowable-task.

Is there an easy way to transform these?

One solution would be, uploading a zip to flowable-modeler and publishing it using the rest interface of modeler. Is this possible?

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [December 19, 2018, 8:19am UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/9 "2018-12-19T08:19:21Z")

</div>

You can separately import BPMN and forms (in the upcoming release) in the modeler as well. Not sure if this is an option for you.

> [@Sebastiaan](#):
>
> One solution would be, uploading a zip to flowable-modeler and publishing it using the rest interface of modeler. Is this possible?

What exactly do you mean by this?

---

<div class="post-metadata">

**Author:** ![Sebastiaan](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Sebastiaan](https://forum.flowable.org/u/Sebastiaan)\
**Post date:** [December 19, 2018, 8:54am UTC](https://forum.flowable.org/t/deploying-an-app-using-the-rest-interface/3037/10 "2018-12-19T08:54:05Z")

</div>

> [@filiphr](#):
>
> You can separately import BPMN and forms (in the upcoming release) in the modeler as well. Not sure if this is an option for you.

I noticed that when you import a process in modeler, the reference to the form is gone.

> [@filiphr](#):
>
> > One solution would be, uploading a zip to flowable-modeler and publishing it using the rest interface of modeler. Is this possible?
> 
> What exactly do you mean by this?

This question is has “changed” a bit.

The actual issue is although modeler is a nice graphical tool, it has it’s limits.  
The modeler is easy to create a drawing, but once I start writing scripts and testclasses I switch to eclipse.

Although I do most of my work in eclipse, I sometimes want to modify the process or forms in flowable-modeler. Visualisation of the xml process flows and json forms can be handy 🙂

When I change a form this is not pushed to flowable-task. For this I need to create an app and publish it.  
This requires a lot of manual steps:

- Import xml process into modeler
- fix form references in the process flow.
- modify form
- publish app from modeler to task.
- start the process in task
- add process variables to startform

The last 2 steps can easily be scripted.  
The issue is importing and publishing.
