Skip to content

Commit 4b3b714

Browse files
committed
added HTTP + Resubmit for FlowService plus details
1 parent 879894d commit 4b3b714

File tree

2 files changed

+104
-5
lines changed

2 files changed

+104
-5
lines changed

experimental.js

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ var data;
4141
var type;
4242
var flowServiceId;
4343
var scheduleStatus;
44+
var optionEnable;
45+
var flowOptionType;
46+
var incEdgeFlows;
4447

4548

4649
const 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+
75137
function 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

85146
function 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};

wmiocli.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ program.command('experimental-workflow-execution-analysis <vbid> [format]', { hi
753753
})
754754

755755

756-
program.command('experimental-flowservice-scheduler <project-id> <flowservice-id> <schdeule-status>', { hidden: hideExperimental })
757-
.description('Provide workflow exedcution analysis')
756+
program.command('experimental-flowservice-scheduler <project-id> <flowservice-id> <schedule-status>', { hidden: hideExperimental })
757+
.description('Enable/Disable FlowService Schedules')
758758
.action((projectId, flowServiceId,scheduleStatus) => {
759759
checkOptions();
760760
//Valid status = pause or resume.
@@ -767,6 +767,45 @@ program.command('experimental-flowservice-scheduler <project-id> <flowservice-id
767767
experimental.init(tenantDomain, tenantUser, tenantPw, program.opts().timeout, program.opts().prettyprint)
768768
experimental.flowserviceScheduler(flowServiceId,scheduleStatus,projectId);
769769
})
770+
771+
program.command('experimental-flowservice-http <project-id> <flowservice-id> <enable>', { hidden: hideExperimental })
772+
.description('Enable/Disable FlowService HTTP')
773+
.action((projectId, flowServiceId,enable) => {
774+
checkOptions();
775+
//Valid status = pause or resume.
776+
enable = enable.toLowerCase();
777+
if(enable != "true" && enable !="false")
778+
{
779+
console.log("Enable should be set to one of either true or false. You provided: " + enable);
780+
process.exit(1);
781+
}
782+
experimental.init(tenantDomain, tenantUser, tenantPw, program.opts().timeout, program.opts().prettyprint)
783+
experimental.flowserviceOption(flowServiceId,enable,projectId,"http");
784+
})
785+
786+
program.command('experimental-flowservice-resubmit <project-id> <flowservice-id> <enable>', { hidden: hideExperimental })
787+
.description('Enable/Disable FlowService Resubmit')
788+
.action((projectId, flowServiceId,enable) => {
789+
checkOptions();
790+
//Valid status = pause or resume.
791+
enable = enable.toLowerCase();
792+
if(enable != "true" && enable !="false")
793+
{
794+
console.log("Enable should be set to one of either true or false. You provided: " + enable);
795+
process.exit(1);
796+
}
797+
experimental.init(tenantDomain, tenantUser, tenantPw, program.opts().timeout, program.opts().prettyprint)
798+
experimental.flowserviceOption(flowServiceId,enable,projectId,"resubmit");
799+
})
800+
801+
program.command('experimental-flowservice-details <project-id>', { hidden: hideExperimental })
802+
.description('Get FlowService details from project')
803+
.action((projectId) => {
804+
checkOptions();
805+
experimental.init(tenantDomain, tenantUser, tenantPw, program.opts().timeout, program.opts().prettyprint)
806+
experimental.flowserviceDetails(projectId,"false");
807+
})
808+
770809
program.parse();
771810

772811

0 commit comments

Comments
 (0)