Home > Forum > Plugins > [Closed] Getting object (step) names during SDK execution

[Closed] Getting object (step) names during SDK execution
0

MVP

Hi everyone,

does anyone have a good solution for retrieving names/translations of objects within a SDK action?
Example:
We have the step id: args.Context.CurrentDocument.StepID
How do I get the (translated) step name?

Is there some option inside the SDK?
I haven't found one, so I'm thinking about passing ids/translations via the PluginConfiguration.
I just thought about querying a data source. Maybe I could create a SQL view which is utilized by the data source.

Did someone do something similar and has some experience?

Best regards,
Daniel

MVP

I'm currently using this approach to access the data:
var command = $@"
SELECT STP_ID as StpId,
case
when isnull(TRANS_Name, '') = '' then STP_Name
else TRANS_Name
end[Name]
FROM
dbo.WFDefinitions
join dbo.WorkFlows on DEF_ID = WF_WFDEFID
join dbo.WFSteps on WF_ID = STP_WFID
left join
(dbo.Translates
JOIN dbo.TranslateLanguages ON dbo.Translates.TRANS_LANID = dbo.TranslateLanguages.LAN_ID and SUBSTRING(LAN_Name, 1, 2) = 'Configuration.Language')
on TRANS_OBJID = 5 and TRANS_ELEMID = STP_ID
where
DEF_ID in ({Configuration.ProcessIds})
order by STP_ID
";
var result = WebCon.WorkFlow.SDK.Tools.Data.SqlExecutionHelper.GetDataTableForSqlCommand(command,args.Context);


I don't really like the idea of hard coding the query, on the other hand I could create some data source. I would have to map the column names via configuration properties so that I can safely access them.
The only workaround would be, if I could define a template. Is this possible or has someone an alternative idea?

Best regards,
Daniel