Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Gottschalk
bmdl-expert-modeler
Commits
b0271a93
Commit
b0271a93
authored
Nov 08, 2021
by
Alexander Philipp Nowosad
Browse files
Add set default name for output artifacts that are internal
parent
3eb67888
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/app/canvas-meta-model/canvas-meta-model-api.service.ts
View file @
b0271a93
...
...
@@ -30,6 +30,14 @@ export class CanvasMetaModelApiService implements MetaModelApi {
}
}
async
getName
(
model
:
ArtifactDataReference
):
Promise
<
string
|
undefined
>
{
const
companyModel
=
await
this
.
companyModelService
.
get
(
model
.
id
);
if
(
companyModel
.
instances
.
length
>
0
)
{
return
companyModel
.
instances
[
0
].
name
;
}
return
undefined
;
}
async
copy
(
model
:
ArtifactDataReference
):
Promise
<
ArtifactDataReference
>
{
const
companyModel
=
await
this
.
companyModelService
.
get
(
model
.
id
);
companyModel
.
resetDatabaseState
();
...
...
src/app/development-process-registry/meta-model-definition.ts
View file @
b0271a93
...
...
@@ -27,6 +27,8 @@ export interface MetaModelApi {
reference
:
Reference
):
void
;
getName
(
model
:
ArtifactDataReference
):
Promise
<
string
|
undefined
>
;
copy
(
model
:
ArtifactDataReference
):
Promise
<
ArtifactDataReference
>
;
remove
(
model
:
ArtifactDataReference
):
Promise
<
void
>
;
...
...
src/app/development-processes/running-process-select-output-artifact/running-process-select-output-artifact.component.html
View file @
b0271a93
...
...
@@ -41,7 +41,18 @@
</div>
<div
class=
"form-group"
*ngIf=
"definitionControl.value"
>
<label
for=
"name"
>
Name
</label>
<input
class=
"form-control"
id=
"name"
formControlName=
"artifactName"
/>
<div
class=
"input-group"
>
<input
class=
"form-control"
id=
"name"
formControlName=
"artifactName"
/>
<div
*ngIf=
"artifact.internalArtifact"
class=
"input-group-append"
>
<button
class=
"btn btn-outline-primary"
type=
"button"
(click)=
"setDefaultName()"
>
Set default name
</button>
</div>
</div>
</div>
<div
class=
"form-group"
*ngIf=
"showNotes"
>
<label
for=
"externalOutputArtifactData"
>
Note
</label>
...
...
src/app/development-processes/running-process-select-output-artifact/running-process-select-output-artifact.component.ts
View file @
b0271a93
...
...
@@ -4,6 +4,9 @@ import { Artifact } from '../../development-process-registry/method-elements/art
import
{
RunningArtifact
}
from
'
../../development-process-registry/running-process/running-artifact
'
;
import
{
OutputArtifactMappingFormValue
}
from
'
../shared/output-artifact-mapping-form.service
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
StepArtifact
}
from
'
../../development-process-registry/running-process/step-artifact
'
;
import
{
MetaModelService
}
from
'
../../development-process-registry/meta-model.service
'
;
import
{
ArtifactDataType
}
from
'
../../development-process-registry/running-process/artifact-data
'
;
@
Component
({
selector
:
'
app-running-process-select-output-artifact
'
,
...
...
@@ -14,13 +17,24 @@ export class RunningProcessSelectOutputArtifactComponent
implements
OnInit
,
OnDestroy
{
@
Input
()
artifact
!
:
Artifact
;
@
Input
()
internalArtifact
?:
StepArtifact
;
@
Input
()
processArtifacts
!
:
RunningArtifact
[];
private
artifactIsDefinitionChangeSubscription
?:
Subscription
;
private
artifactSelectionChangeSubscription
?:
Subscription
;
constructor
(
private
controlContainer
:
ControlContainer
)
{}
constructor
(
private
controlContainer
:
ControlContainer
,
private
metaModelService
:
MetaModelService
)
{}
ngOnInit
():
void
{
this
.
artifactIsDefinitionChangeSubscription
=
this
.
definitionControl
.
valueChanges
.
subscribe
(
async
(
value
)
=>
{
if
(
value
&&
!
this
.
artifactNameControl
.
value
)
{
await
this
.
setDefaultName
();
}
});
this
.
artifactSelectionChangeSubscription
=
this
.
artifactControl
.
valueChanges
.
subscribe
((
value
:
number
)
=>
this
.
loadData
(
value
)
...
...
@@ -28,6 +42,9 @@ export class RunningProcessSelectOutputArtifactComponent
}
ngOnDestroy
():
void
{
if
(
this
.
artifactIsDefinitionChangeSubscription
!=
null
)
{
this
.
artifactIsDefinitionChangeSubscription
.
unsubscribe
();
}
if
(
this
.
artifactSelectionChangeSubscription
!=
null
)
{
this
.
artifactSelectionChangeSubscription
.
unsubscribe
();
}
...
...
@@ -45,6 +62,23 @@ export class RunningProcessSelectOutputArtifactComponent
);
}
async
setDefaultName
():
Promise
<
void
>
{
if
(
this
.
internalArtifact
!=
null
&&
this
.
internalArtifact
.
data
.
type
===
ArtifactDataType
.
REFERENCE
)
{
const
api
=
this
.
metaModelService
.
getMetaModelApi
(
this
.
internalArtifact
.
metaModelType
);
if
(
api
!=
null
)
{
const
name
=
await
api
.
getName
(
this
.
internalArtifact
.
data
.
data
);
if
(
name
!=
null
)
{
this
.
artifactNameControl
.
setValue
(
name
);
}
}
}
}
get
formGroup
():
FormGroup
{
return
this
.
controlContainer
.
control
as
FormGroup
;
}
...
...
@@ -53,6 +87,10 @@ export class RunningProcessSelectOutputArtifactComponent
return
this
.
formGroup
.
get
(
'
isDefinition
'
);
}
get
artifactNameControl
():
AbstractControl
{
return
this
.
formGroup
.
get
(
'
artifactName
'
);
}
get
artifactControl
():
AbstractControl
{
return
this
.
formGroup
.
get
(
'
artifact
'
);
}
...
...
src/app/development-processes/running-process-select-output-artifacts/running-process-select-output-artifacts.component.html
View file @
b0271a93
...
...
@@ -22,6 +22,7 @@
*ngFor=
"let artifact of outputArtifacts; let index = index"
formGroupName=
"{{ index }}"
[artifact]=
"artifact"
[internalArtifact]=
"internalOutputArtifacts[index]"
[processArtifacts]=
"runningProcess.artifacts"
></app-running-process-select-output-artifact>
</div>
...
...
src/app/development-processes/running-process-select-output-artifacts/running-process-select-output-artifacts.component.ts
View file @
b0271a93
...
...
@@ -21,6 +21,7 @@ import { RunningMethod } from '../../development-process-registry/running-proces
import
{
OutputArtifactMapping
}
from
'
../../development-process-registry/running-process/output-artifact-mapping
'
;
import
{
equalsListGeneric
}
from
'
../../shared/utils
'
;
import
{
ArtifactDataType
}
from
'
../../development-process-registry/running-process/artifact-data
'
;
import
{
StepArtifact
}
from
'
../../development-process-registry/running-process/step-artifact
'
;
@
Component
({
selector
:
'
app-running-process-select-output-artifacts
'
,
...
...
@@ -37,6 +38,7 @@ export class RunningProcessSelectOutputArtifactsComponent
@
Output
()
updateOutputArtifacts
=
new
EventEmitter
<
FormArray
>
();
outputArtifacts
:
Artifact
[];
internalOutputArtifacts
:
StepArtifact
[];
form
:
FormGroup
;
changed
=
false
;
...
...
@@ -72,6 +74,7 @@ export class RunningProcessSelectOutputArtifactsComponent
.
getList
(
decision
.
method
.
outputArtifacts
)
.
elements
.
forEach
((
element
)
=>
artifacts
.
push
(...
element
.
elements
));
this
.
outputArtifacts
=
artifacts
;
this
.
internalOutputArtifacts
=
this
.
runningMethod
.
getOutputArtifacts
();
this
.
loadForm
(
artifacts
,
this
.
runningMethod
.
outputArtifacts
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment