Communicating from child workflow to Parent

Hi Team,
I am working on Temporal Java and I have a use case where I need to send a parameter received on a child workflow (through a signal event )to the Parent. Based on this value parent needs to route the workflow to a different logic. Is it possible to send the signal method outcome from child to parent?

Thanks in advance

Yes, i solved this by sending to parentworkflowId as param to child and as input for the signal to parent again:

Java example:

/**
     * get the 'current' workflow that is running and give it a signal
     */
    public void runningFlow(String workflowId, String signalName, Object signalValue) {
        WorkflowExecution workflowExecution = WorkflowExecution.newBuilder().setWorkflowId(workflowId).build();
        WorkflowStub workflow = getWorkflowClient().newUntypedWorkflowStub(workflowExecution, Optional.of("signal-parent"));
        workflow.signal(signalName, signalValue);
    }

You cannot use workflow client inside the workflow code as any external IO is prohibited in the workflow code. Use external workflow stub instead:

String parentId = Workflow.getInfo().getParentWorkflowId().get();
Parent parent = Workflow.newExternalWorkflowStub(Parent.class, parentId);
parent.signalMethod();

I did not know this way existed, thanks for better way