Hello,
I have a little problem with the APIs of workflows. I want to create a workflow that creates several cards. How can I pass the ID of a specific existing card to a variable.
I have an activity newCustomer and newBuilding in TWE 4.4 and I want to pass the ID of the newly created customer to the newBuilding activity and then the workflow should write them into the referenc attribute.
Field acronym: String and companyReference: Reference
newCustomer = cmdb.newCard(“company”).withCode(acronym).create();
newBuilding = cmdb.newCard(“building”).with(“companyReference”, ?).create
where ? is the API of the IdClass of the company which have the same acronym as the previously created customer card.
thank you for the answer.
sorry not IdClass but the id of the class.
where ? is the API of the Id of the company which have the same acronym as the previously created customer card.
Hi,
I think you need to convert the card descriptor to a reference type through the method referenceTypeFrom.
newBuilding = cmdb.newCard("building").with("companyReference", cmdb.referenceTypeFrom(newCustomer)).create();
Best regards,
CMDBuild Team