Executing transformation from script based on a variable

More
10 years 8 months ago #6017 by brettr
Hello,

I have a large Case object within a package running separate transformations based on a variable. It's calling 30+ transformations and that approach is becoming unwieldy.

To simplify, it would be good to replace the Case with a script object containing code that runs a transformation based on a variable?

e.g. something like:

var MyVar: string;
begin
MyVar = GetVariable('<MyVar>');

if MyVar = 'A' then
Result := RunTransformation('MyProject', 'MyTransGroup', 'MyTransA')

else if MyVar='B' then
Result := RunTransformation('MyProject', 'MyTransGroup', 'MyTransB')

else
Result := False;
end;

Is that possible?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #6019 by admin
Brett.

Thank you for the feedback. It is a good idea and we will implement it in the next release.

Peter

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #6036 by brettr
Thats great thanks.

I can then further simplify my example to:

begin
Result := RunTransformation('MyProject', 'MyTransGroup', 'MyTrans' + GetVariable('<MyVar>'))
end

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #6038 by admin
It is going to be sligtly different

Every object has an ID

begin
Result:=ExecuteObject(OblectID);
end

And you will be able to execute:
Transformation
SQL Script
Package
Import script(for visual importer)

ObjectID can be seen on properties dialogue box.

Mike

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #6049 by admin
Implemented in latest version


ExecuteObject(ObjectId)

Call ExecuteObject to execute Import, Sql Script or Package.
Returns 0 on success and 1 on error

Example

begin
result:=executeobject(4196)=0;
end;

Please let us know the outcome

Peter

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #6054 by brettr
Thanks,

When I reinstalled, my project disappeared. I restored it from a backup but none of my add new/update transforms are working any more. Is there a trick to upgrading?

I'm loading flat text files into Access 2003 via OLEDB.

Please Log in or Create an account to join the conversation.