Trying to simplify multifle if-else conditions . Below code is throwing error " Error: Compile Error: Expression cannot be a statement. " . Can you please let me know how to resolve the issue ?
if (hasFailedBatches) {
Boolean inDMode = run.Run_Mode__c == 'inDMode' ? true:false;
inDMode ? input.put('Status', 'Failed'):input.put('Status', 'Retrival fialed');
}