Skip to content

Commit ab3b04a

Browse files
Merge pull request #7026 from deutschebank/db-contrib/waltz-7022-physical-flow-registration-name-error
Physical flow registration name error
2 parents 254a234 + e8614a5 commit ab3b04a

6 files changed

Lines changed: 47 additions & 4 deletions

File tree

waltz-data/src/main/java/org/finos/waltz/data/physical_flow/PhysicalFlowDao.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class PhysicalFlowDao {
8080
PhysicalFlowRecord record = r.into(PHYSICAL_FLOW);
8181
return ImmutablePhysicalFlow.builder()
8282
.id(record.getId())
83-
.name(Optional.ofNullable(record.getName()).orElse(""))
83+
.name(record.getName())
8484
.provenance(record.getProvenance())
8585
.specificationId(record.getSpecificationId())
8686
.basisOffset(record.getBasisOffset())
@@ -197,7 +197,12 @@ public List<PhysicalFlow> findBySelector(Select<Record1<Long>> selector) {
197197

198198
public List<PhysicalFlow> findByAttributesAndSpecification(PhysicalFlow flow) {
199199

200+
Condition nameCondition = flow.name() == null
201+
? PHYSICAL_FLOW.NAME.isNull()
202+
:PHYSICAL_FLOW.NAME.eq(flow.name());
203+
200204
Condition sameFlow = PHYSICAL_FLOW.SPECIFICATION_ID.eq(flow.specificationId())
205+
.and(nameCondition)
201206
.and(PHYSICAL_FLOW.BASIS_OFFSET.eq(flow.basisOffset()))
202207
.and(PHYSICAL_FLOW.FREQUENCY.eq(flow.frequency().value()))
203208
.and(PHYSICAL_FLOW.TRANSPORT.eq(flow.transport().value()))
@@ -302,6 +307,7 @@ public long create(PhysicalFlow flow) {
302307
PhysicalFlowRecord record = dsl.newRecord(PHYSICAL_FLOW);
303308
record.setLogicalFlowId(flow.logicalFlowId());
304309

310+
record.setName(flow.name());
305311
record.setFrequency(flow.frequency().value());
306312
record.setTransport(flow.transport().value());
307313
record.setBasisOffset(flow.basisOffset());

waltz-model/src/main/java/org/finos/waltz/model/physical_flow/FlowAttributes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@
2020

2121
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
2222
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
23-
import org.finos.waltz.model.Criticality;
2423
import org.finos.waltz.model.DescriptionProvider;
2524
import org.finos.waltz.model.ExternalIdProvider;
25+
import org.finos.waltz.model.Nullable;
2626
import org.immutables.value.Value;
2727

2828
@Value.Immutable
2929
@JsonSerialize(as = ImmutableFlowAttributes.class)
3030
@JsonDeserialize(as = ImmutableFlowAttributes.class)
3131
public abstract class FlowAttributes implements DescriptionProvider, ExternalIdProvider {
3232

33+
@Nullable
34+
public abstract String name();
3335
public abstract TransportKindValue transport();
3436

3537
public abstract FrequencyKindValue frequency();

waltz-model/src/main/java/org/finos/waltz/model/physical_flow/PhysicalFlow.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,22 @@
2020

2121
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
2222
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
23-
import org.finos.waltz.model.*;
23+
import org.finos.waltz.model.CreatedUserTimestampProvider;
24+
import org.finos.waltz.model.DescriptionProvider;
25+
import org.finos.waltz.model.EntityKind;
26+
import org.finos.waltz.model.EntityKindProvider;
27+
import org.finos.waltz.model.EntityLifecycleStatusProvider;
28+
import org.finos.waltz.model.EntityReference;
29+
import org.finos.waltz.model.ExternalIdProvider;
30+
import org.finos.waltz.model.FreshnessIndicator;
31+
import org.finos.waltz.model.IdProvider;
32+
import org.finos.waltz.model.ImmutableEntityReference;
33+
import org.finos.waltz.model.IsRemovedProvider;
34+
import org.finos.waltz.model.LastAttestedProvider;
35+
import org.finos.waltz.model.LastUpdatedProvider;
36+
import org.finos.waltz.model.Nullable;
37+
import org.finos.waltz.model.ProvenanceProvider;
38+
import org.finos.waltz.model.WaltzEntity;
2439
import org.immutables.value.Value;
2540

2641
import java.util.Optional;
@@ -37,7 +52,6 @@
3752
@JsonDeserialize(as = ImmutablePhysicalFlow.class)
3853
public abstract class PhysicalFlow implements
3954
IdProvider,
40-
NameProvider,
4155
IsRemovedProvider,
4256
CreatedUserTimestampProvider,
4357
DescriptionProvider,
@@ -54,6 +68,9 @@ public abstract class PhysicalFlow implements
5468

5569
public abstract long specificationId();
5670

71+
@Nullable
72+
public abstract String name();
73+
5774
public abstract FrequencyKindValue frequency();
5875

5976
// e.g. for representing T+0, T+1, T+7, T-1

waltz-ng/client/physical-flows/svelte/PhysicalFlowCharacteristicsStep.svelte

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
3636
} else {
3737
workingCopy = {
38+
name: null,
3839
transport: null,
3940
frequency: null,
4041
criticality: null,
@@ -54,6 +55,7 @@
5455
$physicalFlow = Object.assign(
5556
{},
5657
{
58+
name: workingCopy.name,
5759
transport: workingCopy.transport,
5860
frequency: workingCopy.frequency,
5961
basisOffset,
@@ -105,6 +107,8 @@
105107
<div style="font-weight: lighter">
106108
<div>Selected Characteristics:</div>
107109
<ul>
110+
<li>
111+
Name: <span class:text-muted={!$physicalFlow.name}>{$physicalFlow.name || "Not provided"}</span></li>
108112
<li>
109113
Transport: {toTransportKindName($nestedEnums, $physicalFlow.transport)}</li>
110114
<li>
@@ -137,6 +141,18 @@
137141
<form autocomplete="off"
138142
on:submit|preventDefault={save}>
139143

144+
<div class="form-group">
145+
<label for="name">
146+
Name
147+
</label>
148+
<input class="form-control"
149+
id="name"
150+
bind:value={workingCopy.name}/>
151+
</div>
152+
<div class="help-block">
153+
Name to describe this physical flow.
154+
</div>
155+
140156
<EnumSelect options={transportKinds}
141157
bind:value={workingCopy.transport}
142158
mandatory="true"

waltz-ng/client/physical-flows/svelte/PhysicalFlowRegistrationView.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
}
6868
6969
const flowAttributes = {
70+
name: $physicalFlow.name,
7071
transport: $physicalFlow.transport,
7172
frequency: $physicalFlow.frequency,
7273
basisOffset: $physicalFlow.basisOffset,

waltz-service/src/main/java/org/finos/waltz/service/physical_flow/PhysicalFlowService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ public PhysicalFlowCreateCommandResponse create(PhysicalFlowCreateCommand comman
233233

234234
ImmutablePhysicalFlow.Builder flowBuilder = ImmutablePhysicalFlow.builder()
235235
.specificationId(specId)
236+
.name(command.flowAttributes().name())
236237
.basisOffset(command.flowAttributes().basisOffset())
237238
.frequency(command.flowAttributes().frequency())
238239
.transport(command.flowAttributes().transport())

0 commit comments

Comments
 (0)