VMware Cloud Community
fredoenglish
Contributor
Contributor

How to create trigger to detect when a file is created on VCO server

Hello,

During my workflow, I would like to add a "waiting event". This workflow needs to resume when a file is created in a directory on the VCO server. I have scripted this small portion :

var strFilePath = "Import/test.txt";


var file = new File(strFilePath);

System.log(file.exists);

I'm new on VCO and don't know how to create a trigger for this. Could I use Orchestrator Policies to do so... ? In the Developer's Guide, it's explained to create a Trigger Object and to script the trigger in a Scriptible Task. After that, I don't know how to create my trigger with this specific request...

Any help would be very usefull...

Thank you.

Regards,

Fred

0 Kudos
2 Replies
cdecanini_
VMware Employee
VMware Employee

Triggers are specific objects provided by the plug-ins. Technicaly there is a thread checking on on the state of something notifying vCO when the work is done.

For example there are triggers for VCenter VM states, vCloud Tasks, VIX run command etc.

A policy allows to run a workflow and pass a parameter attached to this trigger to run a particular operation.

The code you have here is synchronous. It returns when done. You do not a trigger for it and no trigger exists for it.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
fredoenglish
Contributor
Contributor

Thank you for your answer Christophe... I'm using WebServices instead and it's working fine.

Regards,

Fred

0 Kudos