use of com.liferay.ide.kaleo.core.KaleoAPIException in project liferay-ide by liferay.
the class PublishWorkflowDefinitionAction method perform.
@Override
public void perform(Object node) {
if (getSelectionProvider() instanceof CommonViewer && node instanceof WorkflowDefinitionEntry) {
WorkflowDefinitionEntry definitionNode = (WorkflowDefinitionEntry) node;
Job publishJob = new Job("Publishing workflow draft definition") {
@Override
protected IStatus run(IProgressMonitor monitor) {
IKaleoConnection kaleoConnection = KaleoCore.getKaleoConnection(definitionNode.getParent().getParent());
try {
kaleoConnection.publishKaleoDraftDefinition(definitionNode.getName(), definitionNode.getTitleMap(), definitionNode.getContent(), definitionNode.getCompanyId() + "", definitionNode.getUserId() + "", definitionNode.getGroupId() + "");
} catch (KaleoAPIException kapie) {
kapie.printStackTrace();
}
WorkflowDefinitionsFolder definitionsFolder = (WorkflowDefinitionsFolder) definitionNode.getParent();
CommonViewer viewer = (CommonViewer) getSelectionProvider();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
definitionsFolder.clearCache();
viewer.refresh(true);
}
});
return Status.OK_STATUS;
}
};
publishJob.schedule();
}
}
Aggregations