Hello all,
I’m using .NET Camunda Client Library and created the external tasks. I’m setting the dictionary with some values and using it in the .HTML form as variable data for the dropdown. But when I run the process, I can’t able to see the loaded values in the dropdown.
here’s the code.
External Task to get the list of data:
[ExternalTaskTopic("GetTriggerList")]
public class GetTriggerList : IExternalTaskAdapter
{
public void Execute(ExternalTask externalTask, ref Dictionary<string, object> resultVariables)
{
Dictionary<string, string> triggerList = new Dictionary<string, string>
{
{"06e93bd2-2e5c","ALJ FireAlarm Disable" },
{"66b3bb7d-7cc0","ALJ FireAlarm" }
};
var choice = JsonConvert.SerializeObject(triggerList);
resultVariables.Add("triggerList", choice);
}
}
HTML form:
<form class="form-horizontal" style="height: 550px;">
<div id="ActionArea">
<h2 style="text-align: center;">Action</h2>
<div style="margin-left: 20px; vertical-align: central">
<label for="selectTrigger" style="margin-right:10px"><b>Select the trigger: </b></label>
<div class="controls">
<select cam-variable-name="TRIGGER_Name"
cam-variable-type="String"
cam-choices="{{triggerList}}">
</select>
</div>
<br></br>
</div>
</div>
<script cam-script type="text/form-script">
camForm.on('form-loaded', function() {
camForm.variableManager.fetchVariable('triggerList');
});
camForm.on('variables-restored', function() {
$scope.triggerList = camForm.variableManager.variableValue('triggerList');
});
</script>
</form>
When I run the application, I see the empty dropdown list as shown in the image below. Please suggest if I’m missing something. Would appreciate any help. Thank you