Get/Set Task Data

  • FireStart.getTaskData(identifier)
    • Gets the value of a BusinessEntityLink
    • @param {string} identifier - Id of the BusinessEntityLink. The format of the variable has to be Identifier.
    • @returns {string} value
  • FireStart.setTaskData(identifier, value)
    • Sets the value of a BusinessEntityLink
    • @param {string} identifier - Id of the BusinessEntityLink. The format of the variable has to be Identifier and the variable itself needs to be defined as Output.
    • @param {string} value - The value to be set, has to be in the internal format depending on the type of BusinessEntityLink, e.g. Date/Time

Note: The functions get/setTaskData() operate silently on the business entity field and do NOT refresh controls, that may have the same business entity field as a data context.

Example Form 

This example shows how to create an HTML control that gets and displays who started the workflow and writes back some text to a workflow variable using the functions listed above.

htmlC_5_taskData_1

 

HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>
<style>
body{
background-color: whitesmoke;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
var startedBy = FireStart.getTaskData('{##|BELINK:00000000-0000-0000-0000-000000000000{##|PARAM:{##|PNAME:Identifier|##}{##|PVALUE:ID|##}|##}|##}');
$('#startedBy_field').val(startedBy);
$('#text_field').on('change', function() {
FireStart.setTaskData('{##|BELINK:00000000-0000-0000-0000-000000000000{##|PARAM:{##|PNAME:Identifier|##}{##|PVALUE:ID|##}|##}|##}', $('#text_field').val());
});
});
</script>
</head>
<body>
<div class="container">
<form>
<div class="form-group">
<label for="usr">Execution started by:</label>
<input id="startedBy_field" class="form-control" disabled/>
</div>
<div class="form-group">
<label for="usr">Text to write to Business Entity:</label>
<input class="form-control" id="text_field"/>
</div>
</form>
</div>
</body>
</html>

Do not forget to set the format of the used business entity links to Identifier.

htmlC_6_taskData_2

Displayed below is the form during the workflow execution.

htmlC_7_taskData_3

 

After completing the task, the variable is now assigned the entered value. 

htmlC_8_taskData_4