Skip to content

Commit 5ff3f06

Browse files
committed
Trigger interface changes
1 parent c995138 commit 5ff3f06

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

api/src/org/labkey/api/data/triggers/ScriptTrigger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void beforeInsert(TableInfo table, Container c,
182182

183183
@Override
184184
public void beforeUpdate(TableInfo table, Container c,
185-
User user, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow,
185+
User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow,
186186
ValidationException errors, Map<String, Object> extraContext)
187187
{
188188
invokeTableScript(table, c, user, "beforeUpdate", errors, extraContext, filterErrorDetailByPhi(table, () -> "New row: " + newRow + ". Old row: " + oldRow), newRow, oldRow);

api/src/org/labkey/api/data/triggers/Trigger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ default void rowTrigger(TableInfo table, Container c, User user, TableInfo.Trigg
209209
beforeInsert(table, c, user, insertOption, newRow, errors, extraContext, existingRecord);
210210
break;
211211
case UPDATE:
212-
beforeUpdate(table, c, user, newRow, oldRow, errors, extraContext);
212+
beforeUpdate(table, c, user, insertOption, newRow, oldRow, errors, extraContext);
213213
break;
214214
case DELETE:
215215
beforeDelete(table, c, user, oldRow, errors, extraContext);
@@ -247,7 +247,7 @@ default void beforeInsert(TableInfo table, Container c,
247247
}
248248

249249
default void beforeUpdate(TableInfo table, Container c,
250-
User user, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow,
250+
User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow,
251251
ValidationException errors, Map<String, Object> extraContext) throws ValidationException
252252
{
253253
}

assay/src/org/labkey/assay/plate/AssayPlateTriggerFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.labkey.api.qc.DataState;
2222
import org.labkey.api.query.BatchValidationException;
2323
import org.labkey.api.query.FieldKey;
24+
import org.labkey.api.query.QueryUpdateService;
2425
import org.labkey.api.query.ValidationException;
2526
import org.labkey.api.security.User;
2627
import org.labkey.api.util.UnexpectedException;
@@ -163,6 +164,7 @@ public void beforeUpdate(
163164
TableInfo table,
164165
Container c,
165166
User user,
167+
@Nullable QueryUpdateService.InsertOption insertOption,
166168
@Nullable Map<String, Object> newRow,
167169
@Nullable Map<String, Object> oldRow,
168170
ValidationException errors,

assay/src/org/labkey/assay/plate/data/WellTriggerFactory.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ private class ValidateRunImportedPlateTrigger implements Trigger
5454

5555
@Override
5656
public void beforeUpdate(
57-
TableInfo table,
58-
Container c,
59-
User user,
60-
@Nullable Map<String, Object> newRow,
61-
@Nullable Map<String, Object> oldRow,
62-
ValidationException errors,
63-
Map<String, Object> extraContext
57+
TableInfo table,
58+
Container c,
59+
User user,
60+
@Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow,
61+
@Nullable Map<String, Object> oldRow,
62+
ValidationException errors,
63+
Map<String, Object> extraContext
6464
) throws ValidationException
6565
{
6666
if (oldRow == null || errors.hasErrors() || !oldRow.containsKey(WellTable.Column.PlateId.name()))
@@ -165,6 +165,7 @@ public void beforeUpdate(
165165
TableInfo table,
166166
Container c,
167167
User user,
168+
@Nullable QueryUpdateService.InsertOption insertOption,
168169
@Nullable Map<String, Object> newRow,
169170
@Nullable Map<String, Object> oldRow,
170171
ValidationException errors,

0 commit comments

Comments
 (0)