Accessing Migrated VBScript.net from a library in V9

I am trying to call a script written in VBScript.net that was migrated from V 7.6 to V 9.  It is in library which is referenced by the solution.  WIthin the script a function needs to be called.  I added the following code to the script so that the scipt will show in the expression builder, but it is not showing

 

[Promote(PromotionTargets.ExpressionBuilder)]

[Category("Email Notification")]

[Alias("Send Email Notification")]

publicstaticfunction SendEmailNotification( [Alias("SEN")] ework: SyncProcessData, args: Object[] ) : Object

 

Has anyone successfully called a migrated a script from a library in V9? 

 

Tagged:

Comments

  • VBScript, or in fact any script (despite Metastorm still referring to it as a script) is no longer supported server side. It is all C# code.

     

    You could probably use the 'execute' function to run v7 statements and call a script, but it is not something I would want to do nor recommend.

     

    [edit: as Ari points out, it is the Evaluate() function rather than Execute().]

  • I meant to say the script is in JScript.net.  Sorry about that.  According to the designer guide for 9.0 SR2 you can migrate server-side Jscript, VBScript and Jscript.NET files from previous versions of Designer into v9.  I migrated the script from a library, which is now a referenced library in my V9 solution.  I am now trying get the code to execute on Do This When Button pressed. 

  • You are correct.  You can use migrated scripts (VBScript, JScript.NET) in your v9 solutions, you just cannot create new ones in those languages, you must use C# for new ones.  Also the function promotion will only work for C# scripts.  In order to call the migrated scripts, you will need to use an Evaluate visual script activity with a %ScriptEval() call, as you would have done in v7.x.

  •  


    Lark wrote:

    I meant to say the script is in JScript.net.  Sorry about that.  According to the designer guide for 9.0 SR2 you can migrate server-side Jscript, VBScript and Jscript.NET files from previous versions of Designer into v9.  I migrated the script from a library, which is now a referenced library in my V9 solution.  I am now trying get the code to execute on Do This When Button pressed. 


     

    When doing migrations for clients, we rewrite all this script into C#. Converting from JScript to C# is not terribly hard as the syntax is quite similar. From VBScript is harder.

     

    You have to do it at some point (all existing code will have to be rewritten to be maintainable), so you may as well bite the bullet and do it. At the same time, you can see if any optimisations and consolidations of code can be made.