Custom Rule Action does not deliver actionItems2 parameter in ExecuteAction2

According to the BatAction example we implemented a RuleAction.ActionManager which returns an ActionDefinition with two ActionElements, onbe of which is of Kind.Camera and a custom Kind. The custom kind we registered in the PluginDefitnition as a ItemNode of the same custom Kind which is used for the ActionElement.

This works as far as we can select the camera and the custom kind, which represents a time span in this case. The selections are persisted and the rule is executed according to the trigger definition.

But, when the actual call to RuleAction.ActionManager.ExecuteAction2 is made, the parameter for the second action item actionItems2 is empty.

In the log of the Event Server we see the following two entries which appear at the same time, rule is triggered:

2025-09-15 15:13:00.217+02:00 [ 184] ERROR - MipActionHandler Unknown event source. Source: a6eafb52-f591-451d-b02e-522d3f875811

2025-09-15 15:13:00.217+02:00 [ 184] ERROR - MipActionHandler Failed to lookup action target. Id = 3b4be07d-d538-4fec-b0ec-0d644cea6603

Maybe you can push us in the right direction here?

Thx

Daniel

First idea and question. Is the plugin loaded in both the Management Client and the Event Server?

Yes. I can see the Init() call in both logs, Event Server and Management Client. The Background Plugin is also loaded for the Event Server.

The Guid for the custom Kind is also the same for the ItemNodes and ActionDefinition.

The second Guid mentioned in the two log entries above (target.Id 3b4be07d-d538-4fec-b0ec-0d644cea6603), is one of our custom Kind “Time ranges”.

The first Guid called Event Source we can not find anywhere.

Could you please try run the BAT action sample and see if you see the same with that? From your description it seems like it is very much the same, but I just tried it and it seems to work fine.

Also, I tried to look up the a6eafb52-f591-451d-b02e-522d3f875811 and it seems to be related to rules that are triggered periodically/recurring. Does this match the rule you have? That said I tried to make one like that and still could not reproduce, so if you can provide details about the rule it would be greatly appreciated.

Hi Peter!

The BAT Action Example is running fine with an identical rule!

As you suggested, we defined a rule that is running periodically at a specific time once a day. So this explains the other Guid we see in the log.

Our plugin does not only have the Background Plugin running on the Event Server, but also creates ItemNodes that appear in the Management Client for configuration and in the Desk Client we have ViewItemPlugins and WorkspaceToolbarPlugins running.

I have the feeling we are missing something quite obvious, but can’t get my mind around it.

Why would the built-in event source be unknown to the Event Server?

Since it is not happening for the BAT action sample I tend to think that the “Unknown event source” is a side effect of the other one, so let us focus on the other one for now.

The code reporting the “Failed to lookup action target” is trying to look up the FQID of the item you have selected, so my guess is that something is going wrong in the ItemManager delivered by your plug-in. Maybe you can put some logging in the GetItem methods and see whether they are called when the rule executes and if so whether they succeed in looking up the Item?

When the rule executes, the ItemManager’s GetItem methods are not called at all.

The GetItems() is called when configuring the rule. The GetItem(…) methods with parameters are never called.

Here is the GetItems() implementation:

public override List GetItems()

