Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
def functionName = "ORDS Export Module";
LOG.info("Running function: ${functionName}");

if ('Export ORDS Module'.equals(PAYLOAD.actionName))
{
  def moduleNames = PAYLOAD.properties['Module Names'];
  def module = moduleNames[0];
  def projectId = FLEXDEPLOY.findProjectId(module[0].concat(' REST'));
  def streamId = FLEXDEPLOY.findStreamId(projectId, 'trunk');
  LOG.setMessage('Building project ${projectId}');
  FLEXDEPLOY.buildProject(streamId, projectId);
}

OIC - Export Integrations

Code Block
languagegroovy
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);
}