Forum Discussion
FICO
4 years agoCommunity Manager
VDL Actions: How to run vdl-action-execute sequentially
VDL actions are a nice addition as they allow to combine several actions behind one button. However, I couldn't make the actions run sequentially when there is (one or more) vdl-action-execute. In this example, I want to first run some Mosel code that creates a file as a scenario attachment and then allow the user to download it. Clearly, the file creation must be complete before the download starts. However, vdl-action-attachment-download does not wait for the completion of the prior action.
This didn't work:
<vdl-action-group name="exportFile">
<vdl-action-execute mode="EXPORT_FILE"></vdl-action-execute>
<vdl-action-attachment-download filename="= scenario.entities.exported_file_name.value"></vdl-action-attachment-download>
</vdl-action-group>
I tried to insert another action in between to trick it into waiting. vdl-action-attachment-download waits for a vdl-action-confirm but the latter started concurrently with the vdl-action-execute.
<vdl-action-group name="exportFile">
<vdl-action-execute mode="EXPORT_FILE"></vdl-action-execute>
<vdl-action-confirm text="Would you like to download the exported file?" title="Download"></vdl-action-confirm>
<vdl-action-attachment-download filename="= scenario.entities.exported_file_name.value"></vdl-action-attachment-download>
</vdl-action-group>
I also tried inserting another vdl-action-execute with the hope that the second one would wait for the first:
<vdl-action-group name="exportFile">
<vdl-action-execute mode="EXPORT_FILE"></vdl-action-execute>
<vdl-action-execute mode="VOID"></vdl-action-execute>
<vdl-action-confirm text="Would you like to download the exported file?" title="Download"></vdl-action-confirm>
<vdl-action-attachment-download filename="= scenario.entities.exported_file_name.value"></vdl-action-attachment-download>
</vdl-action-group>
But I got an error: Scenario execution failed. The scenario is locked.
Maybe both tried to run simultaneously.
Is there a way to make actions wait for the completion of a vdl-action-execute? Something like the "wait-for-upload" option of vdl-action-attachment-upload?
Thank you,
Miroslav
2 Replies
- FICOCommunity Manager
Hi Miroslav,
As you have seen, many of the VDL Actions run asynchronously and the next VDL Action will often be triggered while the previous Action is still working. A more useful process would be to have a another VDL Action Group that calls the Attachment Download Action and to only reveal this Action Group once your model has executed and signalled that execution has finished and the attachment is available.
- FICOCommunity Manager
Hi Joc,
This is what I was doing with two buttons but I was hoping to eliminate one. Make it simple for the end user. :)
Thank you,
Miroslav
Related Content
Related Content
Hi, How can I run multiple "vdl-action-execute" in one "vdl-action-group", like sequential? When i put multiple vdl-action-execute in a vdl-action-group, only the first one runs. Thank you in advanc
3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum9 unread comments9 unread1View0likes9Comments

