private async Task <string> RaiseOutcomeAsync(ExecutionThread executionThread, ITXID sourceTXID, Outcome outcome)
        {
            var executingComponent = executionThread.ExecutingComponents.FirstOrDefault(
                e => e.ExecutingID == sourceTXID.xid
                );

            var parentExecutingComponent = executionThread.ExecutingComponents.FirstOrDefault(
                e => e.ExecutingID == executingComponent.ParentExecutingID
                );

            executionThread.ComponentExecutingID    = parentExecutingComponent.ExecutingID;
            executionThread.ExecutingComponentTitle = parentExecutingComponent.Title;
            executionThread.ExecutionStatus         = (int)LogicalUnitStatusEnum.Started; // TODO: Strictly necessary here?

            outcome.SourceExecutionID = sourceTXID.xid;
            outcome.TargetExecutionID = executingComponent.ParentExecutingID;

            executionThread.PendingOutcomeJson = JsonConvert.SerializeObject(outcome);
            //executionThread.PendingOutcomeJson = CoreFunctions.ProxyAsJson(outcome);

            await AppExecutionApiClient.SaveExecutionThreadAsync(executionThread);

            return(parentExecutingComponent.URL);
        }
 // TODO: Need whole new method to kaunch a secondary app from the current execution thread.
 public async Task <string> RedirectLaunchAppAsync(ITXID parentTXID, string componentInterfaceFullname) // Potentially more params to come inc. returnTaskId, forceContextSearch, etc
 {
     // Temporary !!
     return(await RedirectLaunchAppAsync(componentInterfaceFullname, null));
 }
        public async Task <string> RaiseOutcomeAsync(ITXID sourceTXID, Outcome outcome)
        {
            var executionThread = await AppExecutionApiClient.LoadExecutionThreadAsync(sourceTXID.tid);

            return(await RaiseOutcomeAsync(executionThread, sourceTXID, outcome));
        }