[midPoint] HA: HA: Send email to approval

Алексей Ващенков a.vashchenkov at solarsecurity.ru
Tue May 19 12:09:14 CEST 2015


I've just try this. 
I have notificator

         <simpleWorkflowNotifier>
            <operation>add</operation>
            <expressionFilter>
               <script>
                  <code>import com.evolveum.midpoint.notifications.api.events.WorkItemEvent
                    event instanceof WorkItemEvent;
                  </code>
               </script>
            </expressionFilter>
            <transport>mail</transport>
         </simpleWorkflowNotifier>

And I have the role
<role xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
      oid="f7bb719e-5da9-40c6-9488-25cae7f850a7"
      version="1">
   <name>Assigment testing</name>
   <metadata>
      <createTimestamp>2015-05-18T16:56:58.728+03:00</createTimestamp>
      <creatorRef oid="00000000-0000-0000-0000-000000000002" type="UserType"><!-- administrator --></creatorRef>
      <createChannel>http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</createChannel>
   </metadata>
   <activation>
      <administrativeStatus>enabled</administrativeStatus>
      <effectiveStatus>enabled</effectiveStatus>
      <enableTimestamp>2015-05-18T16:56:58.697+03:00</enableTimestamp>
   </activation>
   <iteration>0</iteration>
   <iterationToken/>
   <requestable>true</requestable>
   <approverRef xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
                oid="00000000-0000-0000-0000-000000000002"
                type="c:UserType"><!-- administrator -->
      <description>Approval by the administrator</description>
   </approverRef>
</role>

And in this case I have two "standart" notification. First is created when approval is creadte. The second notifiacation creates after request was approve. It seems after approve created another work item which generates the second notification. But I need only the first one.
________________________________________
От: midPoint [midpoint-bounces at lists.evolveum.com] от имени Pavol Mederly [mederly at evolveum.com]
Отправлено: 19 мая 2015 г. 12:45
Кому: midpoint at lists.evolveum.com
Тема: Re: [midPoint] HA:  Send email to approval

If I understand you correctly, you want to distinguish between "work item was created" and "work item was finished" events.

In order to do this, there is the changeType attribute:

private ChangeType changeType;   // ADD = process/task start, DELETE = process/task finish (for now)

You can filter for this attribute directly in the notifier configuration (in system config), by using e.g.

<operation>add</operation>

directive to send notifications only on "work item was added" (i.e. created) events.

Is this what you were asking for?

Pavol

This is clear for me.
What should I use as flag to know that approver must take a dessision?
It seems I should use operationStatusCustom. It takes values:
- null if assignment is waiting for approval
- __REJECTED__, if approver rejected an assignment
- __APPROVED__, if approver appreved the assignment
________________________________________
От: midPoint [midpoint-bounces at lists.evolveum.com<mailto:midpoint-bounces at lists.evolveum.com>] от имени Pavol Mederly [mederly at evolveum.com<mailto:mederly at evolveum.com>]
Отправлено: 19 мая 2015 г. 12:13
Кому: midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>
Тема: Re: [midPoint] Send email to approval

Alexej,

there are the following workflow-related events:

- WorkItemEvent - when a work item (a request to given approver) is
being created or finished,
- WorkflowProcessEvent - when a complete workflow process is started or
finished.

Note that a process can contain more approvals, e.g. in case of
multilevel approvals.

So, depending on what you want to achieve, you could process one (or
both) of these two events.

Regards,
Pavol

On 19. 5. 2015 11:09, Алексей Ващенков wrote:


I want to send emails only to approver while assigning a role.
What easest way to find out if the event is event abount approve adding?
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
http://lists.evolveum.com/mailman/listinfo/midpoint




_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
http://lists.evolveum.com/mailman/listinfo/midpoint
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
http://lists.evolveum.com/mailman/listinfo/midpoint




More information about the midPoint mailing list