Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi Seth Klock,
Yes, there's actually an API for this. Once you have obtained the process instance ID from the API that you called, you can call the form data related API to insert a record row. Please see https://dev.joget.org/community/display/KBv6/JSON+API#JSONAPI-web/json/data/form/store/
Hope this helps.
Thanks.
Hugo
Thanks Hugo. I've been using V5. Looks like it's time to upgrade.
You can change your design, put a tool at the front.
Use the "Database Update Tool" to run something like the following
insert into app_fd_YOURTABLENAME values (id, name) ('#assignment.processId#','#variable.wfField1#')
in order to get the data row inserted so that your datalist inbox will have record showing up.
Thanks Walter. That was very helpful. I've implemented this and it seems to be working well. I have to admit that it still seems like there should be a way to populate form data via the API. As in my example, if a form field is "linked" to a workflow variable, then it should create the record for that form. Perhaps this could be added to a future release.
Hi Seth,
I have just tried to follow the steps and able to see the assignment created as a result of starting a process instance via API. Please see the screenshot of mine.
I can see the assignment created in Inbox in the Userview. If you are using Datalist Inbox, you may not see it until you have a form record row created for the process instance. Starting a process instance by itself will not create a record row.
Perhaps you can attach your app design and server error log here for us to check.
Thanks.
Hugo
Hi,
After going through the above thread, and reviewing the APIs was able to figure out it's now possible with API to start a process with data that could be listed on Datalist Inbox.
This has to be done through two API calls:
This may help future users of the Joget, just in case they are struggling to figure out the relation between Process & Form and finding it difficult to start with the APIs.
Thanks again for the feedback. I was able to figure out why the form and datalist field content wasn't in sync. So the outstanding issue is that I can't find a way to get the record to show up in a standard List or Datalist Inbox until I have added content via the UI. Attached is a new sample app that demonstrates this. APP_skApiTest-1-20170829130343.jwa
Hugo, earlier you mentioned "you may not see it until you have a form record row created for the process instance. Starting a process instance by itself will not create a record row.". How can I create a form record row via the API?
Thank you,
Seth
Hello Hugo,
Thank you for your reply. That was extremely helpful. As you suspected, I was using a Datalist Inbox. I have now added a standard Inbox to my Userview and I'm able to see the processes that have been started via the API. How can I create a record row via the API so that the record automatically shows up in the standard Inbox when created via the API? If I update the row from the Standard Inbox it starts to show up in the Datalist Inbox after that, but I need to be able to push the activities along via the API or UI and have them behave the same way.
At the moment, the process that I've built goes thru 2 Activities. On Process start I set a PatientId. Activity 1 is to add the First Name, and Activity 2 is to add the Last Name (I just setup these steps as a simple example to learn how it works). What's strange is that when I start the process via the API and set the PatientId variable, I'm able to see the record in the Inbox, and then complete Activity 1. From the form I can see the PatientId that I set via the API, but when I then look at the record in the Datalist inbox, the PatientId column is empty. In other words, the PatientId displays in the form but not the grid. Any idea what would cause that? (see screen shot)
Attached you will find an export of my app design. APP_sik002_POC-1-20170824120714.jwa
Thanks a lot for the help.
Seth
Hi, if you are designing steps to fill up a form, perhaps using a https://dev.joget.org/community/display/KBv5/Multi+Paged+Form might be easier and more suitable?
Thanks Anders. That looks like a nice option. I should have mentioned that the form in my example was just a silly thing that I created for testing the API. Do you think that using the Multi Page Form would have any bearing on the API issue that I'm experiencing? Thanks
I've created a very simple process with just 2 activities. Via the UI I can start the process, and then move the process through the two activities, and finally to completion. I can see the record in the Inbox and List Views that I've created (which should show everything). However, when I start a process via the JSON API, the process does not show up in the UI. I've checked the Running Processes list and I can see both the process that I created via the UI and the one created via the API. Both processes appear to be identical in settings and status. What would cause the one created via the API to not appear in the applications UI?
Note: I'm logged into the UI as 'admin' and I'm interacting with the API as 'admin' as well, so I'm assuming it's not a permissions issue.
Here's how I start the process via the API:
It returns a success response with the processId. I can then use that processId to interact with the process via the API but I never see it in the UI.
Thanks