@@ -41,6 +41,9 @@ var data;
4141var type ;
4242var flowServiceId ;
4343var scheduleStatus ;
44+ var optionEnable ;
45+ var flowOptionType ;
46+ var incEdgeFlows ;
4447
4548
4649const maxRunningWorkflows = 20 ;
@@ -72,20 +75,77 @@ function init(inDomainName, inUsername, inPassword,inTimeout,inPrettyprint){
7275}
7376
7477
78+ function flowserviceDetails ( inProjectId , includeEdgeFlows )
79+ {
80+ projectId = inProjectId ;
81+ incEdgeFlows = includeEdgeFlows
82+ finalCall = processflowDetails ;
83+ loginPhase1 ( ) ;
84+ }
85+
86+ function processflowDetails ( )
87+ {
88+ debug ( "Process FlowService Details - Project [" + projectId + "] Include Edge flows [" + incEdgeFlows + "]" ) ;
89+ var endPoint = "https://" + domainName + "/integration/rest/ut-flow/flow-metadata/" + projectId + "?limit=" + returnCount + "&skip=" + returnStart ;
90+ var body ;
91+ debug ( "Next URL [" + endPoint + "]" ) ;
92+ var headers = setHeaders ( ) ;
93+ rest . custom ( endPoint , undefined , undefined , timeout , body , undefined , "GET" , processResponse , undefined , headers , true , false ) ;
94+ }
95+
96+ function flowserviceOption ( inFlowServiceId , inEnable , inProjectId , inOptionType )
97+ {
98+ flowServiceId = inFlowServiceId ;
99+ optionEnable = inEnable ;
100+ projectId = inProjectId ;
101+ flowOptionType = inOptionType ;
102+ finalCall = processflowOption ;
103+ loginPhase1 ( ) ;
104+ }
105+
106+ function processflowOption ( )
107+ {
108+ debug ( "Process FlowService Option [" + flowOptionType + "] - Project [" + projectId + "] FlowService [" + flowServiceId + "] Enable [" + optionEnable + "]" ) ;
109+ if ( optionEnable !== undefined && optionEnable !== null & optionEnable . length > 1 ) {
110+ optionEnable = ( optionEnable . toLowerCase ( ) == "true" ) ;
111+ }
112+
113+ var endPoint = "https://" + domainName + "/integration/rest/ut-flow/flow/" ;
114+ var body = { } ;
115+ if ( flowOptionType == "http" )
116+ {
117+ endPoint += "export/" + flowServiceId + "?projectName=" + projectId ;
118+ body = { "integration" :{ "serviceData" :{ "stages" :[ { "stageName" :"stage00" , "markExportable" :optionEnable } ] } } } ;
119+ }
120+ else if ( flowOptionType == "resubmit" )
121+ {
122+ endPoint += "resubmit/" + flowServiceId + "?projectName=" + projectId ;
123+ body = { "integration" :{ "serviceData" :{ "stages" :[ { "stageName" :"stage00" , "markResubmittable" :optionEnable } ] } } } ;
124+ }
125+ else
126+ {
127+ console . log ( "Unable to determine flow option type: " + flowOptionType ) ;
128+ process . exit ( 1 ) ;
129+ }
130+
131+ debug ( "Next URL [" + endPoint + "]" ) ;
132+ var headers = setHeaders ( ) ;
133+ rest . custom ( endPoint , undefined , undefined , timeout , body , undefined , "PUT" , processResponse , undefined , headers , true , false ) ;
134+ }
135+
136+
75137function flowserviceScheduler ( inFlowServiceId , inScheduleStatus , inProjectId )
76138{
77139 flowServiceId = inFlowServiceId ;
78140 scheduleStatus = inScheduleStatus ;
79141 projectId = inProjectId ;
80142 finalCall = processScheduleStatus ;
81- debug ( "******************Starting FlowService Scheduler" ) ;
82143 loginPhase1 ( ) ;
83144}
84145
85146function processScheduleStatus ( )
86147{
87148 debug ( "Process FlowService Schedule Status - Project [" + projectId + "] FlowService [" + flowServiceId + "] Status [" + scheduleStatus + "]" ) ;
88-
89149 var endPoint = "https://" + domainName + "/integration/rest/scheduler/" + scheduleStatus + "/" + flowServiceId + "?projectName=" + projectId ;
90150 debug ( "Next URL [" + endPoint + "]" ) ;
91151 var headers = setHeaders ( ) ;
@@ -1037,4 +1097,4 @@ module.exports = {init,
10371097 connectorAccounts, getProjectAccountConfig,
10381098 getMonitorInfo, workflowResubmit,
10391099 messagingCreate, messagingStats, messagingDelete,
1040- vbidAnalysis, flowserviceScheduler} ;
1100+ vbidAnalysis, flowserviceScheduler, flowserviceOption , flowserviceDetails } ;
0 commit comments