Redwood Documentation

Product Documentation

 

›Promoting Objects

RunMyJobsAutomation Concepts

Automation Concepts

  • Central Scheduling Concepts
  • Automating Processes Across the System Landscape
  • Processes, Chains, and History
  • Queues and Process Servers
  • Workload
  • SAP Systems
  • Events and Event Definitions
  • Scheduling
  • Applications
  • Editing Objects in XML

Locks and Events

  • Prevent Simultaneous Execution of Processes
  • Creating Locks
  • Creating Event-Driven Schedules with Events

Documents

  • Documenting Code, Procedures, and Messages with Documents

Applications

  • Organizing Processes in Applications
  • Creating Applications

End User Overviews

  • End User Interfaces
  • Process Monitors Overview
  • Process Monitors Overview Columns
  • User Message Monitor
  • Designing User Message Forms
  • User Message Monitor Columns
  • Interacting with User Messages
  • Feeds

Managing Output Formats

  • Managing Output Formats

Regular Activities

  • Regular Activities for Redwood Server

Promoting Objects

  • Migrating Objects with the Promotion Module
  • Exporting Redwood Server Objects
  • Export Rule Sets
  • Creating Export Rule Sets
  • Importing Objects
  • Importing Redwood Server Objects with Imports
  • Using Import Rule Sets to Customize Imports
  • Importing Objects with Import Rule Sets
  • Creating Remote Systems
  • Promotion Reaction Processes
  • Integrating Redwood Server Promotion into SAP CTS+
  • Pusher Process Definitions for SAP CTS+ Integration

Backup and Recovery

  • Backup and Recovery of Redwood Server
  • Database Backup
  • Restore Data from Backup

Reference

  • Managing Output Formats
← Using Import Rule Sets to Customize ImportsCreating Remote Systems →

Importing Objects with Import Rule Sets

You use import rule sets to customize your imports. Import rule sets allow you to organize the flow of processes between Development, Quality Assurance and Production systems. You can adapt default values of parameters, for example, to the target system. Import rule set actions allow you to further customize the objects during the import process with RedwoodScript

note

The Promotion Module requires the Module.ImportExport license key

Import Rules

Import rule sets can hold one or more import rules. When you create an import, you may specify an import rule set according to which Parameters, like INSTANCE, CLIENT, or USERNAME for SAP process definitions, can be adjusted to the new system with overrides.

Actions on import rule sets allow you to specify RedwoodScript code to be executed against the imported objects before they are written to the database. The code can be specified on the Actions tab and make use of the classes that you have stored in a library.

note

You should not persist the session in import rule set actions, as this is done for you at a later stage.

Procedure

Creating Import Rule Sets

  1. Navigate to "Promotion > Import Rule Sets".
  2. Choose New Import Rule Set from the context-menu.
  3. Fill in the details and choose the Import Rules Tab.
  4. Choose Add to create a new import rule and fill in the details.
  5. Choose Save & Close.

Using Import Rule Sets

  1. Navigate to "Promotion > Imports".
  2. Choose Import from the context-menu.
  3. Fill in the details and specify an import rule set to narrow down the imported objects.
  4. Choose Save & Close.

Examples

Pre Import - Hold a Queue Prior to the Import

You wish to prepare the environment for the objects to import, part of that requires you to hold a queue.

  1. Navigate to Applications.
  2. Choose New Application from the context-menu, select partition GLOBAL, and fill Example into the Name field.
  3. Choose Save & Close.
  4. Navigate to "Promotion > Import Rule Sets".
  5. Choose New Import Rule Set from the context-menu.
  6. Fill in a name and choose the Import Action tab.
  7. Choose Pre Import and fill the code below into the Source field.
  8. Choose Save & Close.
{
  Partition p = jcsSession.getPartitionByName("REDWOOD");
  Queue q = jcsSession.getQueueByName(p, "MSLN_Queue");
  q.hold();
}

Sample code to that holds queue REDWOOD.MSLN_Queue prior to the import.

Post Import - Using import rules to change objects during import

A CAR archive containing multiple process definitions are to be imported, these process definitions all have a parameter named SAP_SYSTEMS that needs to get a new default value. The default value in the car file is Q2A and should be replaced with PR2 to match the new system. The parameter CLIENT also needs to change from 200 to 800.

  1. Navigate to "Promotion > Import Rule Sets".
  2. Choose New Import Rule Set from the context-menu.
  3. Fill in a name and choose the Import Rules tab.
  4. Choose New Import Rule Set to create a new import rule and fill the details below into the Name and Object Type fields.
  5. Choose Add next to Parameter Matches for the Matching field and fill in the details below, do the same for Replaces.
  6. Perform steps 3 to 5 for the CLIENT parameter.
  7. Choose Save & Close.

Values

SAP_SYSTEMS parameter:

FieldValue
NameQ2A_TO_PR2
Object TypeJob Definition
Matching - NameSAP_SYSTEMS
Matching - Default ExpressionQ2A
Replaces - NameSAP_SYSTEMS
Replaces - Default ExpressionPR2

CLIENT parameter:

FieldValue
Name200_TO_800
Object TypeJob Definition
Matching - NameCLIENT
Matching - Default Expression200
Replaces - NameCLIENT
Replaces - Default Expression800

Post Import - Using RedwoodScript code to change objects on import

