You can use CodeMapper to lookup a time code ID.
First create an instance of CodeMapper, it takes a DBConnection as a parameter.
CodeMapper mapper = CodeMapper.createCodeMapper(conn);
If you happen to be writing a Rule, you can simply get CodeMapper from the WBData parameter.
CodeMapper mapper = wbData.getCodeMapper();
Next, lookup the TimeCodeData using the CodeMapper instance and the time code name as a parameter.
TimeCodeData timeCode = mapper getTimeCodeByName(timeCodeName);
int id = timeCode .getTcodeId();
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment