Hi,
There is the "Activiti Modeler" component of Activiti which is no longer actively developed but offers an - imho - great base for a modeler (I’m still sad about the discontinuation). Check it out using the activiti-explorer (processes / model workspace / new model). It’s fully integrated into the application (model / deploy / start) – as you intend .
If you feel the urge to create something on your own (perhaps because of the license) – you need to
a) Select / Create a graph modeling environment (check Raphael, JointJS, GoJS and many more)
b) Create a BPMN Modeler on top of the framework (some frameworks, e.g. JointJS, offer pre-made BPMN modeling on different maturity levels)
c) Reuse / Create a transformation pipeline that converts the graph to an actual BPMN-XML.
To answer your question: yes, you can achieve this with Activiti. Doing it from scratch is quite some work…
Best regards
Thomas