I know the WebIQ recipe widgets, and I know that you can use them to create new recipes. In my project, I need to create a WebIQ recipe using a JS script.
What do I have to do to create a new WebIQ recipe? I can successfully create a recipe object, but it is not saved as a recipe. I can create a new recipe from an existing one by cloning. But when no recipe exists, I need to create one from scratch.
// For testing I just use the data from an existing recipe.
let id = 10 // only constant for testing, id does exists
let templateId = loadedRcp.templateId
let versionId = loadedRcp.versionId
let versionNum = loadedRcp.versionNum
let name = "newRcp" // only fixed for testing, name does not exist
let createdBy = loadedRcp.createdBy
let createdTimestamp = loadedRcp.createdTimestamp
let modifiedBy = loadedRcp.modifiedBy
let modifiedTimestamp = loadedRcp.modifiedTimestamp
let comment = loadedRcp.comment
let metadata = loadedRcp.metadata
let values = loadedRcp.values
let manager = loadedRcp.manager
let newRcp = new shmi.visuals.core.Recipe(id, templateId, versionId, versionNum, name, createdBy, createdTimestamp, modifiedBy, modifiedTimestamp, comment, metadata, values, manager)
... View more