logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution - IF

type: IF ( inline function ), modify_date: 2021-10-02 13:23:34

RepoObject_guid: E448B3FF-FDA5-EB11-84FA-A81E8446D5B0

Description

Examples

Example 1. Usage
--analyse the last 1000 entries in logs.ExecutionLog

Select
    ex.execution_instance_guid
  , tree.puml_Sequence_start_stop
From
(
    Select
        execution_instance_guid
    From
    (
        Select
            Top ( 1000 )
            execution_instance_guid
          , id
        From
            logs.ExecutionLog
        Order By
            id Desc
    ) el1000
    Group By
        execution_instance_guid
)                                                                                    ex
    Cross Apply logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution ( execution_instance_guid ) tree;

--one specific execution

Select
    tree.puml_Sequence_start_stop
from
    logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution ( '5E960CEB-187C-4C75-8465-3F2FA8363CA5' ) tree;

Parameters

  • @execution_instance_guid (uniqueidentifier)

Entity Diagram

entity-logs.ftv_executionlog_puml_sequence_start_stop_per_execution

Columns

Table 1. Columns of logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution - IF
PK Column Name Data Type NULL? ID

nvarchar(max)

NOT NULL

References

Object Reference Diagram - 1 1

entity_1_1_objectref-logs.ftv_executionlog_puml_sequence_start_stop_per_execution

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-logs.ftv_executionlog_puml_sequence_start_stop_per_execution

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-logs.ftv_executionlog_puml_sequence_start_stop_per_execution

Column Reference Diagram

entity_1_1_colref-logs.ftv_executionlog_puml_sequence_start_stop_per_execution

Column Details

_

puml_Sequence_start_stop

puml_Sequence_start_stop

nvarchar(max)

NOT NULL

sql_modules_definition

logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution - IF script
/*
<<property_start>>Description
* xref:sqldb:logs.ftv_executionlog_puml_sequence_start_stop_per_execution.adoc[] uses xref:sqldb:logs.executionlog.adoc[] to create PlantUML code for sequence diagrams
* Only procedure calls are considered, not "normal code".
<<property_end>>

<<property_start>>exampleUsage
--analyse the last 1000 entries in logs.ExecutionLog

Select
    ex.execution_instance_guid
  , tree.puml_Sequence_start_stop
From
(
    Select
        execution_instance_guid
    From
    (
        Select
            Top ( 1000 )
            execution_instance_guid
          , id
        From
            logs.ExecutionLog
        Order By
            id Desc
    ) el1000
    Group By
        execution_instance_guid
)                                                                                    ex
    Cross Apply logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution ( execution_instance_guid ) tree;

--one specific execution

Select
    tree.puml_Sequence_start_stop
from
    logs.ftv_ExecutionLog_puml_sequence_start_stop_per_execution ( '5E960CEB-187C-4C75-8465-3F2FA8363CA5' ) tree;

<<property_end>>
*/
CREATE Function [logs].[ftv_ExecutionLog_puml_sequence_start_stop_per_execution]
(
    @execution_instance_guid UniqueIdentifier
)
Returns Table
As
Return
(
    Select
        puml_Sequence_start_stop =
        --
        Concat (
                   '@startuml' + Char ( 13 ) + Char ( 10 )
                 , String_Agg ( Cast(puml_Sequence_start_stop As NVarchar(Max)), Char ( 13 ) + Char ( 10 )) Within Group(Order By
                                                                                                                             id)
                 , Char ( 13 ) + Char ( 10 ) + '@enduml' + Char ( 13 ) + Char ( 10 )
               )
    From
        logs.ExecutionLog_puml_Sequence_start_stop T1
    Where
        T1.execution_instance_guid = @execution_instance_guid
--Group By
--    @execution_instance_guid
);