Forum Discussion

AnthonyShenk's avatar
AnthonyShenk
New Contributor II
3 years ago

Task Activity Type

Our team has been working through an Infrastructure project, which requires pulling task activity from the Framework Database.  When pulled directly from the database, we see task activity type in numeric format.  To get the descriptions I ran an comparison by extracting the Task Activity dashboard tool and was able to identify the below descriptions: 

(CASE
WHEN a.TaskActivityType= -1 THEN 'Unknown'
WHEN a.TaskActivityType=10 THEN 'Recycle Application Server'
WHEN a.TaskActivityType=100 THEN 'Get Data Cells'
WHEN a.TaskActivityType=101 THEN 'Get Data Cells Using Script'
WHEN a.TaskActivityType=110 THEN 'Cube View'
WHEN a.TaskActivityType=111 THEN 'Cube View Report'
WHEN a.TaskActivityType=112 THEN 'Export Cube View To Excel'
WHEN a.TaskActivityType=120 THEN 'Quick View'
WHEN a.TaskActivityType=200 THEN 'Book'
WHEN a.TaskActivityType=1000 THEN 'Data Management'
WHEN a.TaskActivityType=1100 THEN 'Data Management Scheduled Task'
WHEN a.TaskActivityType=2000 THEN 'Load And Transform'
WHEN a.TaskActivityType=2100 THEN 'BI-Blend Load And Transform'
WHEN a.TaskActivityType=2200 THEN 'Direct Load And Transform'
WHEN a.TaskActivityType=3000 THEN 'Retransform'
WHEN a.TaskActivityType=4000 THEN 'Clear Stage Data'
WHEN a.TaskActivityType=5000 THEN 'Validate Transformation'
WHEN a.TaskActivityType=6000 THEN 'Validate Intersections'
WHEN a.TaskActivityType=7000 THEN 'Load Cube'
WHEN a.TaskActivityType=7001 THEN 'Load And Process Cube'
WHEN a.TaskActivityType=7002 THEN 'Load Cube Batch'
WHEN a.TaskActivityType=8000 THEN 'Process Cube'
WHEN a.TaskActivityType=8500 THEN 'Clear Cube Data For Workflow'
WHEN a.TaskActivityType=8600 THEN 'Confirm'
WHEN a.TaskActivityType=9000 THEN 'Calculate'
WHEN a.TaskActivityType=11000 THEN 'Consolidate'
WHEN a.TaskActivityType=12000 THEN 'Workflow View Batch'
WHEN a.TaskActivityType=12500 THEN 'Multi Workflow View Batch'
WHEN a.TaskActivityType=13000 THEN 'Workflow File Batch'
WHEN a.TaskActivityType=15000 THEN 'Load XML'
ELSE 'Unknown'
END) AS 'TaskActivityTypeDesc',

