Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#793781
I have a grid. When I click on 'Add Row', I change some values in Javascript, i submit the form and I execute a trigger after the dynaform. The trigger craete a new case of SUBPROCESS in a certain task. When it's done, I want the subprocess to call a trigger which will redirect to the main application in the grid task.

My problem is that when I use PMFRedirectToStep(), it's the same @@APPLICATION on both the main application and the subprocess (the new case that I created). Is there a way to redirect to a subprocess without this to happen? I don't want to click on 'Add Row', click on continue, go to inbox, have 2 tasks (the main and subprocess, it's supposed to be fixed in 3.2.1 since it doesn,t seem asynchronous like that), open subprocess, do task, continue, go to inbox, back to main process.

Thanks
#793802
Thanks, it's better that way but now with G::header("Location: ../cases/cases_Open?APP_UID=$newCaseUID&DEL_INDEX=1"); , it creates a subprocess case in the draft section since I also call this function to get back to the main process. Also, when it gets back to the main process, the INDEX hasn't changed so the row that I added in the grid doesn't appear in the form.

Would there be a better way to use subprocesses without having to go to the inbox each time I create a new subprocess case?
#793804
If you are redirecting the web browser to the subprocess case in a trigger that is fired after a Dynaform, then you will need to manually save the variables from the DynaForm with PMFSendVariables() before redirecting. See Example 2 in http://wiki.processmaker.com/3.0/Proces ... Step.28.29

To change the status of the subprocess case from Draft to To Do, see:
http://wiki.processmaker.com/3.2/Trigge ... s_to_TO_DO
stevensi1018 wrote:Would there be a better way to use subprocesses without having to go to the inbox each time I create a new subprocess case?
Instead of using subprocesses, you can just use PMFNewCase() in a trigger to create the new case in another process, then redirect the web browser the new case. You can use PMFSendVariables to send variables from one case to another.
#793818
amosbatto wrote:If you are redirecting the web browser to the subprocess case in a trigger that is fired after a Dynaform, then you will need to manually save the variables from the DynaForm with PMFSendVariables() before redirecting. See Example 2 in http://wiki.processmaker.com/3.0/Proces ... Step.28.29

To change the status of the subprocess case from Draft to To Do, see:
http://wiki.processmaker.com/3.2/Trigge ... s_to_TO_DO
stevensi1018 wrote:Would there be a better way to use subprocesses without having to go to the inbox each time I create a new subprocess case?
Instead of using subprocesses, you can just use PMFNewCase() in a trigger to create the new case in another process, then redirect the web browser the new case. You can use PMFSendVariables to send variables from one case to another.
Thanks again for your help, I actually forgot to send my grid in the variables so it was always resetting. It looks to works like I wanted now
REST API Question

I am currently looking at developing a portlet for[…]

Everybody wants to be famous, but nobody wants to […]

Hi, I attached a sample config file, Please check […]

Error clicking on Participated

Hi, I attached a sample config file, Please check […]