All referenced objects that are not in the CAR file must be in the target system, if you have unresolved references, for example, you promote from Test to Production and an application referenced by objects in the CAR file is neither in the CAR file nor in the target system, you must fix unresolved references. See Using RedwoodScript to repair missing references below.

  1. Navigate to Applications.
  2. Choose New Application from the context-menu, select partition GLOBAL, and fill Example into the Name field.
  3. Choose Save & Close.
  4. Navigate to "Promotion > Import Rule Sets".
  5. Choose New Import Rule Set from the context-menu.
  6. Fill in a name and choose the Import Action tab.
  7. Choose Post Import and fill the code below into the Source field.
  8. Choose Save & Close.
{
  Partition part = jcsSession.getPartitionByName("GLOBAL");
  Application application =  jcsSession.getApplicationByName(part, "Example");
  for (Object o : jcsImportRuleSet.getObjects())
  {
    if (o instanceof ApplicationObject)
    {
      ((ApplicationObject) o).setParentApplication(application);
    }
  }
}

Sample code to set the application or parent application to the `Example` application

Post Import - Using RedwoodScript to repair missing references

One or more objects in the CAR file reference objects that are neither in the CAR file nor in the target system, the objects have to be updated via the UnresolvedObjects Map.

  1. Navigate to Applications.
  2. If the application Example does not exist, choose New Application from the context-menu, select partition GLOBAL, end fill Example into the Name field.
  3. Choose Save & Close.
  4. Create an application named MSLN_Temporary in the GLOBAL partition.
  5. Navigate to "Promotion > Import Rule Sets".
  6. Choose New Import Rule Set from the context-menu.
  7. Fill in a name and choose the Import Action tab.
  8. Choose Post Import and fill the code below into the Source field.
  9. Choose Save & Close.
  10. Create a process definition of type RedwoodScript named RS_MSLN_TestImport with {} as the Source and MSLN_Temporary as application.
  11. Navigate to "Definitions > Processes" and export the previously created process definition (without related objects ).
  12. Delete the process definition and submit System_ProcessKeepClauses to run now.
  13. Navigate to Applications and delete application MSLN_Temporary.
  14. Submit an import with the previously created ImportRuleSet and select the previously exported car file.
  15. Navigate to "Definitions > Processes" and locate the process definition, notice the application is set to Example.
//@pragma:Unresolved

import com.redwood.scheduler.api.model.Application;
import com.redwood.scheduler.api.scripting.variables.ImportActionUnresolvedObject;
import java.util.Map;

{
  Map<Long,ImportActionUnresolvedObject> unresolved = jcsImportRuleSet.getUnresolvedObjects();
  Partition part = jcsSession.getPartitionByName("GLOBAL");
  Application exampleApp = jcsSession.getApplicationByName(part, "Example");
  unresolved.forEach((k, v)->
  {
    jcsOutLog.info("type: " + v.getObjectType());
    jcsOutLog.info("path: " + v.getPath());
    if (exampleApp != null
        && Application.OBJECT_TYPE.equals(v.getObjectType())
        && "GLOBAL.MSLN_Temporary.$2".equals(v.getPath())) //Check the application path in the source system, ensure you specify the correct path here
    {
      v.replaceWith(exampleApp);
    }
  });
}

Replace all references to application `GLOBAL.MSLN_Temporary` with application `GLOBAL.Example`.

tip

If your import action does not replace all unresolved objects, a RuntimeException will be thrown with the number of unresolved references. Submit the import without import action to get a list of unresolved references.

Post Persist - Release a Queue

  1. Navigate to "Promotion > Import Rule Sets".
  2. Choose New Import Rule Set from the context-menu.
  3. Fill in a name and choose the Import Action tab.
  4. Choose Post Persist and fill the code below into the Source field.
  5. Choose Save & Close.
{
  Partition p = jcsSession.getPartitionByName("REDWOOD");
  Queue q = jcsSession.getQueueByName(p, "MSLN_Queue");
  q.release();
}

Release queue REDWOOD.MSLN_Queue after the objects have been imported.

Post Persist - Submit a Process after Import

You wish to submit a process after import to cleanup or prepare the environment for the newly imported objects. The process definition can have been imported in the import where this runs.

  1. Navigate to "Promotion > Import Rule Sets".
  2. Choose New Import Rule Set from the context-menu.
  3. Fill in a name and choose the Import Action tab.
  4. Choose Post Persist and fill the code below into the Source field.
  5. Choose Save & Close.
  //Get imported process Definition
  Partition p = jcsSession.getPartitionByName("REDWOOD");
  JobDefinition jd =  jcsSession.getJobDefinitionByName(p, "MSLN_Installer");
  Job j = jd.prepare();

Submit a process from a Post Persist import action to cleanup after the import has completed.

See Also

  • Customizing Imports with ImportRuleSets
  • Importing Objects
  • Importing Redwood Server Objects with Imports
  • Migrating Objects with the Promotion Module
  • Privileges Required to use ImportRuleDefinition
  • Privileges Required to use ImportRuleSets
  • Privileges Required to use ImportSources
  • Export Rule Sets
  • Creating Export Rule Sets
  • Exporting Redwood Server Objects
  • Promoting Objects with Remote Systems

ImportRuleSet import rule set

← Using Import Rule Sets to Customize ImportsCreating Remote Systems →
  • Procedure
  • Examples
    • Pre Import - Hold a Queue Prior to the Import
    • Post Import - Using import rules to change objects during import
    • Values
    • Post Import - Using RedwoodScript code to change objects on import
    • Post Import - Using RedwoodScript to repair missing references
    • Post Persist - Release a Queue
    • Post Persist - Submit a Process after Import
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |