Select to view content in your preferred language

FieldException: Cannot set field on a immutable GeoEvent

1496
2
12-17-2013 05:48 AM
by Anonymous User
Not applicable
Original User: LuisARG_Esri

I have developed a Processor that modify a GeoEvent. When it's done a set in a GeoEvent field, it's thrown the following exception
com.esri.ges.core.geoevent.FieldException: Cannot set field on a immutable GeoEvent

Why the GeoEvent is immutable? How can I convert the GeoEvent to mutable.
public GeoEvent process(GeoEvent geoEvent) throws Exception
{
        try
        {
         geoEvent.setField("RateOfTurn", new Integer(0));
0 Kudos
2 Replies
VladislavPlechnoy
New Contributor III
Hi LuisARG_Esri,

Instance of GeoEvent your processor receives from the event processing framework (EPF) is immutable because by default any processor IS NOT a GeoEvent Mutator. In order to change this behavior you need to override the following method inside of your processor code as follows:

public boolean isGeoEventMutator() { return true; }

This will tell EPF that your processor IS GeoEvent Mutator that should operate on its own instance of GeoEvent. EPF will cook it up for your processor and pass it in the [public GeoEvent process(GeoEvent geoEvent) throws Exception] method.

This should resolve the issue you reported.

Thanks,
Vlad Plechnoy.
0 Kudos
by Anonymous User
Not applicable
Original User: LuisARG_Esri

Hello, your solution works.

Thank you very much.

Regards
0 Kudos