This is a sample of how to create a basic workflow orchestrator workflow using the Build Tools.
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: Samples / WorflowGeneralSampleBasic.wf.ts
import{Logger}from"com.vmware.pscoe.library.ts.logging/Logger";
import{DefaultErrorHandler,In,Item,Out,RootItem,Workflow}from"vrotsc-annotations";
@Workflow({
name:"Sample - Basic",
path:"CompanyName/Workflows/General",
description:"",
restartMode:1,// restartMode - 0: Do not resume workflow run, 1: Resume workflow run (default)
resumeFromFailedMode:0,// resumeFromFailedMode - 0: System default (default), 1: Enabled, 2: Disabled
attributes:{
businessStatus:{
type:"string"
},
endMode:{
type:"number"
},
strErrorMessage:{
type:"string"
},
},
input:{
strProjectID:{
type:"string"
}
},
output:{
},
})
exportclassgeneralSampleBasic{
@RootItem({
target:"workflowExecute",
})
publicworkflowStart():void{
}
@Item({
target:"workflowEnd",
})
publicworkflowExecute(@InstrProjectID:string):void{
try{
letstrResourceActionType:string="General";
letstrResourceActionName:string="Sample - Basic";
letobjLogger:Logger=Logger.getLogger(`${strResourceActionType} -${strResourceActionName}`);
letobjError:Error=objExceptionasError;
objLogger.error(`${strFunctionName} - Name:${objError.name}`);
objLogger.error(`${strFunctionName} - Message:${objError.message}`);
if (objError.stack){
objLogger.error(`${strFunctionName} - Message:${objError.message}`);
}
if (strCustomErrorMessage!==""){
objLogger.error(`${strFunctionName} - Custom Error Message:${strCustomErrorMessage}`);
}
}catch (e){
throwe;
}finally{
}
}
@WorkflowEndItem({
endMode:0
})
publicworkflowEnd(){
// NOOP
}
}
Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
