Skip navigation links
Promotion Management Java SDK

Package com.businessobjects.sdk.lcm

This package concerns Promotion Management SDK and contains all necessary objects and utilities to programmatically perform resource transport between live systems and/or LCM archives.

See: Description

Package com.businessobjects.sdk.lcm Description

This package concerns Promotion Management SDK and contains all necessary objects and utilities to programmatically perform resource transport between live systems and/or LCM archives.

It offers workflows achievable using either the Promotion Management web-based component or the LCM command line interface.

It is based on the notion of host that represents central repository and scenario that models transport request. There are three types of scenario:

Workflows

Two main workflows are possible: The synchronous workflow can be described as follows: Alternatively the scheduled workflow can be described as follows: Each scheduled scenario is materialized by a promotion job in the central system. On the other hand synchronous workflows do not persist any job.

Classes

Package can be organized as follows:

Examples

First example illustrates how to promote WebI document(s) of a given name between two live systems:
 RunResult promoteWebIDoc( //
                IEnterpriseSession centralCms, //
                IEnterpriseSession srcCms, //
                IEnterpriseSession destCms, //
                String docName) //
                throws LCMException, SDKException {

        Host host = HostFactory.newInstance(centralCms);
        RunResult runResult;

        try {
                PromoteScenario scenario = host.newPromoteScenario("PromoteWebIDoc");

                ObjectBrowser browser = scenario.setSource(srcCms);
                browser.addQuery(and(kindIs("WebI"), nameIs(docName)));

                scenario.setDestination(destCms);

                runResult = scenario.run();

        } finally {
                host.release();
        }

        return runResult;
 }
 
Second example illustrates how to schedule a "run now" export of all object(s) under a given folder to a LCM archive:
 String scheduleFolderExport( //
                IEnterpriseSession centralCms, //
                IEnterpriseSession srcCms, //
                String srcPassword, //
                String folderCuid) //
                throws SDKException, LCMException {
 
        Host host = HostFactory.newInstance(centralCms);
        String jobCuid;
 
        try {
                ExportScenario scenario = host.newExportScenario("ScheduleFolderExport");
                scenario.setSource(srcCms).addQuery(parentCuidIs(folderCuid));
                scenario.setDestination(LcmArchiveFactory.newInstance("ScheduleFolderExport.lcmbiar"));
                scenario.getScheduling().setRightNow(true);
 
                jobCuid = scenario.schedule(srcPassword);
 
        } finally {
                host.release();
        }
 
        return jobCuid;
 }
 
Finally following snippet illustrates how to monitor a scheduled scenario execution and asses its completion status.
 RunResult monitorScheduledScenario( //
                IEnterpriseSession centralCms, //
                String jobCuid) //
                throws SDKException, LCMException, InterruptedException {
 
        Host host = HostFactory.newInstance(centralCms);
        RunResult result;
 
        try {
                SchedulingStatus status;
                do {
                        status = host.getScenarioStatus(jobCuid);
                        Thread.sleep(5 * 1000);
                } while (!status.isComplete());
 
                result = host.getScenarioResult(jobCuid);
 
        } finally {
                host.release();
        }
 
        return result;
 }
 
Skip navigation links
© Copyright 2017 SAP SE or an SAP affiliate company. All rights reserved. - Build date: October 2 2017