import org.ngbw.directclient.CiApplication;
import org.ngbw.directclient.CiCipresException;
import org.ngbw.directclient.CiClient;
+import org.ngbw.directclient.CiJob;
import org.ngbw.restdatatypes.ErrorData;
import org.ngbw.restdatatypes.ParamError;
private Map<String, String> metadata = new HashMap<>();
+ private boolean paramsValidated = false;
+
public TreeJob()
{
cipresClient = new CiClient(
public void addInputParameter(String parameter, String value)
{
inputParams.put(parameter, value);
+ paramsValidated = false;
}
public void addToolParameters(String parameter, Collection<String> values)
{
vParams.put(parameter, values);
+ paramsValidated = false;
}
/**
public void addMetadata(String metadataHeader, String value)
{
metadata.put(metadataHeader, value);
+ paramsValidated = false;
}
public void clearAllParameters()
{
try
{
- cipresClient.validateJob(toolName, vParams, inputParams, metadata);
+ CiJob validateJob = cipresClient
+ .validateJob(toolName, vParams, inputParams, metadata);
+ validateJob.show(true); // currently outputs just to console, should be
+ // graphical
+ paramsValidated = true;
+
} catch (CiCipresException ce)
{
+ paramsValidated = false; // parameters gave an error.
ErrorData ed = ce.getErrorData();
System.out.println(
"Cipres error while trying to validate parameters, code="
}
+ public void submitJob(String toolName)
+ {
+ if (!paramsValidated)
+ {
+ validateJobParams(toolName); // validate before running some expensive job
+ // first
+ }
+
+ }
+
}