-
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
#192 Support for expressions in BPMN gateways #246
Conversation
catch (Exception e) | ||
{ | ||
using var jsonDocument = JsonDocument.Parse(data); | ||
|
||
testCase.Name = jsonDocument.RootElement.GetProperty("name").GetString(); | ||
testCase.ExpectsFailure = jsonDocument.RootElement.TryGetProperty("expectsFailure", out var expectsFailure) ? expectsFailure.GetString() : null; | ||
testCase.ParsingException = e; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause
if(outgoingFlows.Any(a => a.ConditionExpression != null)) | ||
{ | ||
gatewayFilter = _gatewayFactory.GetProcessExclusiveGateway("AltinnExpressionsExclusiveGateway"); | ||
} else | ||
{ | ||
gatewayFilter = _gatewayFactory.GetProcessExclusiveGateway(directFlowTarget.Id); | ||
} |
Check notice
Code scanning / CodeQL
Missed ternary opportunity
src/Altinn.App.Core/Internal/Process/ExpressionsExclusiveGateway.cs
Outdated
Show resolved
Hide resolved
return layoutSet; | ||
} | ||
|
||
private async Task<(string? DataTypeId, Type? DataTypeClassType)> GetDataType(Instance instance, LayoutSet? layoutSet, string? dataTypeId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic seems to belong elsewhere, but we're perhaps missing the natural place to place it. Unless we use similar methods in other parts of the code we should make a note of it and figure out where it should be until next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find a natural home, I will add a TODO comment stating that we should find a home for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕹️
Kudos, SonarCloud Quality Gate passed! |
* Working gateway filter leveraging expressions to make decisions * remove logger * Add tests for expressions function gatewayAction * move test out of shared tests as it is only supported backend (no process in frontend) * Add tests and small refactoring * Fix code smells * Fixes after review
Description
Support for expressions in process gateways.
This extends the expression code with a function for getting the action performed in the task leading up to the gateway.
By default the dataModel in the expression context is set to the task before the gateway, but it is possible to override what DataType the expression context should be connected to in a gateway by setting connectedDataTypeId in the extensionelements in the BPMN file.
This fixes #192
Related Issue(s)
Verification
Documentation