You can pass one or more context variables from a child process flow to a parent flow using a custom plugin when Redis is enabled.
Please refer below plugin script for more details:
import java.util.*;
import com.adeptia.indigo.system.*;
import com.adeptia.indigo.utils.*;
import com.adeptia.indigo.utils.ApplicationUtil;
Context parentContext = null;
if (ApplicationUtil.isRedisEnabled() && context.isDistributedChild()) {
parentContext = context.getDistributedChildParentContext();
} else {
ObjectAddress objectAddress = (ObjectAddress) context.getParentContextAddress();
if (objectAddress != null) {
parentContext = (Context) MBeanUtils.getMBeanProxy(objectAddress, Context.class);
}
}
if (parentContext != null) {
parentContext.put("returnAccessToken", context.get("accessToken"));
}
The provided code works in both scenarios—whether Redis is enabled or not.
However, if you choose not to enable Redis, you can use the alternative code available at the following link:
Comments
1 comment
Please add use case as well.
Please sign in to leave a comment.