public SCommentAddException(long processInstanceId, final String commentType, final Exception e) { super("Can't create a " + commentType + " comment on the process instance.", e); setProcessInstanceIdOnContext(processInstanceId); }
@Override public SComment addComment(long processInstanceId, String comment, long userId) throws SCommentAddException { NullCheckingUtil.checkArgsNotNull(processInstanceId); NullCheckingUtil.checkArgsNotNull(comment); try { final SComment sComment = BuilderFactory.get(SHumanCommentBuilderFactory.class).createNewInstance(processInstanceId, comment, userId).done(); recorder.recordInsert(new InsertRecord(sComment), COMMENT); return sComment; } catch (final SRecorderException e) { throw new SCommentAddException(processInstanceId, "human", e); } }
@Override public SComment addSystemComment(final long processInstanceId, final String comment) throws SCommentAddException { NullCheckingUtil.checkArgsNotNull(processInstanceId); NullCheckingUtil.checkArgsNotNull(comment); try { final SComment sComment = BuilderFactory.get(SSystemCommentBuilderFactory.class).createNewInstance(processInstanceId, comment, null).done(); recorder.recordInsert(new InsertRecord(sComment), COMMENT); return sComment; } catch (final SRecorderException e) { throw new SCommentAddException(processInstanceId, "system", e); } }
@Override public SComment addComment(long processInstanceId, String comment, long userId) throws SCommentAddException { NullCheckingUtil.checkArgsNotNull(processInstanceId); NullCheckingUtil.checkArgsNotNull(comment); try { final SComment sComment = BuilderFactory.get(SHumanCommentBuilderFactory.class).createNewInstance(processInstanceId, comment, userId).done(); recorder.recordInsert(new InsertRecord(sComment), COMMENT); return sComment; } catch (final SRecorderException e) { throw new SCommentAddException(processInstanceId, "human", e); } }
public SCommentAddException(long processInstanceId, final String commentType, final Exception e) { super("Can't create a " + commentType + " comment on the process instance.", e); setProcessInstanceIdOnContext(processInstanceId); }
@Override public SComment addSystemComment(final long processInstanceId, final String comment) throws SCommentAddException { NullCheckingUtil.checkArgsNotNull(processInstanceId); NullCheckingUtil.checkArgsNotNull(comment); try { final SComment sComment = BuilderFactory.get(SSystemCommentBuilderFactory.class).createNewInstance(processInstanceId, comment, null).done(); recorder.recordInsert(new InsertRecord(sComment), COMMENT); return sComment; } catch (final SRecorderException e) { throw new SCommentAddException(processInstanceId, "system", e); } }