import flexagon.fd.model.pojos.workflowrequest.ExecuteOptions;
import flexagon.fd.model2.pojo.CodeValueInputPOJO;
def functionName = "Export OIC Extensions";
LOG.info("Running function: ${functionName}");
// make sure to name your payload this, or to change what's its checking for here.
if ("Export OIC".equals(PAYLOAD.actionName))
{
// find all the given ID's and put them into CSV list
def builder = new StringBuilder();
def integrationIds = PAYLOAD.properties["Integration IDs"].findAll()[0];
for (def integration in integrationIds)
{
builder.append(integration);
builder.append(",");
}
// Give the list as a workflow input
ExecuteOptions eo = new ExecuteOptions();
def integrationListInput = new CodeValueInputPOJO("INTEGRATION_LIST", builder.toString());
eo.setWorkflowInputs([integrationListInput]);
// execute the utility project that will export the integrations and save them to SCM. Project ID is hardcoded here, since there is only 1 project.
FLEXDEPLOY.executeUtility(24945992, "DEV", eo);
} |