use of com.enonic.xp.issue.IssueAlreadyExistsException in project xp by enonic.
the class CreateIssueCommentCommand method doExecute.
private IssueComment doExecute() {
validateBlockingChecks();
final Node issueNode = nodeService.getById(NodeId.from(params.getIssue()));
final String commentName = IssueCommentNameFactory.create(params.getCreated());
final CreateNodeParams createNodeParams = CreateNodeParamsFactory.create(this.params, issueNode.name(), commentName);
final Node createdNode;
try {
createdNode = nodeService.create(createNodeParams);
} catch (NodeAlreadyExistAtPathException e) {
throw new IssueAlreadyExistsException(IssueName.from(createNodeParams.getName()));
}
nodeService.refresh(RefreshMode.SEARCH);
return IssueCommentNodeTranslator.fromNode(createdNode);
}
use of com.enonic.xp.issue.IssueAlreadyExistsException in project xp by enonic.
the class CreateIssueCommand method doExecute.
private Issue doExecute() {
validateBlockingChecks();
final long index = countTotalIssues() + 1;
final IssueName issueName = IssueNameFactory.create(index);
final CreateNodeParams createNodeParams = CreateNodeParamsFactory.create(this.params, this.getCurrentUser(), index, issueName);
final Node createdNode;
try {
createdNode = nodeService.create(createNodeParams);
} catch (NodeAlreadyExistAtPathException e) {
throw new IssueAlreadyExistsException(IssueName.from(createNodeParams.getName()));
}
nodeService.refresh(RefreshMode.SEARCH);
return IssueNodeTranslator.fromNode(createdNode);
}
Aggregations