Hi everybody,
I want to register 2 plugins to make a infinite loop of updating field.
Plugin1 monitors the [update] message of cr2ab_folder entity on cr2ab_prop1 attribute and executes on PreOperation stage.

And here is the source of plugin1:
if (context.Depth > 1) {
trace.Trace("loop !!!");
throw new InvalidPluginExecutionException("loop hassei");
}
cr2ab_Folder f = (context.InputParameters["Target"] as Entity).ToEntity<cr2ab_Folder>();
f.cr2ab_prop2 = f.cr2ab_prop1;
Plugin2 monitors the [update] message of cr2ab_folder entity on cr2ab_prop2 attribute and also executes on PreOperation stage.

And here is the source of plugin2:
if (context.Depth > 1) {
trace.Trace("loop !!!");
throw new InvalidPluginExecutionException("loop hassei 。");
}
cr2ab_Folder f = (context.InputParameters["Target"] as Entity).ToEntity<cr2ab_Folder>();
f.cr2ab_prop1 = f.cr2ab_prop2 + 1;
When I change the prop1 on form to 10, then prop2 will be 10 and the prop1 will be 101, And I am sure the plugin1 and plugin2 is only executed one time.
I am confused why the infinite loop error did not happen??
The question is :
1, Although I changed only the prop2 value in plugin1, the prop1 is also set in the variable f. Why it does not triger the Update message of prop1 when the system updates the [folder] entity on MainOperation stage?
2, If the update of prop2 happened in plugin1 trigered the plugin2, why the update of prop1 did not triger the plugin1 again?
3, If I change the plugin1 to below:
if (context.Depth > 1) {
trace.Trace("loop !!!");
throw new InvalidPluginExecutionException("loop hassei");
}
cr2ab_Folder f = (context.InputParameters["Target"] as Entity).ToEntity<cr2ab_Folder>();
trace.Trace("not loop !!");
f.cr2ab_prop2 = f.cr2ab_prop1;
service.Update(f);
I got the infinite loop error ,

but the trace log will never stop ......
You can see the message is outputted per minute and paired, one is "loop !!!" and one is "not loop !!"

I know the service.update(f) makes the error, but when the dialog is showed, the plugin should be stopped by system, why the execution continues??
Thank you very much!
Any reply or web resource will be appreciated !!
Best regards
justin