Components - Filestore

Page / - zuletzt bearbeitet von Stefan Warnat am 2021/09/24 14:36

Filestore

zuletzt bearbeitet von Stefan Warnat

am 2021/09/24 14:36

Inhaltsverzeichnis

Developers

The Filestore is a temporarily storage for files, during a single execution of a workflow. It is shared between blocks in one single workflow. So you could transfer a file from block A to block B.

Every file is related to one Record (Or empty object in Mailscanner/Scheduler) in CRM and have a unique ID (The Filestore ID).
You could access the file with this ID. But only on same record, like it was stored. It is not possible to use the filestore of current Record within Workflows triggered by block “execute workflow with external records”.
In this case every execution have it’s own filestore.

Files would be deleted after the execution of Workflow is finished and no delay is still active.

Developers

If you want to use the filestore in your own actions, use the following interface of the \Workflow\VTEntity class, given to the action in $context.

To store a file inside the filestore:

$context->addTempFile($filepath, $filestoreid, $filename);

Parameter

$filepath	String	The temporarily path to the file you create This file will be moved to the central tmp directory inside Workflow Designer
$filestoreid	String	The ID you want to use, to store the File
$filename	String	The filename of this file. Could be used by tasks to use the correct filename

To load a file from filestore:

$file = $context->getTempFiles($filestoreid);

Parameter

$filestoreid	string	The ID of the file you want to get

Returns

array(

"path" => <absolute path to the file>,

"name" => <filename you set during addTempFile>

)