  In this paper we propose a theory of contact invariants and open string
invariants, which are generalizations of the relative invariants. We introduce
two moduli spaces $\bar{\mathcal{M}}_{A}(M^{+},C,g,m+\nu,{\bf y},{\bf
p},(\mathbf{k},\mathfrak{e}))$ and $\bar{\mathcal{M}}_{A}(M,L;g,m+\nu,{\bf
y},{\bf p},\overrightarrow{\mu})$, prove the compactness of the moduli spaces
and the existence of the invariants.
