Руководство Разработчика для Cisco Cisco UCS Director 5.0

Скачать
Страница из 31
Cisco UCS Director Cloupia Script Cookbook  
 
 
10 
 
 
6.  To overwrite the existing task with the imported task, check the Overwrite if 
the task exists with same name check box. 
  If the  Overwrite if the task exists with same name check box is 
unchecked, a new task will be added with a number (n) to make the 
name unique. 
7.  Click Import
 
 
Custom Task Example: Get Submitter Details 
 
function getSubmitterDetails(){ 
// Get the current workflow submitter’s profile 
var userProfile = ctxt.getAPI().userAPIGetMyLoginProfile(); 
output.SUBMITTER_USERID = ctxt.getUserId(); 
output.SUBMITTER_FIRSTNAME = userProfile.getFirstName(); 
output.SUBMITTER_LASTNAME = userProfile.getLastName(); 
output.SUBMITTER_GROUP_NAME =  userProfile.getGroupName(); 
// output fields are always Strings, to convert ID to 
string 
output.SUBMITTER_GROUP_ID =  ""+userProfile.getGroupId(); 
output.SUBMITTER_ROLE =  userProfile.getRole(); 
output.SUBMITTER_EMAIL = userProfile.getEmail(); 

getSubmitterDetails();