cancel
Showing results for 
Search instead for 
Did you mean: 

How to import File Events using Import Rule Sets

Former Member
0 Kudos
104

Hi all,

I have several file events defined. They are fine working.

Now, I want to import a file event from D(evelopment) to Q(uality).

In D the file is being triggered by file file found in the following path: /Bodata/D11

In Q the file is being triggered at the following path: /Bodata/Q11

I do import this file event definition using a "Import Rule Set" - which replaces for jobchains the user, the sap system and so on. That works fine.

But I cannot make it work for file-event defintions, that the path gets replaces by the correct environmental path.

(picture shows the file event defintion, the path should change in Q)

Import_Rule_Set:

How should such a rule look like?

Accepted Solutions (1)

Accepted Solutions (1)

gmblom
Active Contributor
0 Kudos

Hello,

This cannot be done with the builtin matching rules, but you can achieve it with a few lines of code in  an Import Action.

{

  for (Iterator it = jcsImportRuleSet.getObjects().iterator(); it.hasNext();)

  {

    Object o = (Object) it.next();

    if (o instanceof FileEventDefinition)

    {

      FileEventDefinition fed = (FileEventDefinition) o;

      fed.setDirectory(fed.getDirectory().replaceAll("D11","Q11"));

    }

  }

}

Regards Gerben

Former Member
0 Kudos

Hello Gerben,

Thank you very much for this answer and the code.

I tested it and it works just fine & wonderful.

This makes life much easyer - again thanks a lot!

Best regards

Greg

Answers (0)