@aachanta,
Just wanted to clarify if you're talking about creating visualizations, or publishing using ESI.
Assuming you mean visualizations - yes, there is some API. I have a method I created a while ago that runs in a workflow expression robot. It calls the custom package/method.
The method returns true/false. If it returns false, the method submits a publish job and the workflow routes to a timer robot. If it returns true, then it continues. There is also a custom logger in the example. It isn't necessary.
public static boolean representationCheck (WTChangeOrder2 co, boolean publish, int count) throws WTException {
//checks to see if all of the Resulting objects are published. if they aren't published, it will submit publish jobs for them.
boolean result = true;
LOGGER.debug("WF Util: representationCheck: Calling ext.site.WorkflowUtils.representationCheck(), time #" + count + ", ECO# " + co.getNumber() + ", with publish mode = " + publish);
try{
// Get a list of the Resulting Objects of the Change Notice
QueryResult qr = wt.change2.ChangeHelper2.service.getChangeablesAfter(co);
// Loop through the Resulting Objects.
while (qr.hasMoreElements()) {
WTObject obj = (WTObject)qr.nextElement();
// If the WTObject is an EPMDocument, check to see if it has a representation.
if (obj instanceof EPMDocument) {
EPMDocument epmDoc = (EPMDocument)obj;
Representation rep = PublishUtils.getRepresentation((Representable) epmDoc);
LOGGER.debug(" \"" + epmDoc.getIdentity() + "\" representation: " + rep);
// If there is no representation for the EPMDocument, then submit a publish job for one.
if (rep == null) {
result = false;
if (publish) {
String objRef = ObjectReference.newObjectReference(epmDoc).toString();
Publisher pub = new Publisher();
PublisherAction publisherAction = new PublisherAction();
publisherAction.addAction(PublisherAction.QUEUEPRIORITY, "H");
result = pub.doPublish(false, true, objRef, (EPMAsStoredConfigSpec)null, (EPMAsStoredConfigSpec)null, true, null, null, Publisher.EPM, publisherAction.toString(), 0);
LOGGER.debug("WF Util: representationCheck: Publish Job submitted for \"" + epmDoc.getIdentity() + "\"");
}
}
}
}
LOGGER.debug("WF Util: representationCheck: Done with ext.site.WorkflowUtils.representationCheck(). All Resulting EPMDocs published? " + result);
return result;
}catch (Exception e) {
e.printStackTrace();
LOGGER.error("WF Util: representationCheck error checking representations, please see MS logs for stack trace");
return true;
}
}