The process flow to simulate the issue
- Task1 with an download element¹ to be showed if there is a file;
- Task2 with an upload input file element² and an approve or not (approved) variable; NOTE THAT I CAN DOWNLOAD THE FILE AT THE NEXT TASK (e.g. task03) BUT NOT AT PREVIOUS TASK
- approved = false;
- Task1 show the download element¹ with the file_task2 variable; HERE THE ISSUE
¹<a id="showDownloadFileTask2" cam-file-download="file_task2"></a>
²input element at embedded formTask2:
<input type="file"
cam-variable-name="file_task2"
cam-variable-type="File"/>
Explaining the issue more deeper
I used the console.log from cam-script at embedded form
<script cam-script type="text/form-script">
$scope.userName = '';
var variableManager = camForm.variableManager;
camForm.on('form-loaded', function() {
try {
variableManager.fetchVariable('file_task2');
}
catch (err) {
console.log(err);
}
});
camForm.on('variables-fetched', function() {
console.log("file = "+variableManager.variableValue('file_task2')); //file = null
if(processAndGetVariable('file_etp_conformidadeETP') == null) {
document.getElementById('showDownloadFileTask2').style = "display: none;";
}
});
</script>
How can I access that variable from task1 form ?
Input/Output ?
Create the variable at start process?
What else can I do?
Maybe create the file variable in task2 using camunda modeler ?