{

List items = new List();

EnvironmentManager.Instance.Log( false, “RadiometryGraphsExportItemManager::GetItems():”, $“” );

foreach( var intervalItem in _exportIntervals )

{

EnvironmentManager.Instance.Log( false, "RadiometryGraphsExportItemManager::GetItems", $"Item registered: Key:{intervalItem.Key} Value:{intervalItem.Value}" );

items.Add(

  new Item( new FQID( EnvironmentManager.Instance.MasterSite.ServerId,

  Guid.Empty,

  intervalItem.Key,

  [FolderType.No](https://FolderType.No),

  RadiometryGraphsDefinition.\_exportActionKind )

  { ObjectId = intervalItem.Key },

 intervalItem.Value ) );

}

return items;

}

_exportIntervals looks like this:

public static Dictionary<Guid, string> _exportIntervals = new Dictionary<Guid, string>() {

 { new Guid("9dcf878a-a2ae-4be7-86e5-c15a8015f4c0"), "24 h" },

 { new Guid("8174ab13-fca0-4481-9633-0b471c3d5fd6"), "12 h" },

 { new Guid("6688f6dd-1bc2-4edf-95a0-66dd9fc6b969"), "6 h" },

 { new Guid("3b4be07d-d538-4fec-b0ec-0d644cea6603"), "3 h" },

 { new Guid("a0e00f24-9cf6-4dd3-bf82-280f0604219b"), "1 h" },

 { new Guid("19fe530e-9a34-4222-b1c9-b03c5e8285cb"), "30 min" },

 { new Guid("4d53866d-8b94-4381-9f65-b574e7bd0795"), "10 min" },

 { new Guid("2f2a7500-49d5-4eca-a3f8-8b80e767113c"), "5 min" },

 { new Guid("c0c4f0db-b5d1-49ed-b686-33f3f99e024c"), "1 min" },

 };

and logged is this:

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems():

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:9dcf878a-a2ae-4be7-86e5-c15a8015f4c0 Value:24 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:8174ab13-fca0-4481-9633-0b471c3d5fd6 Value:12 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:6688f6dd-1bc2-4edf-95a0-66dd9fc6b969 Value:6 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:3b4be07d-d538-4fec-b0ec-0d644cea6603 Value:3 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:a0e00f24-9cf6-4dd3-bf82-280f0604219b Value:1 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:19fe530e-9a34-4222-b1c9-b03c5e8285cb Value:30 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:4d53866d-8b94-4381-9f65-b574e7bd0795 Value:10 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:2f2a7500-49d5-4eca-a3f8-8b80e767113c Value:5 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:c0c4f0db-b5d1-49ed-b686-33f3f99e024c Value:1 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems():

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:9dcf878a-a2ae-4be7-86e5-c15a8015f4c0 Value:24 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:8174ab13-fca0-4481-9633-0b471c3d5fd6 Value:12 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:6688f6dd-1bc2-4edf-95a0-66dd9fc6b969 Value:6 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:3b4be07d-d538-4fec-b0ec-0d644cea6603 Value:3 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:a0e00f24-9cf6-4dd3-bf82-280f0604219b Value:1 h

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:19fe530e-9a34-4222-b1c9-b03c5e8285cb Value:30 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:4d53866d-8b94-4381-9f65-b574e7bd0795 Value:10 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:2f2a7500-49d5-4eca-a3f8-8b80e767113c Value:5 min

2025-09-17 14:03:13.926+02:00 [ 113] INFO - RadiometryGraphsExportItemManager::GetItems Item registered: Key:c0c4f0db-b5d1-49ed-b686-33f3f99e024c Value:1 min

Does this give us a hint?

Hi again,

We are simply not able to figure out from the code (yours and ours) what is happening. Would it be possible for you to share something that can reproduce? If you don’t want to share it here, maybe then create a support case?

Hi all,

to bring this to a proper close: the problem was, we added an ItemNode in Event Server context which was intended to create an item in the Administration Client tree view. This caused an Exception during Startup of the Event Server and prevented the custom kind Item Node for the Rule Action not to be loaded in that context. It was not possible to attach the debugger to the Event Server during startup before the exception and we missed it out in the log the whole time.

So, apologies for creating too much concern on your side. You can close the case.

The journey continues! :slight_smile:

Glad you found your way forward and thanks a lot for sharing it here.

Regarding the debugging of the Event Server you can start it directly from the debugger by providing the -x parameter as described here: https://doc.developer.milestonesys.com/mipsdk/?base=gettingstarted%2Fplug-in_development.html&tree=tree_Search.html

Just make sure you remember to stop the service before doing so.