Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue with the Retry Method in Inspectors #654

Closed
mhareznik opened this issue Oct 10, 2023 · 1 comment
Closed

[BUG] Issue with the Retry Method in Inspectors #654

mhareznik opened this issue Oct 10, 2023 · 1 comment
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@mhareznik
Copy link
Collaborator

mhareznik commented Oct 10, 2023

It appears that the Retry method on Inspectors is not functioning as expected. Currently, after setting a finite number of retries, inspections continue indefinitely, potentially causing a loop in the process.

Example:
Station.ProcessDataManager.Data.CU00x.BoltPresenceInspector.Data.FailureDescription:='BoltPresenceInspector error';
Station.ProcessDataManager.Data.CU00x.BoltPresenceInspector.WithCoordinator(THIS^)
.Inspect(_inspectionResult)
.UpdateComprehensiveResult(Station.ProcessDataManager.Data.EntityHeader.Results)
.OnFail()
.Retry(999);

The expected behavior is that after a defined number of retries, the process should terminate, and the sequence should jump to the RESTORE_STEP_ID step.

@mhareznik mhareznik added bug Something isn't working question Further information is requested labels Oct 10, 2023
@PTKu PTKu assigned peterbarancek and unassigned PTKu Oct 10, 2023
@peterbarancek
Copy link
Collaborator

If NumberOfAllowedRetries is equal zero, number of retries will be infinite, but if you define a limit(in example below is 100) , then you can check property OverInspected and write your own scenario.

this may be solution :

IF (Step(1100, TRUE, 'SINGLE ANALOGUE INSPECTION')) THEN
//-------------------------------------
Station.ProcessDataManager.Data.CU00x.BoltDimensionPresenceInspector.Data.FailureDescription:='BoltDimensionPresenceInspector error';
Station.ProcessDataManager.Data.CU00x.BoltDimensionPresenceInspector.Data.NumberOfAllowedRetries:=100;
IF NOT Station.ProcessDataManager.Data.CU00x.BoltDimensionPresenceInspector.OverInspected THEN

	Station.ProcessDataManager.Data.CU00x.BoltDimensionPresenceInspector.WithCoordinator(THIS^)
		.Inspect(_inspectionDimensionResult)
		.WithDescription()
		.UpdateComprehensiveResult(Station.ProcessDataManager.Data.EntityHeader.Results)
		.OnFail().Retry(1100);
ELSE
	 RequestStep(RESTORE_STEP_ID);
END_IF
//-------------------------------------

END_IF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants