How to detect and delete obsolete generated BE code
 
Forums / SmartComponent Library - Developer Forum / How to detect and delete obsolete generated BE code

How to detect and delete obsolete generated BE code

3 posts, 0 answered
  1. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    28 Jun 2019
    Link to this post
    We find that when a BE (.bedgm file) is deleted quite often some of the code that has been generated for that BE is not deleted at the same time.

    Are there tools / techniques to detect those sources ?


    I'm currently contemplating a brute-force attack where I would regenerate all bedgm's in batch and afterwards delete all generated code that has no been updated.
  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    28 Jun 2019 in reply to Carl Verbiest
    Link to this post
    For that reason we're adding the 

    @BusinessEntityGenerator (entityname="Consultingwerk.SmartFramework.Repository.Object.ObjectMasterBusinessEntity", type="DataAccess") .

    annotations to the generated code. You can search for files with that Annotation using the meta catalog search in PDSOE - or just a file search.
  3. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    28 Jun 2019 in reply to Mike Fechner
    Link to this post
    Ok so the attack plan would become

    1. list all files that match BE sources
    2. locate the @BusinessEntityGenerator annotation
    3 if the annotation is not found or if the entity of the annotation is not found flag the source as outdated

    I'd still need the batch regenerate for sources that were generated before the annotation was introduced

    No annotation or entityname found in dsXXXXX_Constants.i and dsXXXX.xsd but those could be seen as sources derived from dsXXXXX.i .


    Looking at the annotations I noticed
    @openapi.openedge.entity.primarykey (fields="XXX,YYY,ZZZ").
    does not contain info about the entitytable it describes.
    Is that annotation still usable if a source includes multiple temp-table definitions ?
3 posts, 0 answered