1 <?xml version="1.0" encoding="UTF-8"?>
2 <workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="e606a877-eb2a-4ff8-ba1c-2e48aba0e869" version="0.0.3" api-version="3.1.0" allowed-operations="fve" restartMode="1" resumeFromFailedMode="0">
3 <display-name>generate_password</display-name>
5 <description>Generate a dynamic password</description>
7 <position x="100.0" y="50.0"/>
10 <param name="passwd" type="SecureString"/>
13 <workflow-item name="item0" type="end" end-mode="0">
14 <position x="384.5" y="45.40909090909091"/>
17 <workflow-item name="item1" out-name="item0" type="task">
18 <display-name>Scriptable task</display-name>
20 <script encoded="false">
21 function password_generator( len ) {
22 var length = (len)?(len):(10);
23 var string = "abcdefghijklnopqrstuvwxyz"; //to upper
24 var numeric = '0123456789';
25 var punctuation = '@%#&=';
29 while( passwd.length<length ) {
30 entity1 = Math.ceil(string.length * Math.random()*Math.random());
31 entity2 = Math.ceil(numeric.length * Math.random()*Math.random());
32 entity3 = Math.ceil(punctuation.length * Math.random()*Math.random());
33 hold = string.charAt( entity1 );
34 hold = (entity1%2==0)?(hold.toUpperCase()):(hold);
36 character += numeric.charAt( entity2 );
37 character += punctuation.charAt( entity3 );
43 var passwd=password_generator(16);
44 System.log('PASSWD_generated = '+passwd);
45 //System.log('PASSWD ='+password);
51 <bind name="passwd" type="SecureString" export-name="passwd"/>
54 <position x="204.5" y="55.40909090909091"/>