Use of liferay notification portlet with Activiti BPM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 08:46 AM
I am using activiti BPM in liferay for workflow.
I am currently created some task in activiti diagram.
when in workflow user create content then i want to give him notification.
I create activiti diagram so user get email notification.But i also want to give me notification him with liferay notification portlet.
How can i do that?
Is there any properties to cinfigure in Acitviti task or write some script?
Any help will be appriciated.
I am currently created some task in activiti diagram.
when in workflow user create content then i want to give him notification.
I create activiti diagram so user get email notification.But i also want to give me notification him with liferay notification portlet.
How can i do that?
Is there any properties to cinfigure in Acitviti task or write some script?
Any help will be appriciated.
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 03:29 PM
Hi Montej,
So you would like to receive the notifications inside the Notifications portlet.
In this case I think you should use a ScriptTask with a groovy script or a ServiceTask with a java delegate class.
anyway.. you choose what you prefer (I would go with a service task)
this custom "action" should create a new UserNotificationEvent with a call like:
<java>
UserNotificationEventLocalServiceUtil. addUserNotificationEvent(userId, notificationEvent);
</java>
which will be read later by the Notifications portlet.
I didn't implement a test for this approach but i just had a look over the portlet sources and I think will work.
So you would like to receive the notifications inside the Notifications portlet.
In this case I think you should use a ScriptTask with a groovy script or a ServiceTask with a java delegate class.
anyway.. you choose what you prefer (I would go with a service task)
this custom "action" should create a new UserNotificationEvent with a call like:
<java>
UserNotificationEventLocalServiceUtil. addUserNotificationEvent(userId, notificationEvent);
</java>
which will be read later by the Notifications portlet.
I didn't implement a test for this approach but i just had a look over the portlet sources and I think will work.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2015 12:26 AM
Thanks for your reply, I will try with this trick.
But can i get built in notificationEvent object or i have to create it in script?
I know that userId i can get directly but not sure about notificationEvent.
But can i get built in notificationEvent object or i have to create it in script?
I know that userId i can get directly but not sure about notificationEvent.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2015 02:28 AM
Hi,
the notificationEvent is a new object you should create it here inside your script/delegate class.
since the NotificationEvent class is loaded in the portal classLoader, you are able to create a new object in any of the portlets. (as you know the portlet class loader is a child of the portal classloader)
the notificationEvent is a new object you should create it here inside your script/delegate class.
since the NotificationEvent class is loaded in the portal classLoader, you are able to create a new object in any of the portlets. (as you know the portlet class loader is a child of the portal classloader)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2015 02:49 AM
Thanks vasile.dirla getting nice detail from you
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2015 05:28 AM
Hi ,
i am getting userId by <activiti:expression>#{userId}</activiti:expression>
I want to get "workflowInstanceId" and "workflowTaskId" id for setting up jsonObject for creating NotificationEvent.
So is there way to get this variable ?
i am getting userId by <activiti:expression>#{userId}</activiti:expression>
I want to get "workflowInstanceId" and "workflowTaskId" id for setting up jsonObject for creating NotificationEvent.
So is there way to get this variable ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2015 06:43 AM
I have got solution for notification send when task assgin to user.
Only enable email notification by following code ,the notification in notification portlet display by it self.
<serviceTask id="servicetask1" name="Send Mail" activiti:type="mail">
<extensionElements>
<activiti:field name="to">
<activiti:expression>#{liferayService.getUserEmail(userId)}</activiti:expression>
</activiti:field>
<activiti:field name="subject">
<activiti:expression>Review Task</activiti:expression>
</activiti:field>
<activiti:field name="html">
<activiti:expression>Review the below task</activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
Only enable email notification by following code ,the notification in notification portlet display by it self.
<serviceTask id="servicetask1" name="Send Mail" activiti:type="mail">
<extensionElements>
<activiti:field name="to">
<activiti:expression>#{liferayService.getUserEmail(userId)}</activiti:expression>
</activiti:field>
<activiti:field name="subject">
<activiti:expression>Review Task</activiti:expression>
</activiti:field>
<activiti:field name="html">
<activiti:expression>Review the below task</activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
