-
Notifications
You must be signed in to change notification settings - Fork 11
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
v8 #247
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#207 (#237) * New process engine seems to work. Needs more tests and verification * refactored to make class more testable * added tests for ProcessEngine * Refactor and delete old and unused code * added tests for ProcessEventDispatcher * Add tests and fix ProcessNavigator * add available actions to currentTask and perform authcheck * action passed along from PUT process/next to gateway filters * fix bug in AppProcessState ctor * add fields for read/write and check users permissions * Fix test stub implementation of IProcessExclusiveGateway * Fixing some reported code smells * Some code smell fixes. Added logic to dispatch abandon event if action is reject * remove unfinished test file * add tests for method in ProcessClient * add test for classes extending storage classes * add test for null values in extensions * revert code changes due to test * add frontend feature and parse request body on process/next if present * add frontend feature and parse request body on process/next if present * fix codeql warning * add v8 as target of github workflows in addition to main * Fix return type of all methods in ProcessController returning ProcessState * Authorize action moved to AuthorizationClient TaskType is substituted with corresponding action earlier Resolvs #207 * Fixed some issues after review and added some more tests * fix codeQL warning and improve test * Fix some code smells * Update src/Altinn.App.Api/Controllers/InstancesController.cs Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com> * fix build error --------- Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com>
Comment on lines
+73
to
+76
catch (Exception exception) | ||
{ | ||
_logger.LogWarning(exception, "Exception when sending event with the Events component"); | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause
Generic catch clause.
Comment on lines
+105
to
+130
foreach (InstanceEvent instanceEvent in events) | ||
{ | ||
if (Enum.TryParse<InstanceEventType>(instanceEvent.EventType, true, out InstanceEventType eventType)) | ||
{ | ||
string? elementId = instanceEvent.ProcessInfo?.CurrentTask?.ElementId; | ||
ITask task = GetProcessTask(instanceEvent.ProcessInfo?.CurrentTask?.AltinnTaskType); | ||
switch (eventType) | ||
{ | ||
case InstanceEventType.process_StartEvent: | ||
break; | ||
case InstanceEventType.process_StartTask: | ||
await task.HandleTaskStart(elementId, instance, prefill); | ||
break; | ||
case InstanceEventType.process_EndTask: | ||
await task.HandleTaskComplete(elementId, instance); | ||
break; | ||
case InstanceEventType.process_AbandonTask: | ||
await task.HandleTaskAbandon(elementId, instance); | ||
await _instanceService.UpdateProcess(instance); | ||
break; | ||
case InstanceEventType.process_EndEvent: | ||
await _appEvents.OnEndAppEvent(instanceEvent.ProcessInfo?.EndEvent, instance); | ||
break; | ||
} | ||
} | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Where
This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
tjololo
changed the title
Rewrite of process engine to support actions in tasks resolves #205 a…
v8
May 30, 2023
SonarCloud Quality Gate failed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft pullrequest to keep v8 up to date with main
Description
Related Issue(s)
Verification
Documentation