Commit a940c6ae authored by Florine Boudin's avatar Florine Boudin
Browse files

BS-11314 Fix Validation and migration

- Validation is not done on an FileWidgetAction if the "download only"
option is true
- Migration on FileWidget operation completed : a referenced document in
leftOperand missed its referencedElement property.
Conflicts:
	bundles/plugins/org.bonitasoft.studio.migration/src/org/bonitasoft/studio/migration/custom/migration/form/FileWidgetDocumentMigration.java
parent cd80e35e
......@@ -34,3 +34,4 @@ Export-Package: org.bonitasoft.studio.migration,org.bonitasoft.studio.
oft.studio.migration.ui.wizard,org.bonitasoft.studio.migration.utils
Bundle-ClassPath: .,
lib/itextpdf-5.3.5.jar
Import-Package: org.bonitasoft.engine.operation
......@@ -47,6 +47,7 @@ public class FileWidgetDocumentMigration extends CustomMigration {
}
}
documents = model.getAllInstances("process.Document");
}
......
......@@ -19,6 +19,7 @@ import org.bonitasoft.studio.expression.editor.operation.OperatorViewerFilter;
import org.bonitasoft.studio.model.expression.Expression;
import org.bonitasoft.studio.model.expression.Operation;
import org.bonitasoft.studio.model.expression.Operator;
import org.bonitasoft.studio.model.form.FileWidget;
import org.bonitasoft.studio.validation.i18n.Messages;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.validation.IValidationContext;
......@@ -35,6 +36,10 @@ public class OperatorConsistencyConstraint extends AbstractLiveValidationMarkerC
@Override
protected IStatus performBatchValidation(final IValidationContext context) {
final Operation operation = (Operation) context.getTarget();
final Object operationContainer = operation.eContainer();
if (operationContainer instanceof FileWidget && ((FileWidget) operationContainer).isDownloadOnly()) {
return context.createSuccessStatus();
}
final OperatorViewerFilter filter = new OperatorViewerFilter(operation);
final Operator operator = operation.getOperator();
final Expression leftOperand = operation.getLeftOperand();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment