Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
As Anders mentioned, this doesn't work with Async subflows. If anyone is interested, I was able to accomplish this with a combination of Async subflows and Bean Tools. I have a Bean Tool in the parent flow that puts the parent ProcessId in a workflow variable:
import org.joget.workflow.model.service.*; WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager"); wm.activityVariable(workflowAssignment.getActivityId(),"wfProcessId", "#assignment.processId#");
The `wfProcessId` is passed into the subflow as an IN variable.
Then I have a Bean Tool as the last step in the Async SubFlow that passes the workflow variables that were set in the subflow, back up to the parent flow.
import org.joget.workflow.model.service.*; import java.lang.Exception; import org.joget.commons.util.LogUtil; WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager"); wm.processVariable("#variable.wfProcessId#", "wfParentFlowVariableName", "#variable.wfSubFlowVariableName#");
If there's an easier way to do this, please let me know.
Thanks!
Hi, found a working example at Sample Application with Subflow. I think it could be because your subflow execution is asynchronous, in which case the process continues without waiting for the results of the subflow.
Thanks Anders . That's what I found as well. I should have mentioned that switching it to Synchronous works fine. The problem is that I need an async subflow. Is there a way for an async subflow to interact with the workflow variables of the parent process? I guess I could do this with something like the [Multiple Approval](https://dev.joget.org/community/display/KBv6/Multiple+Approval) example, but I was hoping to be able to use the subflow framework. Thanks
I have a simple Async Subflow that accepts in a couple workflow variables using the "In and Out" option. The Variable values are successfully passed to the SubFlow, but when the Subflow finishes, the updated values are not passed back to the parent process.
Attached you will find a simple application to demonstrate the issue. APP_testSubFlow-1-20171113221419.jwa
Is there a way to make this work?