File

src/app/tasks/task-definition/graph/task-graph.component.ts

Description

Component that shows the graph of a Task Definition

Implements

OnInit OnDestroy

Example

Metadata

selector app-task-graph
templateUrl task-graph.component.html

Index

Properties
Methods

Constructor

constructor(route: ActivatedRoute, tasksService: TasksService, metamodelService: MetamodelService, renderService: RenderService)

Constructor

Parameters :
Name Type Optional Description
route ActivatedRoute
tasksService TasksService
metamodelService MetamodelService
renderService RenderService

Methods

ngOnDestroy
ngOnDestroy()

Will cleanup any {@link Subscription}s to prevent memory leaks.

Returns : void
ngOnInit
ngOnInit()

Initialize

Returns : void

Properties

Public metamodelService
metamodelService: MetamodelService
Type : MetamodelService
Public renderService
renderService: RenderService
Type : RenderService
taskDefinition$
taskDefinition$: Observable<TaskDefinition>
Type : Observable<TaskDefinition>

Stream name

import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { mergeMap } from 'rxjs/operators';
import { RenderService } from '../../components/flo/render.service';
import { MetamodelService } from '../../components/flo/metamodel.service';
import { TasksService } from '../../tasks.service';
import { Observable } from 'rxjs';
import { TaskDefinition } from '../../model/task-definition';

/**
 * Component that shows the graph of a Task Definition
 *
 * @author Damien Vitrac
 */
@Component({
  selector: 'app-task-graph',
  templateUrl: 'task-graph.component.html'
})
export class TaskGraphComponent implements OnInit, OnDestroy {

  /**
   * Stream name
   */
  taskDefinition$: Observable<TaskDefinition>;

  /**
   * Constructor
   *
   * @param {ActivatedRoute} route
   * @param {TasksService} tasksService
   * @param {MetamodelService} metamodelService
   * @param {RenderService} renderService
   */
  constructor(private route: ActivatedRoute,
              private tasksService: TasksService,
              public metamodelService: MetamodelService,
              public renderService: RenderService) {
  }

  /**
   * Initialize
   */
  ngOnInit() {
    this.taskDefinition$ = this.route.parent.params
      .pipe(mergeMap(val => this.tasksService.getDefinition(val.id)));
  }

  /**
   * Will cleanup any {@link Subscription}s to prevent
   * memory leaks.
   */
  ngOnDestroy() {
    this.metamodelService.clearCachedData();
  }

}
<div *ngIf="taskDefinition$ | async as taskDefinition; else loading" dataflowLayoutType type="full">

  <app-graph-view [dsl]="taskDefinition.dslText" [paperPadding]="20" class="composed-task-details"
                  [metamodel]="metamodelService" [renderer]="renderService">
  </app-graph-view>

</div>
<ng-template #loading>
  <app-loader></app-loader>
</ng-template>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""