@SuppressWarnings("unchecked")
public BpmnNode convert(CallActivity activity) {
ActivityPropertyReader p = propertyReaderFactory.of(activity);
Node<View<R>, Edge> node = createNode(activity, p);
R definition = node.getContent().getDefinition();
definition.setGeneral(new BPMNGeneralSet(
new Name(p.getName()),
new Documentation(p.getDocumentation())
));
definition.setExecutionSet(createReusableSubprocessTaskExecutionSet(
new CalledElement(activity.getCalledElement()),
new Independent(p.isIndependent()),
new WaitForCompletion(p.isWaitForCompletion()),
new IsAsync(p.isAsync()),
new OnEntryAction(p.getOnEntryAction()),
new OnExitAction(p.getOnExitAction()),
p
));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
node.getContent().setBounds(p.getBounds());
definition.setSimulationSet(p.getSimulationSet());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}