/////////////////////////////////////////////////////////////////////// // HELPERS // private bool setOutput(string output, Record recordOut) { // Output Field is last AlteryxRecordInfoNet.FieldBase fbOut = _recordInfoOut[(int)_recordInfoIn.NumFields()]; fbOut.SetFromString(recordOut, output); _outputHelper.PushRecord(recordOut.GetRecord()); return(true); }
public bool II_PushRecord(RecordData recordDataIn) { prepRecordInfoOut(); string secret = getFieldBaseStringData(_secretField, recordDataIn); string message = getFieldBaseStringData(_messageField, recordDataIn); AlteryxRecordInfoNet.Record recordOut = _recordInfoOut.CreateRecord(); recordOut.Reset(); // Transfer existing data copyRecordData(recordDataIn, recordOut); string sHash = performHash(secret, message); // Output Field is last AlteryxRecordInfoNet.FieldBase fbOut = _recordInfoOut[(int)_recordInfoIn.NumFields()]; fbOut.SetFromString(recordOut, sHash); _outputHelper.PushRecord(recordOut.GetRecord()); return(true); }
public bool II_PushRecord(RecordData recordDataIn) { DebugMessage($"II_PushRecord() Entering; ToolID={_toolID}"); // The same object is used in each call, so reset the result fields before using them. _retCode = ""; _cmdLine = ""; lock (_sbStdOutLock) { _sbStdOut.Clear(); } lock (_sbExceptionsLock) { _sbExceptions.Clear(); } // Check the paths to Executable and Script... string exePath = getFieldBaseStringData(_exePathField, recordDataIn); checkValidPath(exePath, _exePathField); // Do the magic shell(exePath, getArguments(recordDataIn)); // Get the output string stdOut = ""; lock (_sbStdOutLock) { stdOut = _sbStdOut.ToString(); } // Get the exceptions string exceptions = ""; lock (_sbExceptionsLock) { exceptions = _sbExceptions.ToString(); } // Prepare the output AlteryxRecordInfoNet.Record recordOut = _recordInfoOut.CreateRecord(); recordOut.Reset(); // Transfer existing data _recordCopier.Copy(recordOut, recordDataIn); // Set Output Fields var numInputFields = (int)_recordInfoIn.NumFields(); AlteryxRecordInfoNet.FieldBase fbStdOut = _recordInfoOut[numInputFields]; fbStdOut.SetFromString(recordOut, stdOut); AlteryxRecordInfoNet.FieldBase fbRetCode = _recordInfoOut[numInputFields + 1]; fbRetCode.SetFromString(recordOut, _retCode); AlteryxRecordInfoNet.FieldBase fbExceptions = _recordInfoOut[numInputFields + 2]; fbExceptions.SetFromString(recordOut, exceptions); AlteryxRecordInfoNet.FieldBase fbDiagnostics = _recordInfoOut[numInputFields + 3]; fbDiagnostics.SetFromString(recordOut, _cmdLine); // Output _outputHelper.PushRecord(recordOut.GetRecord()); // Clear the accumulated strings for next record _retCode = ""; _cmdLine = ""; lock (_sbStdOutLock) { _sbStdOut.Clear(); } lock (_sbExceptionsLock) { _sbExceptions.Clear(); } DebugMessage($"II_PushRecord() Exiting; ToolID={_toolID}"); return(true); }