Scripting with Beanshell in CLM

Hello,
I'm wondering if someone can provide me with a document that outlines how to use the beanshell script in e-sourcing/CLM.  Also, an example of an input field vlidation script would help get us on the right track.
Thanks in advance,
Kyle

Hi Siri,
If you are talking about budgeted/estimated cost of project template then you can write the script this way to validate :
PriceIfc budgetedValue= doc.getBudgetedValue();
PriceIfc estimatedValue=doc.getEstimatedValue();
        if(hasValue(budgetedValue))
            BigDecimal projectValue=budgetedValue.getPrice();
            log("projectValue--"+projectValue);
            if(totalContractValue.getPrice()<=0.0000 )
                log("projectValue is less than or equal to 0.0000 --");
                //throw error
        else
            //throw error
This way you can validate both whether project has price, if not would throw an error. If project has price and if it is equal then also it would throw error. Please use necessary imports.
Regards,
Kumud

Similar Messages

  • Scripting with beanshell - making a thread solution...

    Ok here is the problem i have and are looking for ideas how to solve it. We have a single threadded server that are using beanshell scripts.
    Now... inside the scripts we want to be able to sleep (wait).
    For example:
    void run(){
        print("test");
        wait(5); // wait 5 seconds
        print("test2");
    }So what i would basically want is that the script is put into somekind of queue, where it will reside for 5 seconds. And then the server would step through the queue and if 5 seconds has passed it would continue executing...
    Is there any "easy" solution to fix this?

    The only solution i come up with so far is making the script call a "script manager" to do the waiting, and with that add a "callback" method.
    So the script would be like
    run(){
      print("test");
      manager.wait(2, "step2()");
    step2(){
      print("test2");
    }The manager would take care of making sure that the callback method is called at the correct time.

  • Which is better approach to manage sharepoint online - PowerShell Script with CSOM or Console Application with CSOM?

    Which is better approach to manage sharepoint online - PowerShell Script with CSOM or Console Application with CSOM?
    change in sharepoint scripts not require compilation but anything else?

    Yes, PowerShell is great, since you can quick change your code without compilation.
    SP admin can write ps scripts without specific tools like Visual Studio.
    With powershell you can use cmdlets,
    which could remove a lot of code, for example restarting a service.
    [custom.development]

  • ECATT Script with SAPGUI Commando works in consolidation but not in prod.

    Hi experts,
    I created a eCATT script with commando SAPGUI Rec. In our consolidation system it works fine but when I try to let it run in production it is not working. User scripting is enabled (in options and in rz11). I am starting the script, the production system is getting opened but afterwards there happens nothing anymore. Also the scriptingsign in the bottom right corner is not active.
    When I am running a script with TCD Rec, it works fine in production. Is there a difference between settings for scripting for TCD Rec and SAPGUI scripting? Do you have any idea which kind of influences there could be that make this difference between TCD Rec and SAPGUI Rec scripts?
    Best regards and thank you in advance!
    Jan

    Hello,
    Ideally we should not run the ecatts in the production system as this would hamper the system environment or change systems.
    Also check in RZ11 enter sapgui/user_scripting , here the values for the last three parameters are set to TRUE.
    Thanks & Best regards,
    Ajay

  • Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx.

    Sql 2008 R2
    Calling an rss script with rs.exe fails to result in a report pdf from VB6 w/ ShellEx. 
    If I call rs.exe with the various parameters from the command prompt I  have success(other than rs.exe using the temp folder, which is a different issue).  But when I try to execute the same process from a Visual Basic 6.0 application utilizing
    the ShellEx api call, the report creation and output to PDF format do not occur.   There is no error raised.
    Yes, I wish I could use a newer dev tool but that isn't an option right now. I think this should work.  Can ya'll tell me what I'm doing wrong?
    sArgs = "-i " & Chr(34) & "'C:\Program Files\Dura Supreme\OrderEntry\RunOrdReports.rss'" & Chr(34) & _
    " -s 'http://walnut/reportserver' -v 'DuraOrderNum=" & _
    Chr(34) & sOrdDuraID & Chr(34) & "' -e Exec2005 -t"
    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & Chr(34), EShellShowConstants.essSW_SHOWNORMAL, sArgs
    TIA,
    Jim M.

    ShellEx Chr(34) & "C:\Program Files\Dura Supreme\OrderEntry\rs.exe" & ....
    Hello Jim,
    The path for rs.exe includes spaces, you should set it in hyphen, as you already did for file "RunOrdReports.rss" in variable "sArgs2
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Maxl Clear Script with Substitution Variables

    Hi,
    I am new to Maxl and I am trying to write a clear script with Maxl on an ASO Cube. The script should only clear data on a certain version and year that changes every month. I am using the following syntax and it doesn't work.
    alter database ASOSamp.Sample clear data in region '{[&SV_CurrentPeriod]}';
    What is the correct syntax here?
    thanks,

    alter database ASOSamp.Sample clear data in region '{[&Test]}';...with the subvar 'Test' set to Jan...works on my 11.1.2 test system.
    Incidentally, when you say "it doesn't work", do you mean you get a MaxL error, or it doesn't clear the expected region? I was assuming the former, but you don't say.

  • Data exchange Mainscript (SCRIPT) with script block (DAC)

    Is there any way to exchange data beetwen a Mainscript (SCRIPT) with
    user-dialoges and script block (DAC) in this way that the script in
    scriptblock can access to this data?
    Background: I write a DAC-Application with some script-blocks for
    reading and writing data to/from real devices. During the development
    I'd like to simulate all device accesses because I don'd have the
    devices in my office. I write all scripts with a branch for simulation
    an real measurement on startup.
    How can I execute a swich (simulation / mesurement) without changing
    all my scripts all times? Can a script read a variable anyway (Variable
    from Mainscript, Diadem-Uservariable or "Hilfsvariable" like L1)? 
    Can I fill "DeviceParam1V" with content of a variable?
    I could use a input channel connected with a formula-block for it. (The
    formula-block can read a variable.) But this way is uncomfortable an
    don't work for input blocks.
    Martin Bohm
    [email protected]

    Because the DAC Script is executed in its own runtime environment you cannot use the DIAdem variables as in a normal VBS or a SUD.
    Still, there are ways to exchange information.
    First of all by an extra channel as Input (you named it)
    Secondly, there are several variables you can use. Have a look at the Script DAC block. There are two fields called Parameter1 and Parameter2. And each signal you configure has a parameter of its own.
    Prior to starting the scheme, you can use a script to change the value of those parameters:
    Call DACObjOpen("Script-in1")
      VBSSignalParam(1) = "abc"
    Call DACObjClose("Script-in1")
    Is changing the parameter of the first signal that is configured.
    Call DACObjOpen("Script-in1")
      VBSParameter1 = "1st device parameter"
      VBSParameter2 = "2nd device parameter"
    Call DACObjClose("Script-in1")
    is changing the global device parameters.
    On the side of the Script DAC driver VBS you cann use the paramP funtion to access the signal parameter that corresponds to the actual channel (as referenced by ChannelnumberP)
    ' SFD_ReadChannel
    ' Zweck               : Lesen eines Wertes für den Kanal "ChannelNumberP"
    ' ChannelNumberP      | Kanalnummer aus dem Block-Dialog
    ' ParamP              | Vom Anwender definierte Variable aus dem Block-Dialog
    ' DataP               | Variable zur Rückgabe des neuen Kanalwertes. Diese
    '                     | Variable sollte zumindest auf einen gültigen Wert
    '                     | initialisiert werden.
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_ReadChannel( ChannelNumberP, ParamP, DataP, ErrorP )
    End Sub
    To acces the device Parameters, use the init function:
    ' SFD_Init
    ' Zweck               : Diese Prozedur wird während des Messungsstarts aufgerufen
    ' DeviceParam1V       | Erster Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' DeviceParam2V       | Zweiter Parameter, der vom Anwender im DAC-Block
    '                     | eingegeben werden kann
    ' ErrorP              | Variable zur Rückgabe einer Fehlermeldung. Wird diese
    '                     | Variable gesetzt, stoppt DIAdem die Messung
    Sub SFD_Init( DeviceParam1V, DeviceParam2V, ErrorP )
    End Sub
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Execution of Coded UI scripts with least possible test execution time in Windows7 Operating system using Visual Studio Test Agent 2010 without VS2010 installed

    Hi All,
    We are trying to execute coded UI scripts without Visual Studio installed. We are using “Visual Studio Test Agent 2010” for executing coded UI scripts without VS2010 in Windows 7, it is working fine. Also we verified executing the same script with VS2010
    Premium, it works fine as well.
    Here the challenge we are facing is with the Test execution time.
    When we run the coded UI script with IE11-Windows 7 OS-Visual Studio 2010 Premium it takes
    3min 36sec to complete the execution whereas with IE11-Windows 7 OS-Visual Studio Test Agent 2010  it takes
    6min 40sec for the same script to execute (which is almost double the time it takes while executing using VS2010).
    My question is what may be the reason for this difference? and how we can reduce the test execution time when running from Test Agent 2010?
    Kindly let us know what is the best practice to execute the coded UI scripts with least test execution time in Windows 7 Operating system using Visual Studio Test Agent 2010 without VS2010
    installed.
    Looking forward for your positive response.
    Thanks in advance..!!

    Tina-Shi, Thanks for the information.
    As you mentioned, we tried to execute the coded UI test using Mstest.exe in command on VS2010 Premium and checked on the execution
    time, there was a slight difference.
    Please find below execution time.
    Using Mstest.exe in command on VS2010 Premium/Win7 – 3.47 minutes
    Using VS2010 Premium/Win7 – 3.53 minutes
    Using Test Agent/Win7 – 7.3 minutes
    Also, I closed all the other processes in Task manager before starting up the execution.
    Still , I am facing the same Issue. Could you please suggest any other way to reduce the scripting time of coded UI script execution
    through Test agent 2010.
    Looking forward for your earliest response.

  • SQL script with a prompt functionality.

    Hello experts,
    I tried searching this on the net but was unsucessful...
    Bascially I need to update an sql script with a prompt functionality..Basically I would like a user prompt that would enter 'Yes or No' to compile invalid objects using utlrp.
    If Yes, it should compile it
    If No it should exit out...
    Can anyone please help.. Need to do this today.
    Edited by: user568296 on Oct 2, 2009 8:18 AM

    Hi,
    As someone suggested, you're probably better off doing this at the OS level.
    SQL*Plus does not have any good mechanism for conditional branching. One trick you can do in SQL*Plus is to run one script from another by saying <tt>@@filename</tt>. By using a substitution variable (which can be defined based on the results of a query) in place of a literal filename, you can make this dynamic.
    For example, the following script runs either
    recompile.sql or
    goodbye.sql
    based on the answer to a prompt:
    ACCEPT     recompile_now      PROMPT        'Do you want to recompile objects now?  '
    COLUMN     next_script_col        NEW_VAL next_script
    SELECT     CASE     
              WHEN  UPPER ('&recompile_now') LIKE 'Y%'
              THEN  'recompile'
              ELSE  'goodbye'
         END     AS next_script_col
    FROM     dual;
    @@&next_script<tt>@@filename</tt> assumes filename.sql is on the same directory as the calling script. You could also give a full path name using only one @-sign:
    <tt>@pathname</tt>

  • Remote Execution of a script with Get-Child Item cannot find path

    Hello!
    I have been tackling this problem for a few days now and I just can't find the answer.
    I want to execute scripts remotely in parallel so that each of remote machine will run the script with their own resources.
    Below is just the simple script in the local machine server1
    $Folder = \\server1\folder\subfolder
    GCI $folder
    It works fine it I call that through my client with this I am using in my client
    invoke-command -computername server -scriptblock {powershell.exe C:\filepath\script.ps1}
    But if I change the script inside to look at another machine server 2 and do
    $folder = \\server2\folder\subfolder
    It generates an error that it cannot find that path when trying to call GCI remotely. Note that it still works if the script is run locally.
    I did some research and I see about the double-hop using credssp but I just can't get it to work.
    Any help would be appreciated.

    Each system that you're remoting into (or calling Invoke-Command against) will need to have the WSManCredSSP server role enabled. You can do this through group policy, or you can do it on a per-machine basis. Here's what you would run on a computer if you
    want to only enable it on certain computers (you should be able to run this remotely):
    Enable-WSManCredSSP -Role Server
    The system that you're running everything from will be the CredSSP client. You'll need to run this from it:
    Enable-WSManCredSSP -Role Client -DelegateComputer *.yourdomain.com
    You'll need to change the 'yourdomain.com' to your domain name (or, you could simply put a * for the delegate computer, just be aware that this will allow your computer to pass credentials along to any computer when you tell a cmdlet to use CredSSP authentication).
    Now, to use Invoke-Command, do this:
    $cred = Get-Credential
    Invoke-Command -computername server.yourdomain.com -scriptblock {"Commands go here"} -Authentication CredSSP -Credential $cred
    Notice that the -ComputerName parameter is using a fully qualified domain name. If your -DelegateComputer parameter above used a domain name, you'll have to have the FQDN here.
    Let me know if that works for you. If you want more information, you can check out the Enable-WSManCredSSP and Disable-WSManCredSSP help topics.
    Hi Rohn,
    I tried doing your instruction but it gives me this error
    Connecting to remote server failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
    After enabling the client and server with the wsmancredssp
    Here is the command I executed that produced the error
    invoke-command -computername server01.domain01 -scriptblock {get-process} -authentication credssp -credential $cred.
    Thank you very much for all the help.

  • What is the best way to run a powershell script with parameters in the Task Scheduler?

    Hello, 
    Want to run the following from a scheduled task in the Task Scheduler on a server.  What is the best approach?
    .\pscript.ps1 -csvfile "\\Srv1\Share\File.txt"
    Thanks for your help! SdeDot

    Hi,
    To run a powershell script with parameters in the Task Scheduler:
    Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Add argument (optional): -Command "& c:\scripts\test.ps1 -par1 2 -par2 3"
    Hope the below two articles be helpful for you:
    Schedule PowerShell Scripts that Require Input Values
    https://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
    How to Schedule a PowerShell Script
    http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
    Regards,
    Yan Li
    Regards, Yan Li

  • I have a bare minimum script with the following line (also had the line echo Hello World, but removed for simplicity).

    I have a bare minimum script with the following line (also had the line echo Hello World, but removed for simplicity).
    #!/bin/sh  <-- only line of code currently in the file
    when I try to run, I get the following error.  Likewise if the line is #!/bin/bash, but /bin/bash is then the bad interpreter.
    -bash: ./test.sh /bin/sh: bad interpreter: Operation not permitted
    I'm running from a terminal window.
    Any helpful hints for resolution?  Thank you in advance.

    I did some more searching and found the answer here: https://discussions.apple.com/thread/3733470?start=30&tstart=0
    I obtained TextWrangler and recreated the file.
    Thank you for your input.

  • Give some refrence to learn Java Script with HTML5lo mates,

    Hello mates,
    Can anybody please prvodi me a good refrence to learn java script with HTML5. Yes, i am new to HTML5 and Java.
    Anybody have a good refrence.
    Please Share.
    Thanks

    Sorry for misspell in thread heading.

  • Java Script With XE

    hi Expert,
    Can You Tell Me how to use Java Script With XE.
    Thanks
    Manoj

    Manoj.
    By the term "Use JavaScript", do you mean how to include JavaScript functions on your page(s) or are you looking for help in what JavaScript can be used for and how to add onclick, onchange events to form elements?
    If it is the former, there are several ways to include JavaScript onto your pages:
    1. Edit your page in the APEX Builder and place the normal syntax into the HTML Header Section i.e
    <script language="JavaScript">
    function hellWorld()
    alert ("Hello World");
    </script>2. Check out this article on how to link in File System based Javascript files: http://djmein.blogspot.com/2007/01/reference-javascript-from-file-system.html
    I hope that gets you started.
    Let me know if you need any more help.
    Duncs
    http://djmein.blogspot.com
    As a courtesy, please remember to mark correct or helpful responses accordingly :)

  • Can you run Action Scripts with Adobe Photoshop Elements 8?

    I have Photoshop Elements 5 and i cant find the 'Action' tab. Im considering buying Elements 8 but ONLY if i know for sure if i can use action scripts with it.
    Message was edited by: Jochem van Dieten

    Elements does not include Photoshop's Actions Palette function.  You can get an add on for elements that will is able to Play some Photoshop Actions in Elements. Not all Photoshop Actions actions can be played for some action use Photoshop features that are not in Elements like Photoshop Scripting. http://help.adobe.com/en_US/PhotoshopElements/8.0/Win/Using/WS961FF412-5006-4364-B315-1576 62B1F7E9.html
    http://hiddenelements.com/
    http://www.photokaboom.com/photography/learn/Photoshop_Elements/actions/1_actions.htm

Maybe you are looking for