if(objectGot instanceof RoleResolutionContext){
RoleResolutionContext context = (RoleResolutionContext)objectGot;
System.out.println(context.toString());
HumanActivity humanActivity = (HumanActivity)getActivity();
Role role;
if(humanActivity.getRole()!=null){
role = humanActivity.getRole();
} else {
ProcessDefinition editingDefinition = humanActivity.getProcessDefinition();
role = new Role();
role.setName(getNewRoleName(editingDefinition.getRoles()));
editingDefinition.addRole(role);
ProcessDesigner.getInstance().getProcessDefinitionDesigner().refreshActivity();
}
if(UEngineUtil.isNotEmpty(context.getDisplayName())){
String roleDisplayName = role.getDisplayName().getText();
roleDisplayName = roleDisplayName.split(":")[0];
role.setDisplayName(roleDisplayName + ":" + context.getDisplayName());
}
role.setRoleResolutionContext(context);
role.setAskWhenInit(false);
humanActivity.setRole(role);
refreshActivity();
e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
e.dropComplete(true);
}else if(objectGot instanceof Role){
Role role = (Role)objectGot;
HumanActivity humanActivity = (HumanActivity)getActivity();
humanActivity.setRole(role);
refreshActivity();
e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
e.dropComplete(true);