Understanding scope of functions in powershell workflow

Copy and paste the following into a new Powershell ISE script and hit F5:
workflow workflow1{
"in workflow1"
func1
function func1 {
"in func1"
func2
function func2 {
"in func2"
workflow1
the error I get is:
The term 'func2' is not recognized as the name of a cmdlet, function, script file, or operable program
I don't understand this. Why would func1 be in scope but not func2? Any help much appreciated. TIA.

Hi guys,
I had a similar conversation over on SO: Understanding
scope of functions in powershell workflow
I'll say here what I said there:
To vaguely summarise all the responses, don't question why it behaves this way, just accept that it does and deal with it. Fair enough.
I've written a whole deployment pipeline in none-workflow Powershell and I'd like to optimise it by using workflow's "foreach -parallel" however it seems the tax on doing so is that I'd have to go back and re-write the whole thing in workflow. That's
too big a tax to pay unfortunately just to get a parallel foreach loop.
Lesson learned - use Powershell workflow from the get-go.
Corallary #1 - Understand the technology before using it.  It saves you from future pain.
¯\_(ツ)_/¯

Similar Messages

  • Performance with PowerShell Workflow intiation

    I have a workflow I want to initiate with a PowerShell script (all items in a given view), and it gets stuck on "Starting" for 3 minutes or more.  When I run the workflow manually it kicks off right away (and also completes within a second
    or two).  Since the workflow is getting initiated, why does it stay on "Starting" and complain of heavy workload?  How do I get a PowerShell initiation to match the performance of the manual initiation?
    Background:  We are running SharePoint 2013 and our site collection is in 2010 compatibility mode.  We have separate App and web front end servers.  I am running the powershell script on the WFE server.  The powershell
    script is very basic. 
    Test #1
    Manual Initiation:  Starts right away (within a second), and completes with Status "Completed"
    PowerShell Initiation:  Get Status "Starting" when PowerShell script is run with below message
    "Note: Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time."
    After 2-3 minutes, workflow completes with Status "Completed"  (so I know my simple script works)
    The above test was just with a workflow with a single step - "Stop the workflow and log 'workflow complete.'" 
    Test #2
    I tried doing a similar test with a workflow with a single user lookup and email action, and the workflow doesn't even run... you get Status "Canceled" with no errors after several minutes of the Status being "Starting" like in the test
    above
    Manual Initiation:  Starts right away (within a second), and completes with Status "Completed"
    PowerShell Initiation:  Get Status "Starting" when PowerShell script is run with below message
    "Note: Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time."
    After 2-6 minutes, workflow ends with Status "Canceled" and no errors

    Hi  ,
    According to your description, my understanding is that you cannot initiation Workflow using PowerShell.
    For troubleshooting your issue, firstly please add your site into Local intranet sites. Then you can try to  increase Throttle Size and Time Out. For more information, please have a look at the blog:
    http://sharepointwriting.blogspot.com/2014/01/sharepoint-workflow-due-to-heavy-load.html
    Also please provide detail error message of ULS log  to determine the exact cause of the error?
    For SharePoint 2013, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Eric Tao
    TechNet Community Support

  • Requirement to call Function Module in Workflow

    Hi,
    I have been assigned to task wherein i have a requierement like this . I have created a workflow with step user decision with 2 options. Now the thing is that when user select one of option i need to call function module and based on result from
    workflow i need to done further processing. Since there is no event to trigger workflow i am using function module
    SAP_WAPI_START_WORKFLOW to trigger workflow .
    Kindly suggest me how would i call Function module in workflow. i.e. What are the ways( or by which step type facilitate
    me to call FM ) by which i should call FM and do further processing based on result.
    Thanks
    Parag

    Follow the below steps inorder to call a fucntion module from the workflow
    1. First you have to create either a business class or a Business object.... from SWO1 txn..
    2. Create a method in the BOR and while created the system will prompt a message that would you like to create by using any FM here you need to specify the name of the FM that you want to use in the workflow...
    3. ONce the method is created and the code will be generated automaticlaly by the system.. and then you have to create a standard task from PFTC txn..
    4. Once the task is created then you have to use the same task in the workflow.. by creating a activity step ...
    That's all..

  • Another powershell workflow script will run in powershell ISE but no powershell command prompt.

    Hi,
    Im having some issue with a few powershell workflow scripts that will work in powershell ISE but they will appear to not run in a Admin powershell command prompt session.
    The script is simple.
    Workflow NewUser
        Param (
                [Parameter(Mandatory=$True)]
                [string] $givenname,
                [Parameter(Mandatory=$True)]
                [string] $surname,
                [Parameter(Mandatory=$True)]    
                [string] $template
        "Param1 = $givenname"
        "Param2 = $surname"
        "Param3 = $template"
    The saved file name is NewUser.ps1.
    When I run .\NewUser.ps1 -givenname test -surname test -template test
    Nothing happens.   In Powershell ISE, it outputs
    Param1 = test
    Param2 = test
    Template = test
    I can run .\NewUser.ps1 skdjfsdkfjsdkfjsdkfj in powershell command
    and nothing happens.
    I notice this behavior with a number of scripts that I get working with ISE and they dont work in powershell command prompt. 
    We are using Powershell 4.0
    Thanks Lance

    When I run
    Set-psdebug -step
    then newuser.ps1 -givename test -surname test -template test
    it gets to the line workflow newuser and quits
    am I missing some dependency?
    Running  [System.Threading.Thread]::GetDomain().GetAssemblies() in powershell commmand returns the following.
    GAC    Version        Location                                                                                       
    True   v4.0.30319     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll                                   
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\v4.0_3.0.0.0__31bf...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll      
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.C...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\Syst...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xm...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d5...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\Sy...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Management.Infrastructure\v4.0_1.0.0.0__3...
    False  v4.0.30319                                                                                                    
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\Sy...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security\v4.0_3.0.0.0__31bf385...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Activities\v4.0_3.0.0.0__31bf3...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\Sy...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Workflow.ServiceCore\v4.0_3.0....
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities.Presentation\v4.0_4.0.0.0__31bf38...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e3...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsB...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\Prese...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.X...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Core.Activities\v4.0_3.0.0.0__...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Diagnostics.Activities\v4.0_3....
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Management.Activities\v4.0_3.0...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security.Activities\v4.0_3.0.0...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Utility.Activities\v4.0_3.0.0....
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management.Activities\v4.0_3.0.0.0_...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf385...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Dat...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0_...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\Syst...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Mic...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\Syste...
    and for the ISE it returns this 
    GAC    Version        Location                                                                                                     
    True   v4.0.30319     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll                                                 
    False  v4.0.30319     C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe                                                
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ISECommon\v4.0_3.0.0.0__31bf3856ad364e35\Mic...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll                    
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Window...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll    
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\Syste...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll          
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.GPowerShell\v4.0_3.0.0.0__31bf3856ad364e35\M...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Composition\v4.0_4.0.0.0__b77a5c561934e089\...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Editor\v4.0_3.0.0.0__31bf3856ad364e35\Micros...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\Presentation...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll          
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll          
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Config...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll            
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\Syste...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationP...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll      
    False  v4.0.30319                                                                                                                  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Di...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Managemen...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Management.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e3...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll  
    False  v4.0.30319                                                                                                                  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.AeroLite\v4.0_4.0.0.0__31bf3856ad364e35\Pre...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationType...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\Pr...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f11d50a3a\Syste...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transacti...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security\v4.0_3.0.0.0__31bf3856ad364e35\Micr...
    False  v4.0.30319                                                                                                                  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.GraphicalHost\v4.0_3.0.0.0__31bf3856ad364e35...
    False  v4.0.30319                                                                                                                  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemCore\v4.0_4.0.0.0__b77a5c561934e089\P...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll            
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0__31bf3856ad364...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\P...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceProcess\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Servi...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Activities\v4.0_3.0.0.0__31bf3856ad364e35\Mi...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activitie...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Workflow.ServiceCore\v4.0_3.0.0.0__31bf3856a...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities.Presentation\v4.0_4.0.0.0__31bf3856ad364e35\Sys...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Core.Activities\v4.0_3.0.0.0__31bf3856ad364e...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Diagnostics.Activities\v4.0_3.0.0.0__31bf385...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Management.Activities\v4.0_3.0.0.0__31bf3856...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security.Activities\v4.0_3.0.0.0__31bf3856ad...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Utility.Activities\v4.0_3.0.0.0__31bf3856ad3...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management.Activities\v4.0_3.0.0.0__31bf3856ad364...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf3856ad364e35\S...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf3856ad364e35\Syst...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll  
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e08...
    True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll    
    Thanks Lance

  • How to run a Powershell workflow with WinPE 5.0?

    I have a powershell workflow script to validate a tool. It worked well with Windows 8.1 system. As the tool can be used with both Win8.1 and WinPE 5.0 environment, I would like the workflow script to run with WinPE environment to make sure
    the tool works well.  I created a WinPE UFD with Powershell module and the workflow script and the tool. And I run it and got the error message below.  I guess powershell workflow is not supported in WinPE 5.0, am I right?
    X:\Windows\61ProductInformationWinPE>ProdInfoWTool.cmd
    ワークフローを作成できません。'PSWorkflow' モジュールの型 'Microsoft.PowerShell
    .Workflow.AstToWorkflowConverter, Microsoft.PowerShell.Activities, Version=3.0.
    0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' を読み込むことができませ
    んでした。
    発生場所 X:\Windows\61ProductInformationWinPE\ProdInfoWTool.ps1:1 文字:1
    + # Standard BIOS Product Information Writing Tool Support検証項目 スクリプト
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (:) [], NotSupportedException
        + FullyQualifiedErrorId : System.NotSupportedException

    Hi DN_KOno,
    Based on my research, there is a limited build-in powershell module and cmdlets in WinPE.
    We could find more details about what Optional components of Powershell under WinPe, please go through the below link:
    http://technet.microsoft.com/library/hh824926.aspx
    I hope this helps.

  • How can i understand all the functions provided in the measurement studio for visual c++?

    Hoew do i choose the AppWizard wich ensure i have the correct header files, libraries...? What is th eMFC ClassWizard use for? How can i more understand all the functions provided in this software?

    Hi,
    It all depends on what you want to do! but in general to use MStudio the best way is to select a NI Measurement Studio AppWizard this way you will have all the classes for the MStudio components to gether with a dilog based MFC application.
    The ClassWizard will help you create classes for the components of your user interface, you can use it with the MStudio components just the same way that you use it with any control in VC++.
    If you go to the start menu and programs you should see under National Instruments a link for MStudio where you can access the help file with all the information on the components and classes. However for specific tasks or questions the best way is to use http://www.ni.com/support.
    Good luck!
    Regards,
    Juan Carlos
    N.I.

  • Understanding Scope

    Hi all,
    I'm having a little difficulty understanding scope. In particular take a look at the following example:
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    I understand that ToolKit is an abstract class and that getDefaultToolkit() is a static method. What I don't understand is how you can call the getScreenSize() from the getDefaultToolkit() using the "." notation.
    Why can't you just go Toolkit.getScreenSize(); ?
    I tried compiling both and in the latter, i got the following error:
    SwingingPad.java:32: non-static method getScreenSize() cannot be referenced from
    a static context
    Dimension screenSize = Toolkit.getScreenSize();
    ^
    1 error
    This has kind of given me the idea that I was wrong in thinking that getDefaultToolkit() was a static method, but is actually a static class. Would this be the reason why you could call the getScreenSize() as it is a method within the static inner class?
    Can anyone point me in the right direction?
    cheers

    I understand that ToolKit is an abstract class and
    that getDefaultToolkit() is a static method. What I
    don't understand is how you can call the
    getScreenSize() from the getDefaultToolkit() using the
    "." notation. The line Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize() is short for Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension screenSize = tk.getScreenSize();You must have an instance of Toolkit to use getScreenSize() and you use getDefaultToolkit() to get the default (for your system) Toolkit instance.
    Why can't you just go Toolkit.getScreenSize(); ? Because the screen size is an instance variable of a Toolkit.

  • Scope of Functional Consultant for e-SoA

    Hi,
    Can anyone explain me what is the scope of functional consultant in e-SoA.

    Wealth of information to be found in Wiki around BPX roles and you might also look at the blog entries of folks like Kartik Iyengar, Richard Hirsch, Ranjan Baghel, Owen Pettiford to see what enterprise architects are doing and how they intersect with process consultants.  You'll need to do a bit of search and discover.  Many of these folks are actively engaged in e-SOA projects and work with functional consultants in that regard.

  • Access Control functionality in Oracle workflow

    Hi everyone,
    I am doing research into access control models and workflow systems (separation of duty policies in particular). As far as I could tell, Oracle Workflow does not provide much in terms of securing access to data in a workflow process (except from the normal login authentication of course).
    One usually assigns a task's performer to a CONSTANT role from your database roles so that only certain users will have access to that task. This is not always enough though, especially when the role-hierarchy is not properly contructed and maintained. So, I've been working on a few scripts to dynamically prevent users from receiving tasks on their worklists based on their previous participation in the process (e.g. to prevent a manager from approving his own leave application).
    I was just wondering if anyone else have been working on access control in Oracle Workflow. Is there any built-in functionality that I missed that controls task-user assignment?
    Thanks,
    Carmen

    Thank you very much Sirish for your help.
    We are facing huge performance issues while Risk Analysis with Oracle Application servers through Greenlight Adaptor - its taking around 10 hours for 3000 users. Can you please point out what can be the possibilities and how can we trace out exact root cause and then solve it.
    This is happening on GRC AC 5.2 SP10 and GRC logs doesn't say much , it just gives output taken 12 secs for one user Risk Analysis.
    Here is our understanding on how GRC does Risk Analysis and our observations on our systems -->
    1. GRC asks for 1 user details at a time from Oracle Application Server - please confirm does GRC do Risk Analysis for one user at a time or a bunch of users?
    2. Oralce App server get details of that user and sends back results to GRC.
    3. Now there is a wait time for around 3 secs before Oracle Server gets request for the second user. 3 sec for one user means 2.5 hours of wait time for 3000 users. We are not able to understand why Oracle Server needs to wait for next user request from GRC?
    Would highly appreciate if you can share your experience on GRC Risk Analysis with Oracle (Greenlight Adaptor) and with SAP systems.
    Best Regards
    Davinderpal Singh

  • Checking multiple Service status using PowerShell Workflow

    Hello,
    I am planning to check status of multiple services for a list of servers using Parallel. I am finding it difficult to map an object for a computer with service's status with the main object. 
    Below is the code:
    Workflow Check-Services
    PARAM([string[]]$SvCName,[string[]]$SRVList)
    foreach -parallel ($computer in $SRVList)
    InlineScript
    $Out = @()
    foreach ($service in $SvCName)
    $props=[ordered]@{
    ComputerName=$USING:computer;
    ServiceName=$USING:service
    StartUpMode=$null
    State=$null }
    Try
    $props.StartUpMode=Get-WmiObject -class Win32_Service -ComputerName $USING:computer -ErrorAction 'Stop' | Where-Object{$_.Name -eq $USING:service} | Select-Object -ExpandProperty StartMode
    if ($props.StartUpMode -eq $null) { $props.StartUpMode = "Service does not exist" }
    Catch
    $props.StartUpMode="Error"
    Try
    $props.State=Get-WmiObject -class Win32_Service -ComputerName $USING:computer -ErrorAction 'Stop' | Where-Object{$_.Name -eq $USING:service} | Select-Object -ExpandProperty State
    if ($props.State -eq $null) { $props.State = "Service does not exist" }
    Catch
    $props.State="Error"
    $Out += New-Object -TypeName PSObject -Property $props
    Please help.
    Thanks in advance.
    Rajiv

    YOU have to learn how variables work in a workflow and how to structure PowerShell correctly.  You are writing too much code because you have not understood the basics yet.
    Workflow Check-Services{
    Param(
    [string[]]$SvCName,
    [string[]]$SRVList
    foreach -parallel ($computer in $SRVList){
    InlineScript{
    foreach ($service in $using:SvCName){
    $props=[ordered]@{
    ComputerName=$USING:computer
    ServiceName=$service
    StartMode=$null
    State='Not Found'
    if($s=Get-WmiObject -Filter "Name='$service'" -class Win32_Service -ComputerName $USING:computer){
    $props.State=$s.State
    $props.StartMode=$s.StartMode
    New-Object -TypeName PSObject -Property $props
    When you can make your code more readable it will be easier to see the mistakes.  You had numerous errors.  Go back and compare the code line by line very carefully until you understand what I changed.  Ask if you cannot understand why I made
    the change.
    ¯\_(ツ)_/¯

  • Powershell workflow generating false e-mail alerts

    Hi,
    I have a powershell script that gathers all of the trusted domains in our environment and then sends each domain name to another script to time the amount of time it takes to receive a response to an unqualified (isolated) name query in AD.
    Script 1 code:
    #Load the Active Directory Module
    Import-module activedirectory
    #Search the local schema for all trusted domain objects
    $ADDomainTrust = Get-ADObject -Filter {ObjectClass -eq "trustedDomain"} -Properties * | Sort-Object cn
    #Define workflow to pass domain names to trustsearch script
    workflow Get-domains
      param( $trusteddomainlist)
      foreach -parallel ($trusteddomain in $trusteddomainlist)
        $trust = $trusteddomain.name
          InlineScript {C:\trustsearch.ps1 $using:trust}
    Get-domains -trusteddomainlist $ADDomainTrust
    As you can see, I'm using a "foreach -parallel" workflow to query each trusted domain simultaneously. This is done to alert us to a potential problem as quickly as possible, without having to wait for the entire script to finish.
    Here's the code for the second (isolated name query) script. It sends me an e-mail if the query takes over 60 seconds. 
    Script #2 code:
     $trust=$args[0]
    foreach($domain in $trust){
    $startDTM = (get-date)
    $objUser = New-Object System.Security.Principal.NTAccount("junk")
    $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
    $strSID.Value
    $endDTM = (get-date)
    $totaltime = (($endDTM-$startDTM).TotalSeconds)
    $ftotaltime = "{0:N2}" -f $totaltime
    Function SendMail
    #SMTP server name
         $smtpServer = "<SMTP server IP address>"
         #Creating a Mail object
         $msg = new-object Net.Mail.MailMessage
         #Creating SMTP server object
         $smtp = new-object Net.Mail.SmtpClient($smtpServer)
         #Email structure
         $msg.From = "<sender e-mail address>"
         $msg.ReplyTo = "<reply e-mail address>"
         $msg.To.Add("<recipient e-mail address>"
         $msg.subject = "Isolated Name monitor warning"
         $msg.body = @"
         Isolated name queries are running slowly. A script measures how long the NAMCK domain controllers take to resolve an unqualified name query. It usually takes no more than 60 seconds to execute. It is currently taking $ftotaltime seconds.
    This may indicate a trust issue or a problem with a downstream trusted domain.
    #Sending email 
        $smtp.Send($msg)
    If ($ftotaltime -gt "60.00")
     SendMail
    Unfortunately, I'm getting a lot of false positives....e-mail alerts when query responses are taking only 7 or 8 seconds, not just over 60. It seems to happen most during the first 2 or 3 minutes the script runs. I think it has something to do with it running
    in parallel, because when I remove the "foreach -parallel" functionality, I don't get any false positives.
    Does anyone have suggestions on how to cut down or even eliminate the false positives without removing the "foreach -parallel" functionality?
    Thanks.

    I think the problem is here:
    If ($ftotaltime -gt "60.00")
    You're doing a string comparison, when you need to be doing a numeric comparison:
    If (60.00 -lt $ftotaltime)
    Here:
    $ftotaltime = "{0:N2}" -f $totaltime
    you're uisng the string format operator (-f) which is going to produce a string. String comparisons of numbers won't produce the expected results:
    PS C:\> "9.00" -gt "60.00"
    True
    Using the numeric double value 60.00 (instead of the string value "60.00"), and putting it on the LH side of the comparison will cause $ftotaltime to be coerced to a double, and you should get the expected results.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Calling Recursive function with Powershell to list all documents in the document library under a SIte collection

     function Recurse($RootFolder,$List) {
                            $Context.Load($RootFolder)
                            $Context.Load($RootFolder.Folders)
                            $Context.ExecuteQuery()
                            foreach($folder in $RootFolder.Folders)
                                if($Folder.Name -ne "Forms")
                                        $Context.Load($folder)
                                        $Context.Load($folder.Files)
                                        $Context.ExecuteQuery()
                                        foreach($file in $folder.Files)
                                            $FileCollection +=
    $file
                                        Recurse $folder $List 
                                Recurse $folder.ParentFolder $List
                                Return $FileCollection
    I am trying to traverse through SharePoint Online Site collection using Powershell CSOM. I am able to go to the last folder from the root folder which is 2-3 levels down. But I could not search through all the document libraries as it gets struck to one
    of the last document library.

    Below script is working for me. I can now traverse through all the folders and subfolders including the root folders to fetch all the files using Powershell and CSOM.
    #function begins
                        function Recurse($RootFolder) {
                            $Context.Load($RootFolder)
                            $Context.Load($RootFolder.Folders)
                            $Context.ExecuteQuery()
                            $Context.Load($RootFolder.Files)
                            $Context.ExecuteQuery()
                            $resultCollection = @()
                            foreach($file in $RootFolder.Files)
                                $resultCollection += $file
                            foreach($folder in $RootFolder.Folders)
                                if($Folder.Name -ne "Forms")
                                   Recurse $folder  
                                Return $resultCollection
                        # Function ends

  • Issue in Wait function in APEXP workflow

    Hi Friends,
    I am working on APEXP R12 12.1.3 version
    Requirement: user expecting the email notification 48hr after summation of expense if he is not submitted the image.
    Customization I have done: I have used the standard Wait function after “wait for image receipt” node to wait the workflow for 48 and sending the notification. i am passing node attribute value as Relative Time :0.5
    Issue: Wait is not working user is getting the email notification immediately

    Appreciated  for the  response and thanks in advance

  • Type RAW not accepted in function module for workflow

    Hi,
    this is a crazy thing for me:
    I like to start a workflow from a report.
    Usually will use the function module SWU_START_WORKFLOW".
    Usually this is no problem.
    Here is my current problem:
    One of the elements I have to transfer to workflow is defined with
    ZELEMENT like SXMSMGUID.
    SXMSMGUID is from type RAW.
    This type is not supported in the container element transfer.
    Tried to transfer it as CHAR.
    ZELEMENT type c,
    ZELEMENT = SXMSPEMAS-MSGGUID.
    So put the RAW element into a char element.
    Error in function module:
    Program error: ASSIGN with length 0 in program "SAPLSWA8".
    Error analysis
        An ASSIGN statement in the program "SAPLSWA8" contained a field symbol with
        length 0. This is not possible.
        length 0.
        This is not possible.
    I need that element to be transferred to the workflow.
    But how to solve that problem?
    How to move the RAW element readable into a char element (This type usually is no problem in the FM)
    Any ideas are welcome!
    Best regards
    Dirk

    ya i know that ..But I wanted to create a simple one..moreover the problem is not with bdc....It is with the function module interface..
    Also I want to ask a question that I had to define all the parameters (in the function module ) by data declaration statements in the function group top include..
    If i dont do that say the first error is when i write loop at idoc_contrl ..idoc_contrl is not declared by a data statement..So IO had to write a data statement:
    Idoc_contrl type table of edidc..I have seen that in other function modules (idoc inbound processing)  no such data declaration is done..

  • Usage of WAIT function in Oracle Workflow

    Hi all,
    I am new to Oracle Workflow, I interested to learn about WAIT function, So I gone through the docs provided by Oracle. But I am not able to figure it out. Can any one explain me abuot WAIT function in 2 or 3 lines.
    Regards
    Prakash

    check these -
    Wait Activity (Oracle Workflow Developer's Guide)
    Oracle Workflow Developer's Guide
    Workflow Wait Function

Maybe you are looking for

  • At com.sapportals.htmlb.table.TableView.getColumnCount(TableView.java:539)

    when i use the tag <hbj:tableview> in the jsp of the project portal application! 01:56_02/04/09_0006_9369850 [EXCEPTION] java.lang.NullPointerException      at com.sapportals.htmlb.table.TableView.getColumnCount(TableView.java:539)      at com.sappor

  • How to access a domain server which is targeted by Group Policy set to block Inbound and Outbound connections

    Hi, I have a practice lab with two physical servers 2012 R2, one of them is Hyper-V host and one of VMs is a domain controller. I was doeing some exercises with firewall rule deployment through Group Policy, so I created an outbound rule to block por

  • Generic code to minimize all windows in a form

    I want to write a procedure to minimize all windows in a form. This procedure will be called from a menu item. This can be done by using SET_WINDOW_PROPERTY built-in by hardcoding window names in the form and setting the window state to MINIMIZE. The

  • Target node/queue unavailable

    Hi Friends, Just Now I have completed my 2 node 11.5.10.2 installation on Linux...... (a) Database node on one machine ( Purely Database) (b) Application Tier on one Machine ( Forms,web, admin and Concurrent Manager) I have completed installation suc

  • No BI content available in BI server

    Hello , I am activating all standard business content for CRM . For some CRm extractors e.g. 0CRM_IST_ORDER_I , I replicated and activated the datasource from source , but no further objects are available in BI content (infoobjects , cubes , DSos) .