Hi
I'm writing a custom process which will take in a string containing possibly more than one email address and returns any email addresses it finds in the input string based on a regex.
I want to create a new object with a email address attribute for each address (Execute multiple times).
It should also create the relationship between the InputObject and the new emailAddress object. (An inputObject can have many emailAddresses)
Any suggestions or examples would be appreciated!
Here is the code I use to create one new object (However I'am not sure how to
- create the relationship and
- how to execute multiple times, I have tried executing inside a loop but it stops after the first iteration)
IDomainVersion domainVersion = (engine.getExecutionContext(this)).getDomainVersion();
IEntityDefinition entityDefinition = domainVersion.getEntityDefinition("EmailAdress");
IEntityTemplate entityTemplate = DomainFactory.createEntityTemplate(entityDefinition);
entityTemplate.setAttributeValue("emailAddress", getEmailAddress()); // This getEmailAddress() methods returns a string for every match of the regex
//entityTemplate.setAttributeValue(); // Can this be used in the same way as above to create the relationship?
engine.createEntityFromTemplate(this, entityTemplate, null);
Please send any examples you might have. I will try and make the plug-in available once it is finished. Thanks.
Kind Regards