dynamic update

[RESOLVED] Dynamic destination folder for Alfresco connector

How can I make a dynamic destination folder for Alfresco connector, so that the path is not always the same?
For example, I need to make a new folder in Alfresco whenever the process is started so that the documents for the process would be saved as in tree hierarchy as in /User%20Homes/BPM/Process1, /User%20Homes/BPM/Process2 etc.

Variable doesn't get updated if custom widget uses asynchronous call (REST)

I've built a custom widget (thanks to quentin ) that retrieves a variable from an activity, by using Bonita REST API.
The variable is displayed by the widget, but I want it to write that value into a variable defined in the editor.

So I did a bidirectional binding. The variable never gets updated. By testing, I found out that the problem seems to lye in the asynchronous call. I've tried several things ($scope.$apply, variable = return $http...) but did not succeed.