private ITaggedValue getTaggedValue(String tagKey, boolean isCreateIfNotExist) {
        ITaggedValue ret = null;
        boolean isInTransaction = TransactionManager.isInTransaction();

        try {
            ProjectAccessor projectAccessor = ProjectAccessorFactory.getProjectAccessor();
            IModel project = projectAccessor.getProject();
            for (ITaggedValue ite : project.getTaggedValues()) {
                if (ite.getKey().equalsIgnoreCase(tagKey)) {
                    ret = ite;
                    break;
                }
            }

            if (ret == null && isCreateIfNotExist) {

                if (!isInTransaction)
                    TransactionManager.beginTransaction();

                ret = projectAccessor.getModelEditorFactory().getBasicModelEditor()
                        .createTaggedValue(project, tagKey, "");

                if (!isInTransaction)
                    TransactionManager.endTransaction();
            }
        } catch (Exception exp) {
            exp.printStackTrace();
            if (!isInTransaction && TransactionManager.isInTransaction()) {
                TransactionManager.abortTransaction();
            }
        }

        return ret;
    }