Can't get form data with Rest in Activiti 6

cancel
Showing results for 
Search instead for 
Did you mean: 
nhhao1996
Active Member II

Can't get form data with Rest in Activiti 6

Hi everyone!

I'm researching about Activiti 6.

When I used version 5.22.0 with Designer plugin in Eclipse, I can create form properties and Activiti Explorer will render into a form for me. I can use GET form/form-data?<taskId> to get form data.

But in Activiti 6, there is no Designer plugin, I create a form in web UI and link it to my user task with referenced form.

When I started my process, I use GET form/form-data?<taskId> to get form data but the response have no form properties:

{
"formKey": "userinput",
"deploymentId": "7508",
"processDefinitionId": null,
"processDefinitionUrl": null,
"taskId": "7528",
"taskUrl": "http://127.0.0.1:8089/activiti-rest/service/runtime/tasks/7528",
"formProperties": []
}

How I can get my form like version 5.22.0?

5 Replies
nhhao1996
Active Member II

Re: Can't get form data with Rest in Activiti 6

Well! 3 days and no any reply? 

paul_roth
Established Member

Re: Can't get form data with Rest in Activiti 6

Hao Nguyen‌, I am in no way an expert in this topic but here is what I think the issue is.  In Activiti 6 the use of the Web UI (e.g. activiti_app) to create a form and link it to a task is a completely different mechanism and has nothing to do with the way you have done forms in the past.  The historical way you've used forms inclusive of "GET form/form-data?<taskId>" continues to be supported in Activiti 6 exactly as you have done it in the past in Activiti 5.22 and is described in the Activiti 6 documentation here - https://www.activiti.org/userguide/#_forms.  Think of this new way using the Web UI as an optional new way that provides the ability to visually model forms and link them to a task but this is not a replacement for the old way which should continue to be working fine.  I hope this is helpful.

Thanks,

Paul

nhhao1996
Active Member II

Re: Can't get form data with Rest in Activiti 6

Hi Paul!

I'm very appreciate for your reply and I understood this mechanism.

By the way, what I'm trying to do is create a form on Activiti and use REST to get the form properties. Then, I render it into a form in my web page for user to type some value into it and submit form to complete task. Everything is work fine. Now I want to make 2 enum fields which are drop down list, when user select item in first enum field, the second enum field will be autofilled. Ex: you select Apple in first enum field and second field will be autofilled with Iphone 4,5,6... Is it possible to do in Activiti?

Sorry for my bad English because English is not my first language. I searched many post in here but no one do this thing before. Hope you can give me some opinion.

Thank you!

paul_roth
Established Member

Re: Can't get form data with Rest in Activiti 6

Hao Nguyen‌ my opinion is that it can be done by adding some JavaScript, but I could not guide you directly.  You might want to take a look at Activiti 7 where you would be able to take advantage of the Alfresco Application Development Framework (ADF) which gives you a much more advanced set of tools/prebuilt functionality for developing great experiences including the requirement you've specified to create dependent relationships between field forms. 

Here is a link to the ADF Documentationhttps://www.alfresco.com/abn/adf/docs/

Here is a link to the ADF Form Rendering Service - https://www.alfresco.com/abn/adf/docs/core/services/form-rendering.service/ which may be a useful place to start.

Note that this does work with Activiti 7 as well as our commercial enterprise offering which is referred to in the documentation as "Process Services."  In particular, the following link to the ADF "Process Services Cloud API" is the specific ADF components and services that correctly work with Activiti 7 - https://www.alfresco.com/abn/adf/docs/process-services-cloud/

Thanks,

Paul

nhhao1996
Active Member II

Re: Can't get form data with Rest in Activiti 6

Well I will keep in mind your opinion!

I think I will find out how to add javascript to do this because I don't intent to use Activiti 7 now.

Thank you!