Is Task Active

  • FireStart.isTaskActive()
    • Returns if the current task is in an active state
    • @returns {boolean} isActive

Example Form 

This example shows how to create an HTML control that checks if the task form is active and disables a text area based on that check, using the function listed above.

The first step is to configure a form, in this case, it includes a text area that should be enabled/disabled based on the state of the task form.

htmlC_19_isTaskActive_1

Now you can write your HTML content.

htmlC_20_isTaskActive_2

 

 

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;
}
textarea {
min-height:250px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var isActive = FireStart.isTaskActive();
$('#text_field').prop('disabled', isActive);
});
</script>
</head>
<body>
<div class="container">
<form>
<div class="form-group">
<label for="usr">Lorem Ipsum:</label>
<textarea class="form-control" id="text_field">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</textarea>
</div>
</form>
</div>
</body>
</html>

Save and start the workflow and check the text area. It is enabled as long as the task is in progress and is disabled as soon as the task is completed or otherwise invalid for further handling.

htmlC_21_isTaskActive_3htmlC_22_isTaskActive_4