Skip to main content
Closed

Add translation objects for model extenders

Related products:Software Factory
  • September 1, 2020
  • 2 replies
  • 36 views

Harm Horstman
Superhero

This simple SQL does the job, but would be nice when it becomes part of TSF

DECLARE @project_id     AS project_id = '[project_id]'
DECLARE @project_vrs_id AS project_id = '[project_vrs_id]'

INSERT INTO transl_object (
       project_id
     , project_vrs_id
     , type_of_object
     , transl_object_id
     , transl_object_desc
     , generated
     , insert_user
     , insert_date_time
)
SELECT DISTINCT 
       project_id         = @project_id 
     , project_vrs_id	  = @project_vrs_id
     , type_of_object	  = 13
     , transl_object_id   = value_string
     , transl_object_desc = NULL
     , generated		  = 0
     , insert_user		  = dbo.tsf_user()
     , insert_date_time	  = GETDATE()
FROM 
     (
        select s.project_id
             , s.project_vrs_id
             , s.extender_type_id
             , s.extender_id
             , property_transl = m.c.value('@property_transl[1]', 'varchar(100)')
             , value_string    = m.c.value('@value_string[1]', 'varchar(1000)')    
        from extender s
        cross apply (select cast(s.property_xml as xml) as property_xml) c
        cross apply c.property_xml.nodes('extender') as m(c)
        WHERE s.project_id = @project_id
        AND   s.project_vrs_id = @project_vrs_id
     ) xml_flat
WHERE property_transl = 'Translation object'
AND NOT EXISTS (SELECT 1 FROM transl_object t WHERE t.project_id = @project_id AND t.project_vrs_id = @project_vrs_id AND t.transl_object_id = xml_flat.value_string AND t.type_of_object = 13)

 

Did this topic help you find an answer to your question?

2 replies

Jasper
Superhero
  • 678 replies
  • October 28, 2020

Hi Harm,

Thanks for the suggestion. We plan to include the maps and scheduler extenders in the model for the next release of the platform, so this won't be necessary anymore.


Jasper
Superhero
  • 678 replies
  • October 28, 2020
Updated idea status New β†’ Closed

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings