@Override public Serializable execute(final Map<String, Serializable> parameters, final TenantServiceAccessor serviceAccessor) throws SCommandParameterizationException, SCommandExecutionException { final BusinessDataService businessDataService = serviceAccessor.getBusinessDataService(); final Long identifier = getLongMandadoryParameter(parameters, BUSINESS_DATA_ID); final String entityClassName = getStringMandadoryParameter(parameters, ENTITY_CLASS_NAME); final String businessDataURIPattern = getStringMandadoryParameter(parameters, BusinessDataCommandField.BUSINESS_DATA_URI_PATTERN); final String childName = getParameter(parameters, BUSINESS_DATA_CHILD_NAME); try { if (StringUtils.isNotEmpty(childName)) { return businessDataService.getJsonChildEntity(entityClassName, identifier, childName, businessDataURIPattern); } else { return businessDataService.getJsonEntity(entityClassName, identifier, businessDataURIPattern); } } catch (final SBusinessDataNotFoundException e) { throw new SCommandExecutionException(e); } catch (final SBusinessDataRepositoryException e) { throw new SCommandExecutionException(e); } }
@Override public Serializable execute(final Map<String, Serializable> parameters, final TenantServiceAccessor serviceAccessor) throws SCommandParameterizationException, SCommandExecutionException { final BusinessDataService businessDataService = serviceAccessor.getBusinessDataService(); final Long identifier = getLongMandadoryParameter(parameters, BUSINESS_DATA_ID); final String entityClassName = getStringMandadoryParameter(parameters, ENTITY_CLASS_NAME); final String businessDataURIPattern = getStringMandadoryParameter(parameters, BusinessDataCommandField.BUSINESS_DATA_URI_PATTERN); final String childName = getParameter(parameters, BUSINESS_DATA_CHILD_NAME); try { if (StringUtils.isNotEmpty(childName)) { return businessDataService.getJsonChildEntity(entityClassName, identifier, childName, businessDataURIPattern); } else { return businessDataService.getJsonEntity(entityClassName, identifier, businessDataURIPattern); } } catch (final SBusinessDataNotFoundException e) { throw new SCommandExecutionException(e); } catch (final SBusinessDataRepositoryException e) { throw new SCommandExecutionException(e); } }