  The correspondence between Poisson structures and symplectic groupoids,
analogous to the one of Lie algebras and Lie groups, plays an important role in
Poisson geometry; it offers, in particular, a unifying framework for the study
of hamiltonian and Poisson actions. In this paper, we extend this
correspondence to the context of Dirac structures twisted by a closed 3-form.
  More generally, given a Lie groupoid $G$ over a manifold $M$, we show that
multiplicative 2-forms on $G$ relatively closed with respect to a closed 3-form
$\phi$ on $M$ correspond to maps from the Lie algebroid of $G$ into the
cotangent bundle $T^*M$ of $M$, satisfying an algebraic condition and a
differential condition with respect to the $\phi$-twisted Courant bracket. This
correspondence describes, as a special case, the global objects associated to
twisted Dirac structures. As applications, we relate our results to equivariant
cohomology and foliation theory, and we give a new description of
quasi-hamiltonian spaces and group-valued momentum maps.