Is there another place to get the official description equivalent for these?  We can only test for tasks that have occurred in our application.  

  • Since those are enums, I would take a different approach. Get the data using SQL (add additional columns for descriptions) and edit the data table to get the description.

    e.g, SELECT TaskActivityType, 'Unknown' as TaskActivityTypeDesc FROM TaskActivity

    dim dt as Datatable = (get the table from the SQL above)

    Now, comes the edit part

    dt.Columns("TaskActivityTypeDesc ").ReadOnly = False
    dt.Columns("TaskActivityTypeDesc ").MaxLength = -1
    For Each dr As DataRow In dt.Rows
    	dr.BeginEdit
    		dr("TaskActivityTypeDesc") = TaskActivityType.GetName(GetType(TaskActivityType), dr("TaskActivityType"))
    	dr.EndEdit
    Next

    Done, you can do the same for the other enums similar to this. This way, you are not guessing anything.

  • Since those are enums, I would take a different approach. Get the data using SQL (add additional columns for descriptions) and edit the data table to get the description.

    e.g, SELECT TaskActivityType, 'Unknown' as TaskActivityTypeDesc FROM TaskActivity

    dim dt as Datatable = (get the table from the SQL above)

    Now, comes the edit part

    dt.Columns("TaskActivityTypeDesc ").ReadOnly = False
    dt.Columns("TaskActivityTypeDesc ").MaxLength = -1
    For Each dr As DataRow In dt.Rows
    	dr.BeginEdit
    		dr("TaskActivityTypeDesc") = TaskActivityType.GetName(GetType(TaskActivityType), dr("TaskActivityType"))
    	dr.EndEdit
    Next

    Done, you can do the same for the other enums similar to this. This way, you are not guessing anything.

  • AnthonyShenk's avatar
    AnthonyShenk
    New Contributor II

    Here are some additional conversions we have performed:  

     

    (CASE  

    WHEN OriginatingTier = 0 THEN 'Client'  

    WHEN OriginatingTier = 1 THEN 'Web Server'  

    WHEN OriginatingTier = 2 THEN 'App Server'  

    ELSE 'Unknown'  

    END) AS OrigTierName, 

     

    (CASE  

    WHEN ErrorLevel = 0 THEN 'Info'  

    WHEN ErrorLevel = 2000 THEN 'Error'  

    ELSE 'Unknown'  

    END) AS ErrorLevelName, 

     

    (CASE  

    WHEN ClientModuleType = 0 THEN 'Windows'  

    WHEN ClientModuleType = 1000 THEN 'Web'  

    WHEN ClientModuleType = 2000 THEN 'Studio'  

    WHEN ClientModuleType = 3000 THEN 'Excel'  

    WHEN ClientModuleType = 4000 THEN 'DataProvider'  

    WHEN ClientModuleType = 10000 THEN 'External'  

    ELSE 'Unknown'  

    END) AS ClientModuleTypeName, 

     

    (CASE  

    WHEN LogonStatus = 0 THEN 'Logged On'  

    WHEN LogonStatus = 1 THEN 'Failed Logon'  

    WHEN LogonStatus = 2 THEN 'Logged Off By User'  

    WHEN LogonStatus = 3 THEN 'Logged Off By Admin'  

    WHEN LogonStatus = 4 THEN 'Logged Off By System'  

    WHEN LogonStatus = 99999 THEN 'Imported Item'  

    ELSE 'Unknown'  

    END) AS LogonStatusName, 

     

    (CASE  

    WHEN TaskActivityStatus = -1 THEN 'Unknown' 

    WHEN TaskActivityStatus = 0 THEN 'Queued' 

    WHEN TaskActivityStatus = 1000 THEN 'Running' 

    WHEN TaskActivityStatus = 2000 THEN 'Canceled-By-User' 

    WHEN TaskActivityStatus = 3000 THEN 'Canceled-By-Adm' 

    WHEN TaskActivityStatus = 4000 THEN 'Canceled-By-Sys' 

    WHEN TaskActivityStatus = 5000 THEN 'Failed' 

    WHEN TaskActivityStatus = 6000 THEN 'Completed' 

    WHEN TaskActivityStatus = 99999 THEN 'Imported Item' 

    ELSE 'Unknown'  

    END) AS 'TaskStatus', 

     

    (CASE  

    WHEN StepType = 1010 THEN 'Data Management Step'  

    WHEN StepType = 1045 THEN 'Custom Calculate'  

    WHEN StepType = 4000 THEN 'Calculate'  

    WHEN StepType = 6000 THEN 'Consolidate'  

    ELSE 'Unknown'  

    END) AS 'SUBStepTypeDesc', 

     

    (CASE   

    WHEN  UserType= 1 THEN 'View'  

    WHEN  UserType= 2 THEN 'Interactive'  

    WHEN  UserType= 4 THEN 'Restricted'  

    WHEN  UserType= 3 THEN '3rd Party Access or Financial Close'  

    WHEN  UserType= 5 THEN '3rd Party Access or Financial Close'  

    ELSE 'Unknown'   

    END) AS 'UserType'