Exemplo n.º 1
0
        public async Task OnGet(string processNumber)
        {
            ProcessNumber = processNumber;
            var process = _applicationServer.Processes.LoadProcess(processNumber);

            if (process == null)
            {
                throw new Exception($"There is no process with processId={processNumber}");
            }

            ProcessInstanceContainer = _serializer.Serialize(process.ProcessData.ProcessInstanceContainer);
            ProcessId = process.ProcessData.ProcessId;


            //remove $type from full serialization
            ProcessInstanceContainer = ProcessInstanceContainer
                                       .Replace("\\\"", "`").Replace("\r", "").Replace("\n", "")
                                       .Replace("\"{", "{").Replace("}\"", "}").Replace("\\", "");

            ProcessState = _serializer.Serialize(process);
            ProcessState = ProcessState
                           .Replace("\\\"", "`").Replace("\r", "").Replace("\n", "")
                           .Replace("\"{", "{").Replace("}\"", "}").Replace("\\", "");
        }