Id generated in Service deligate task is not populating in the usertask embedded form field


#1

Dear Team,

I had defined the workflow in such a way that, the service task(java delegate) generates a uniquid. This Id needs to be populate in the downstream user task’s embedded form field. Please guide me how can I achieve this. Below is the delegate class code.

public void execute(DelegateExecution execution) throws Exception {
		// TODO Auto-generated method stub
		String campaignId = (String) execution.getVariable("input");
		System.out.println("campaignId Before Execution:::"+campaignId);
		campaignId = (String)generateCampaignId();
		execution.setVariable("input", campaignId);
		//Execution.
	}

#2

If you map the form field to the variable of the same name - it will populate that field with the data you’ve set.
Something like this:

<form class="form-horizontal">
  <div class="control-group">
    <label class="control-label">campaignId</label>
    <div class="controls">
      <input type="text" 
             cam-variable-name="input"
             cam-variable-type="String"
             required
             class="form-control" />
    </div>
  </div>

</form>

#3

Thank you Niall… It worked:)