if (processName.equalsIgnoreCase("process")) {
//TODO: Change this value to the number of requests you wish to create
int numOfInstancesToCreate = 4;
for (int i=0; i < numOfInstancesToCreate; i++){
Task initdTask = initiateProcess(bpmCtx_, processDN);//null;
// get the task number from the new task so we can use it to the get URL of the human workflow to display later.
int taskNum = initdTask.getSystemAttributes().getTaskNumber();
initdTask = wfClient_.getTaskQueryService().getTaskDetailsByNumber(bpmCtx_, taskNum);
Element rootElement = initdTask.getPayloadAsElement();
displayPayloadAsString((XMLElement)rootElement);
// Manipulate payload values as necessary
String ticketNum = "";
Date dt = new Date();
SimpleDateFormat dateFormatMonthYear = new SimpleDateFormat("MMyy");
String ticketNumberMMyy = dateFormatMonthYear.format(dt);
ticketNum = ticketNumberMMyy + "-" + initdTask.getProcessInfo().getInstanceId();
rootElement.getElementsByTagName("ticketNumber").item(0).setTextContent(ticketNum);
initdTask.setPayloadAsElement(rootElement);
displayPayloadAsString((XMLElement)initdTask.getPayloadAsElement());
try {
initdTask = taskService_.updateTask(bpmCtx_, initdTask);
} catch (StaleObjectException e) {
e.printStackTrace();
}
// Create a map to pass params to the WorklistUtil object. This is used to get the URL of the Human Workflow Task to display
Map params = new HashMap();
params.put(Constants.BPM_WORKLIST_TASK_ID, initdTask.getSystemAttributes().getTaskId());
params.put(Constants.BPM_WORKLIST_CONTEXT, bpmCtx_.getToken());
String url = "";
try {
url = WorklistUtil.getTaskDisplayURL(wfClient_, bpmCtx_, initdTask, null, "worklist", params);
} catch (Exception e) {