mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Fix bulk process PVS rendering
This commit is contained in:
@ -113,13 +113,13 @@ public class RunProcessAction
|
|||||||
{
|
{
|
||||||
case BREAK ->
|
case BREAK ->
|
||||||
{
|
{
|
||||||
LOG.info("Breaking process [" + process.getName() + "] at frontend step (as requested by caller): " + step.getName());
|
LOG.trace("Breaking process [" + process.getName() + "] at frontend step (as requested by caller): " + step.getName());
|
||||||
processState.setNextStepName(step.getName());
|
processState.setNextStepName(step.getName());
|
||||||
break STEP_LOOP;
|
break STEP_LOOP;
|
||||||
}
|
}
|
||||||
case SKIP ->
|
case SKIP ->
|
||||||
{
|
{
|
||||||
LOG.info("Skipping frontend step [" + step.getName() + "] in process [" + process.getName() + "] (as requested by caller)");
|
LOG.trace("Skipping frontend step [" + step.getName() + "] in process [" + process.getName() + "] (as requested by caller)");
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// much less error prone in case this code changes in the future... //
|
// much less error prone in case this code changes in the future... //
|
||||||
@ -129,7 +129,7 @@ public class RunProcessAction
|
|||||||
}
|
}
|
||||||
case FAIL ->
|
case FAIL ->
|
||||||
{
|
{
|
||||||
LOG.info("Throwing error for frontend step [" + step.getName() + "] in process [" + process.getName() + "] (as requested by caller)");
|
LOG.trace("Throwing error for frontend step [" + step.getName() + "] in process [" + process.getName() + "] (as requested by caller)");
|
||||||
throw (new QException("Failing process at step " + step.getName() + " (as requested, to fail on frontend steps)"));
|
throw (new QException("Failing process at step " + step.getName() + " (as requested, to fail on frontend steps)"));
|
||||||
}
|
}
|
||||||
default -> throw new IllegalStateException("Unexpected value: " + runProcessInput.getFrontendStepBehavior());
|
default -> throw new IllegalStateException("Unexpected value: " + runProcessInput.getFrontendStepBehavior());
|
||||||
@ -313,7 +313,7 @@ public class RunProcessAction
|
|||||||
QStepMetaData step = process.getStep(stepName);
|
QStepMetaData step = process.getStep(stepName);
|
||||||
if(step == null)
|
if(step == null)
|
||||||
{
|
{
|
||||||
throw(new QException("Could not find a step named [" + stepName + "] in this process."));
|
throw (new QException("Could not find a step named [" + stepName + "] in this process."));
|
||||||
}
|
}
|
||||||
result.add(step);
|
result.add(step);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValue;
|
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValue;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSource;
|
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSource;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSourceType;
|
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSourceType;
|
||||||
@ -48,6 +49,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
|||||||
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
||||||
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
||||||
import com.kingsrook.qqq.backend.core.utils.ListingHash;
|
import com.kingsrook.qqq.backend.core.utils.ListingHash;
|
||||||
|
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -145,7 +147,7 @@ public class QPossibleValueTranslator
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** For a given field and (raw/id) value, get the translated (string) value.
|
** For a given field and (raw/id) value, get the translated (string) value.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
String translatePossibleValue(QFieldMetaData field, Serializable value)
|
public String translatePossibleValue(QFieldMetaData field, Serializable value)
|
||||||
{
|
{
|
||||||
QPossibleValueSource possibleValueSource = qInstance.getPossibleValueSource(field.getPossibleValueSourceName());
|
QPossibleValueSource possibleValueSource = qInstance.getPossibleValueSource(field.getPossibleValueSourceName());
|
||||||
if(possibleValueSource == null)
|
if(possibleValueSource == null)
|
||||||
@ -154,6 +156,11 @@ public class QPossibleValueTranslator
|
|||||||
return (null);
|
return (null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(field.getType().equals(QFieldType.INTEGER) && !(value instanceof Integer))
|
||||||
|
{
|
||||||
|
value = ValueUtils.getValueAsInteger(value);
|
||||||
|
}
|
||||||
|
|
||||||
return translatePossibleValue(possibleValueSource, value);
|
return translatePossibleValue(possibleValueSource, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ package com.kingsrook.qqq.backend.core.processes.implementations.bulk.edit;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import com.kingsrook.qqq.backend.core.actions.values.QPossibleValueTranslator;
|
||||||
import com.kingsrook.qqq.backend.core.actions.values.QValueFormatter;
|
import com.kingsrook.qqq.backend.core.actions.values.QValueFormatter;
|
||||||
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessSummaryLine;
|
import com.kingsrook.qqq.backend.core.model.actions.processes.ProcessSummaryLine;
|
||||||
@ -167,7 +168,18 @@ public class BulkEditTransformStep extends AbstractTransformStep
|
|||||||
String verb = isExecuteStep ? "was" : "will be";
|
String verb = isExecuteStep ? "was" : "will be";
|
||||||
if(StringUtils.hasContent(ValueUtils.getValueAsString(value)))
|
if(StringUtils.hasContent(ValueUtils.getValueAsString(value)))
|
||||||
{
|
{
|
||||||
String formattedValue = qValueFormatter.formatValue(field, value); // todo - PVS!
|
String formattedValue = qValueFormatter.formatValue(field, value);
|
||||||
|
|
||||||
|
if(field.getPossibleValueSourceName() != null)
|
||||||
|
{
|
||||||
|
QPossibleValueTranslator qPossibleValueTranslator = new QPossibleValueTranslator(runBackendStepInput.getInstance(), runBackendStepInput.getSession());
|
||||||
|
String translatedValue = qPossibleValueTranslator.translatePossibleValue(field, value);
|
||||||
|
if(StringUtils.hasContent(translatedValue))
|
||||||
|
{
|
||||||
|
formattedValue = translatedValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
summaryLine.setMessage(label + " " + verb + " set to: " + formattedValue);
|
summaryLine.setMessage(label + " " + verb + " set to: " + formattedValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -59,7 +59,7 @@ public class StreamedETLValidateStep extends BaseStreamedETLStep implements Back
|
|||||||
boolean supportsFullValidation = runBackendStepInput.getValuePrimitiveBoolean(StreamedETLWithFrontendProcess.FIELD_SUPPORTS_FULL_VALIDATION);
|
boolean supportsFullValidation = runBackendStepInput.getValuePrimitiveBoolean(StreamedETLWithFrontendProcess.FIELD_SUPPORTS_FULL_VALIDATION);
|
||||||
if(!supportsFullValidation)
|
if(!supportsFullValidation)
|
||||||
{
|
{
|
||||||
LOG.info("Process does not support validation, so skipping validation step");
|
LOG.debug("Process does not support validation, so skipping validation step");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public class StreamedETLValidateStep extends BaseStreamedETLStep implements Back
|
|||||||
boolean doFullValidation = runBackendStepInput.getValuePrimitiveBoolean(StreamedETLWithFrontendProcess.FIELD_DO_FULL_VALIDATION);
|
boolean doFullValidation = runBackendStepInput.getValuePrimitiveBoolean(StreamedETLWithFrontendProcess.FIELD_DO_FULL_VALIDATION);
|
||||||
if(!doFullValidation)
|
if(!doFullValidation)
|
||||||
{
|
{
|
||||||
LOG.info("Not requested to do full validation, so skipping validation step");
|
LOG.trace("Not requested to do full validation, so skipping validation step");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ public class ScheduleManager
|
|||||||
if(propertyValue.equals("false"))
|
if(propertyValue.equals("false"))
|
||||||
{
|
{
|
||||||
LOG.warn("Not starting ScheduleManager (per system property [" + propertyName + "=" + propertyValue + "]).");
|
LOG.warn("Not starting ScheduleManager (per system property [" + propertyName + "=" + propertyValue + "]).");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(QQueueProviderMetaData queueProvider : qInstance.getQueueProviders().values())
|
for(QQueueProviderMetaData queueProvider : qInstance.getQueueProviders().values())
|
||||||
|
Reference in New Issue
Block a user