001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.model.PersistedModel; 026 import com.liferay.portal.kernel.model.WorkflowInstanceLink; 027 import com.liferay.portal.kernel.search.Indexable; 028 import com.liferay.portal.kernel.search.IndexableType; 029 import com.liferay.portal.kernel.transaction.Isolation; 030 import com.liferay.portal.kernel.transaction.Propagation; 031 import com.liferay.portal.kernel.transaction.Transactional; 032 import com.liferay.portal.kernel.util.OrderByComparator; 033 034 import java.io.Serializable; 035 036 import java.util.List; 037 import java.util.Map; 038 039 /** 040 * Provides the local service interface for WorkflowInstanceLink. Methods of this 041 * service will not have security checks based on the propagated JAAS 042 * credentials because this service can only be accessed from within the same 043 * VM. 044 * 045 * @author Brian Wing Shun Chan 046 * @see WorkflowInstanceLinkLocalServiceUtil 047 * @see com.liferay.portal.service.base.WorkflowInstanceLinkLocalServiceBaseImpl 048 * @see com.liferay.portal.service.impl.WorkflowInstanceLinkLocalServiceImpl 049 * @generated 050 */ 051 @ProviderType 052 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 053 PortalException.class, SystemException.class}) 054 public interface WorkflowInstanceLinkLocalService extends BaseLocalService, 055 PersistedModelLocalService { 056 /* 057 * NOTE FOR DEVELOPERS: 058 * 059 * Never modify or reference this interface directly. Always use {@link WorkflowInstanceLinkLocalServiceUtil} to access the workflow instance link local service. Add custom service methods to {@link com.liferay.portal.service.impl.WorkflowInstanceLinkLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 060 */ 061 public WorkflowInstanceLink addWorkflowInstanceLink(long userId, 062 long companyId, long groupId, java.lang.String className, long classPK, 063 long workflowInstanceId) throws PortalException; 064 065 /** 066 * Adds the workflow instance link to the database. Also notifies the appropriate model listeners. 067 * 068 * @param workflowInstanceLink the workflow instance link 069 * @return the workflow instance link that was added 070 */ 071 @Indexable(type = IndexableType.REINDEX) 072 public WorkflowInstanceLink addWorkflowInstanceLink( 073 WorkflowInstanceLink workflowInstanceLink); 074 075 /** 076 * Creates a new workflow instance link with the primary key. Does not add the workflow instance link to the database. 077 * 078 * @param workflowInstanceLinkId the primary key for the new workflow instance link 079 * @return the new workflow instance link 080 */ 081 public WorkflowInstanceLink createWorkflowInstanceLink( 082 long workflowInstanceLinkId); 083 084 /** 085 * @throws PortalException 086 */ 087 @Override 088 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 089 throws PortalException; 090 091 public WorkflowInstanceLink deleteWorkflowInstanceLink(long companyId, 092 long groupId, java.lang.String className, long classPK) 093 throws PortalException; 094 095 /** 096 * Deletes the workflow instance link from the database. Also notifies the appropriate model listeners. 097 * 098 * @param workflowInstanceLink the workflow instance link 099 * @return the workflow instance link that was removed 100 * @throws PortalException 101 */ 102 @Indexable(type = IndexableType.DELETE) 103 public WorkflowInstanceLink deleteWorkflowInstanceLink( 104 WorkflowInstanceLink workflowInstanceLink) throws PortalException; 105 106 /** 107 * Deletes the workflow instance link with the primary key from the database. Also notifies the appropriate model listeners. 108 * 109 * @param workflowInstanceLinkId the primary key of the workflow instance link 110 * @return the workflow instance link that was removed 111 * @throws PortalException if a workflow instance link with the primary key could not be found 112 */ 113 @Indexable(type = IndexableType.DELETE) 114 public WorkflowInstanceLink deleteWorkflowInstanceLink( 115 long workflowInstanceLinkId) throws PortalException; 116 117 public void deleteWorkflowInstanceLinks(long companyId, long groupId, 118 java.lang.String className, long classPK) throws PortalException; 119 120 public DynamicQuery dynamicQuery(); 121 122 /** 123 * Performs a dynamic query on the database and returns the matching rows. 124 * 125 * @param dynamicQuery the dynamic query 126 * @return the matching rows 127 */ 128 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 129 130 /** 131 * Performs a dynamic query on the database and returns a range of the matching rows. 132 * 133 * <p> 134 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.WorkflowInstanceLinkModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 135 * </p> 136 * 137 * @param dynamicQuery the dynamic query 138 * @param start the lower bound of the range of model instances 139 * @param end the upper bound of the range of model instances (not inclusive) 140 * @return the range of matching rows 141 */ 142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 143 int end); 144 145 /** 146 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 147 * 148 * <p> 149 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.WorkflowInstanceLinkModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 150 * </p> 151 * 152 * @param dynamicQuery the dynamic query 153 * @param start the lower bound of the range of model instances 154 * @param end the upper bound of the range of model instances (not inclusive) 155 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 156 * @return the ordered range of matching rows 157 */ 158 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 159 int end, OrderByComparator<T> orderByComparator); 160 161 /** 162 * Returns the number of rows matching the dynamic query. 163 * 164 * @param dynamicQuery the dynamic query 165 * @return the number of rows matching the dynamic query 166 */ 167 public long dynamicQueryCount(DynamicQuery dynamicQuery); 168 169 /** 170 * Returns the number of rows matching the dynamic query. 171 * 172 * @param dynamicQuery the dynamic query 173 * @param projection the projection to apply to the query 174 * @return the number of rows matching the dynamic query 175 */ 176 public long dynamicQueryCount(DynamicQuery dynamicQuery, 177 Projection projection); 178 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public WorkflowInstanceLink fetchWorkflowInstanceLink(long companyId, 181 long groupId, java.lang.String className, long classPK); 182 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public WorkflowInstanceLink fetchWorkflowInstanceLink( 185 long workflowInstanceLinkId); 186 187 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 188 public ActionableDynamicQuery getActionableDynamicQuery(); 189 190 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 191 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 192 193 /** 194 * Returns the OSGi service identifier. 195 * 196 * @return the OSGi service identifier 197 */ 198 public java.lang.String getOSGiServiceIdentifier(); 199 200 @Override 201 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 202 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 203 throws PortalException; 204 205 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 206 public java.lang.String getState(long companyId, long groupId, 207 java.lang.String className, long classPK) throws PortalException; 208 209 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 210 public WorkflowInstanceLink getWorkflowInstanceLink(long companyId, 211 long groupId, java.lang.String className, long classPK) 212 throws PortalException; 213 214 /** 215 * Returns the workflow instance link with the primary key. 216 * 217 * @param workflowInstanceLinkId the primary key of the workflow instance link 218 * @return the workflow instance link 219 * @throws PortalException if a workflow instance link with the primary key could not be found 220 */ 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public WorkflowInstanceLink getWorkflowInstanceLink( 223 long workflowInstanceLinkId) throws PortalException; 224 225 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 226 public List<WorkflowInstanceLink> getWorkflowInstanceLinks(long companyId, 227 long groupId, java.lang.String className, long classPK); 228 229 /** 230 * Returns a range of all the workflow instance links. 231 * 232 * <p> 233 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.WorkflowInstanceLinkModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 234 * </p> 235 * 236 * @param start the lower bound of the range of workflow instance links 237 * @param end the upper bound of the range of workflow instance links (not inclusive) 238 * @return the range of workflow instance links 239 */ 240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 241 public List<WorkflowInstanceLink> getWorkflowInstanceLinks(int start, 242 int end); 243 244 /** 245 * Returns the number of workflow instance links. 246 * 247 * @return the number of workflow instance links 248 */ 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public int getWorkflowInstanceLinksCount(); 251 252 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 253 public boolean hasWorkflowInstanceLink(long companyId, long groupId, 254 java.lang.String className, long classPK); 255 256 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 257 public boolean isEnded(long companyId, long groupId, 258 java.lang.String className, long classPK) throws PortalException; 259 260 public void startWorkflowInstance(long companyId, long groupId, 261 long userId, java.lang.String className, long classPK, 262 Map<java.lang.String, Serializable> workflowContext) 263 throws PortalException; 264 265 public void updateClassPK(long companyId, long groupId, 266 java.lang.String className, long oldClassPK, long newClassPK) 267 throws PortalException; 268 269 /** 270 * Updates the workflow instance link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 271 * 272 * @param workflowInstanceLink the workflow instance link 273 * @return the workflow instance link that was updated 274 */ 275 @Indexable(type = IndexableType.REINDEX) 276 public WorkflowInstanceLink updateWorkflowInstanceLink( 277 WorkflowInstanceLink workflowInstanceLink); 278 }