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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
062            public boolean hasWorkflowInstanceLink(long companyId, long groupId,
063                    java.lang.String className, long classPK);
064    
065            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
066            public boolean isEnded(long companyId, long groupId,
067                    java.lang.String className, long classPK) throws PortalException;
068    
069            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
070            public ActionableDynamicQuery getActionableDynamicQuery();
071    
072            public DynamicQuery dynamicQuery();
073    
074            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
075            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
076    
077            /**
078            * @throws PortalException
079            */
080            @Override
081            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
082                    throws PortalException;
083    
084            @Override
085            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
086            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
087                    throws PortalException;
088    
089            /**
090            * Adds the workflow instance link to the database. Also notifies the appropriate model listeners.
091            *
092            * @param workflowInstanceLink the workflow instance link
093            * @return the workflow instance link that was added
094            */
095            @Indexable(type = IndexableType.REINDEX)
096            public WorkflowInstanceLink addWorkflowInstanceLink(
097                    WorkflowInstanceLink workflowInstanceLink);
098    
099            public WorkflowInstanceLink addWorkflowInstanceLink(long userId,
100                    long companyId, long groupId, java.lang.String className, long classPK,
101                    long workflowInstanceId) throws PortalException;
102    
103            /**
104            * Creates a new workflow instance link with the primary key. Does not add the workflow instance link to the database.
105            *
106            * @param workflowInstanceLinkId the primary key for the new workflow instance link
107            * @return the new workflow instance link
108            */
109            public WorkflowInstanceLink createWorkflowInstanceLink(
110                    long workflowInstanceLinkId);
111    
112            /**
113            * Deletes the workflow instance link from the database. Also notifies the appropriate model listeners.
114            *
115            * @param workflowInstanceLink the workflow instance link
116            * @return the workflow instance link that was removed
117            * @throws PortalException
118            */
119            @Indexable(type = IndexableType.DELETE)
120            public WorkflowInstanceLink deleteWorkflowInstanceLink(
121                    WorkflowInstanceLink workflowInstanceLink) throws PortalException;
122    
123            public WorkflowInstanceLink deleteWorkflowInstanceLink(long companyId,
124                    long groupId, java.lang.String className, long classPK)
125                    throws PortalException;
126    
127            /**
128            * Deletes the workflow instance link with the primary key from the database. Also notifies the appropriate model listeners.
129            *
130            * @param workflowInstanceLinkId the primary key of the workflow instance link
131            * @return the workflow instance link that was removed
132            * @throws PortalException if a workflow instance link with the primary key could not be found
133            */
134            @Indexable(type = IndexableType.DELETE)
135            public WorkflowInstanceLink deleteWorkflowInstanceLink(
136                    long workflowInstanceLinkId) throws PortalException;
137    
138            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
139            public WorkflowInstanceLink fetchWorkflowInstanceLink(long companyId,
140                    long groupId, java.lang.String className, long classPK);
141    
142            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
143            public WorkflowInstanceLink fetchWorkflowInstanceLink(
144                    long workflowInstanceLinkId);
145    
146            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147            public WorkflowInstanceLink getWorkflowInstanceLink(long companyId,
148                    long groupId, java.lang.String className, long classPK)
149                    throws PortalException;
150    
151            /**
152            * Returns the workflow instance link with the primary key.
153            *
154            * @param workflowInstanceLinkId the primary key of the workflow instance link
155            * @return the workflow instance link
156            * @throws PortalException if a workflow instance link with the primary key could not be found
157            */
158            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
159            public WorkflowInstanceLink getWorkflowInstanceLink(
160                    long workflowInstanceLinkId) throws PortalException;
161    
162            /**
163            * Updates the workflow instance link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
164            *
165            * @param workflowInstanceLink the workflow instance link
166            * @return the workflow instance link that was updated
167            */
168            @Indexable(type = IndexableType.REINDEX)
169            public WorkflowInstanceLink updateWorkflowInstanceLink(
170                    WorkflowInstanceLink workflowInstanceLink);
171    
172            /**
173            * Returns the number of workflow instance links.
174            *
175            * @return the number of workflow instance links
176            */
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public int getWorkflowInstanceLinksCount();
179    
180            /**
181            * Returns the OSGi service identifier.
182            *
183            * @return the OSGi service identifier
184            */
185            public java.lang.String getOSGiServiceIdentifier();
186    
187            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
188            public java.lang.String getState(long companyId, long groupId,
189                    java.lang.String className, long classPK) throws PortalException;
190    
191            /**
192            * Performs a dynamic query on the database and returns the matching rows.
193            *
194            * @param dynamicQuery the dynamic query
195            * @return the matching rows
196            */
197            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
198    
199            /**
200            * Performs a dynamic query on the database and returns a range of the matching rows.
201            *
202            * <p>
203            * 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.
204            * </p>
205            *
206            * @param dynamicQuery the dynamic query
207            * @param start the lower bound of the range of model instances
208            * @param end the upper bound of the range of model instances (not inclusive)
209            * @return the range of matching rows
210            */
211            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
212                    int end);
213    
214            /**
215            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
216            *
217            * <p>
218            * 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.
219            * </p>
220            *
221            * @param dynamicQuery the dynamic query
222            * @param start the lower bound of the range of model instances
223            * @param end the upper bound of the range of model instances (not inclusive)
224            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
225            * @return the ordered range of matching rows
226            */
227            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
228                    int end, OrderByComparator<T> orderByComparator);
229    
230            /**
231            * Returns a range of all the workflow instance links.
232            *
233            * <p>
234            * 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.
235            * </p>
236            *
237            * @param start the lower bound of the range of workflow instance links
238            * @param end the upper bound of the range of workflow instance links (not inclusive)
239            * @return the range of workflow instance links
240            */
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public List<WorkflowInstanceLink> getWorkflowInstanceLinks(int start,
243                    int end);
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public List<WorkflowInstanceLink> getWorkflowInstanceLinks(long companyId,
247                    long groupId, java.lang.String className, long classPK);
248    
249            /**
250            * Returns the number of rows matching the dynamic query.
251            *
252            * @param dynamicQuery the dynamic query
253            * @return the number of rows matching the dynamic query
254            */
255            public long dynamicQueryCount(DynamicQuery dynamicQuery);
256    
257            /**
258            * Returns the number of rows matching the dynamic query.
259            *
260            * @param dynamicQuery the dynamic query
261            * @param projection the projection to apply to the query
262            * @return the number of rows matching the dynamic query
263            */
264            public long dynamicQueryCount(DynamicQuery dynamicQuery,
265                    Projection projection);
266    
267            public void deleteWorkflowInstanceLinks(long companyId, long groupId,
268                    java.lang.String className, long classPK) throws PortalException;
269    
270            public void startWorkflowInstance(long companyId, long groupId,
271                    long userId, java.lang.String className, long classPK,
272                    Map<java.lang.String, Serializable> workflowContext)
273                    throws PortalException;
274    
275            public void updateClassPK(long companyId, long groupId,
276                    java.lang.String className, long oldClassPK, long newClassPK)
277                    throws PortalException;
278    }