To be able to work with the Guided Procedures (GP) design time API you need an instance of the IGPDesigntimeUpdateManager interface. It provides functionalities for creating, opening for edit, saving, activating, releasing and deleting GP objects.
The design time manager is the interface that provides access to the design time API. It is implemented in two parts:
■ IGPDesigntimeManager
■ IGPDesigntimeUpdateManager
The first interface provides read-only access to development objects, while the second one allows their modification.
You have set up your project in SAP NetWeaver Developer Studio. For more information, see Setting Up Your Project.
1. To get an instance of the design time update manager, specify an IUser and a Locale.
2. Instantiate the design time update manager.
Instantiating the GPDesigntimeUpdateManager |
import java.util.Locale; import com.sap.security.api.IUser; import com.sap.security.api.logon.IAnonymousUserFactory; import com.sap.security.api.UMFactory; import com.sap.caf.eu.gp.context.api.IGPUserContext; import com.sap.caf.eu.gp.context.api.GPContextFactory; import com.sap.caf.eu.gp.process.api.GPProcessFactory; import com.sap.caf.eu.gp.process.dt.api.IGPDesigntimeUpdateManager; import com.sap.caf.eu.gp.exception.api.GPBaseException; import com.sap.security.api.UMException;
// get the default locale Locale locale = Locale.getDefault(); try {
// get user info – we use ‘anonymous user’ for the example IAnonymousUserFactory factory = UMFactory.getAnonymousUserFactory(); IUser user = factory.getAnonymousUser(); IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user, locale);
// instantiate the design time update manager IGPDesigntimeUpdateManager manager = GPProcessFactory.getDesigntimeUpdateManager(userContext); } catch (GPBaseException e) { // exception occurred when instantiating the design time manager } catch (UMException e) { // exception occurred when getting the user info } |
3. Once you have instantiated the update design time manager, you can create and modify GP development objects.
Creating GP Development Objects
Editing GP Development Objects