RoleMapping loggedRoleMapping = RoleMapping.create();
loggedRoleMapping.setEndpoint(endpoint);
// ActivityReference initiatorHumanActivityReference = pm.getInitiatorHumanActivityReference(processDefinition);
// String initiatorDefVerId = initiatorHumanActivityReference.getActivity().getProcessDefinition().getId();
String fantomInstanceId = pm.initialize(processDefinition, null, loggedRoleMapping);
// ProcessInstance piRemote = pm.getProcessInstance(fantomInstanceId);
pm.executeProcess(fantomInstanceId);
pm.applyChanges();