public String getJobParametersAsString(JobParameters jobParameters, boolean isRestart) {

		Assert.notNull(jobParameters, "jobParameters must not be null.");

		final Properties properties = this.getProperties(jobParameters);

		if (isRestart) {
			properties.put(IS_RESTART_JOB_PARAMETER_KEY, Boolean.TRUE.toString());
		}

		@SuppressWarnings({ "unchecked", "rawtypes" })
		final SortedMap<String, String> sortedJobParameters = new TreeMap(properties);

		final String jobParametersAsString;

		try {
			jobParametersAsString = new ObjectMapper().writeValueAsString(sortedJobParameters);
		}
		catch (JsonProcessingException e) {
			throw new IllegalArgumentException("Unable to convert provided job parameters to JSON String.", e);
		}
		return jobParametersAsString;
	}
This method will convert {@link JobParameters} to a JSON String. The parameters in the resulting JSON String are
sorted by the name of the parameters.

@param jobParameters Must not be null
@param isRestart When {@code true}, add a restart flag
@return A JSON String representation of the {@link JobParameters}
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/job/ExpandedJobParametersConverter.java