Exchange Powershell return value from Get-command to variable.

Hi
I am trying to create a powershell-script for our monitoring-software.
The script is supposed to establish a connection to our exchange-server mgmt-shell and execute this command:
"Get-MailboxDatabaseCopyStatus"
I have the connection in place, but am missing the knowledge of how to return the result of the command to my script, which I can then pass to our monitoring-software.
(The script take 2 parameters - host and command eg. exch01.domain and Get-MailboxDatabaseCopyStatus).
Current code:
$statusAlive = "ScriptRes:Host is alive:"
$statusDead = "ScriptRes:No answer:"
$statusUnknown = "ScriptRes:Unknown:"
$statusNotResolved = "ScriptRes:Unknown host:"
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$statusBadContents = "ScriptRes:Bad contents:"
$pass = cat C:\securestring.txt | convertto-securestring
$Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\administrator",$pass
$host = $args[0]
$command = $args[1]
<#
if (!$args[0]) {
echo $statusUnknown"Host parameter is empty"
exit
if (!$args[1]) {
echo $statusUnknown"Command parameter is empty"
exit
#>
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$host/powershell -Credential $cred
Import-PSSession $session
$command
Remove-PSSession $session
Now, how do I "catch" the value of the executed command and return it to a variable in the script?
Best Regards,
Soren

Hmm.. doesnt seem to work quite right.
I added "Echo $result" after "Remove-PSSession $session", but then I just get a bunch of information..
Script tmp_c3a1c132-f4d9-4d61... {Get-IRMConfiguration, New-MailUser, Get-PublicFolderMigrationRequestSta...
RunspaceId : 2d179364-2df3-483d-a192-f5f4ca9453bb
Identity : DB02 - Specielle\EXCHANGE01
Id : DB02 - Specielle\EXCHANGE01
Name : DB02 - Specielle\EXCHANGE01
DatabaseName : DB02 - Specielle
Status : Mounted
InstanceStartTime : 01-03-2014 03:35:07
LastStatusTransitionTime :
MailboxServer : EXCHANGE01
ActiveDatabaseCopy : EXCHANGE01
ActiveCopy : True
ActivationPreference : 1
StatusRetrievedTime : 11-03-2014 08:30:15
WorkerProcessId : 8124
ActivationSuspended : False
ActionInitiator : Unknown
ErrorMessage :
ErrorEventId :
ExtendedErrorInfo :
SuspendComment :
RequiredLogsPresent :
SinglePageRestore : 0
ContentIndexState : Healthy
ContentIndexErrorMessage :
ContentIndexVersion : 1
ContentIndexBacklog : 0
ContentIndexRetryQueueSize : 0
ContentIndexMailboxesToCrawl :
ContentIndexSeedingPercent :
ContentIndexSeedingSource :
CopyQueueLength : 0
ReplayQueueLength : 0
ReplaySuspended : False
ResumeBlocked : False
ReseedBlocked : False
MinimumSupportedDatabaseSchemaVersion : 0.121
MaximumSupportedDatabaseSchemaVersion : 0.125
RequestedDatabaseSchemaVersion : 0.125
LatestAvailableLogTime :
LastCopyNotificationedLogTime :
LastCopiedLogTime :
LastInspectedLogTime :
LastReplayedLogTime :
LastLogGenerated : 0
LastLogCopyNotified : 0
LastLogCopied : 0
LastLogInspected : 0
LastLogReplayed : 0
LowestLogPresent : 0
LastLogInfoIsStale : False
LastLogInfoFromCopierTime :
LastLogInfoFromClusterTime :
LastLogInfoFromClusterGen : 0
LogsReplayedSinceInstanceStart : 0
LogsCopiedSinceInstanceStart : 0
LatestFullBackupTime :
LatestIncrementalBackupTime :
LatestDifferentialBackupTime :
LatestCopyBackupTime :
SnapshotBackup :
SnapshotLatestFullBackup :
SnapshotLatestIncrementalBackup :
SnapshotLatestDifferentialBackup :
SnapshotLatestCopyBackup :
LogReplayQueueIncreasing : False
LogCopyQueueIncreasing : False
ReplayLagStatus :
DatabaseSeedStatus :
OutstandingDumpsterRequests : {}
OutgoingConnections :
IncomingLogCopyingNetwork :
SeedingNetwork :
DiskFreeSpacePercent : 50
DiskFreeSpace : 20.02 GB (21,498,761,216 bytes)
DiskTotalSpace : 40 GB (42,946,523,136 bytes)
ExchangeVolumeMountPoint :
DatabaseVolumeMountPoint : E:\
DatabaseVolumeName : \\?\Volume{e6cb407f-e4f2-11e2-93eb-005056ae239d}\
DatabasePathIsOnMountedFolder : False
LogVolumeMountPoint : F:\
LogVolumeName : \\?\Volume{e6cb4087-e4f2-11e2-93eb-005056ae239d}\
LogPathIsOnMountedFolder : False
LastDatabaseVolumeName :
LastDatabaseVolumeNameTransitionTime :
VolumeInfoError :
IsValid : True
ObjectState : Unchanged
RunspaceId : 2d179364-2df3-483d-a192-f5f4ca9453bb
Identity : DB01 - Standard\EXCHANGE01
Id : DB01 - Standard\EXCHANGE01
Name : DB01 - Standard\EXCHANGE01
DatabaseName : DB01 - Standard
Status : Mounted
InstanceStartTime : 01-03-2014 03:35:07
LastStatusTransitionTime :
MailboxServer : EXCHANGE01
ActiveDatabaseCopy : EXCHANGE01
ActiveCopy : True
ActivationPreference : 1
StatusRetrievedTime : 11-03-2014 08:30:15
WorkerProcessId : 8140
ActivationSuspended : False
ActionInitiator : Unknown
ErrorMessage :
ErrorEventId :
ExtendedErrorInfo :
SuspendComment :
RequiredLogsPresent :
SinglePageRestore : 0
ContentIndexState : Healthy
ContentIndexErrorMessage :
ContentIndexVersion : 1
ContentIndexBacklog : 3
ContentIndexRetryQueueSize : 0
ContentIndexMailboxesToCrawl :
ContentIndexSeedingPercent :
ContentIndexSeedingSource :
CopyQueueLength : 0
ReplayQueueLength : 0
ReplaySuspended : False
ResumeBlocked : False
ReseedBlocked : False
MinimumSupportedDatabaseSchemaVersion : 0.121
MaximumSupportedDatabaseSchemaVersion : 0.125
RequestedDatabaseSchemaVersion : 0.125
LatestAvailableLogTime :
LastCopyNotificationedLogTime :
LastCopiedLogTime :
LastInspectedLogTime :
LastReplayedLogTime :
LastLogGenerated : 0
LastLogCopyNotified : 0
LastLogCopied : 0
LastLogInspected : 0
LastLogReplayed : 0
LowestLogPresent : 0
LastLogInfoIsStale : False
LastLogInfoFromCopierTime :
LastLogInfoFromClusterTime :
LastLogInfoFromClusterGen : 0
LogsReplayedSinceInstanceStart : 0
LogsCopiedSinceInstanceStart : 0
LatestFullBackupTime :
LatestIncrementalBackupTime :
LatestDifferentialBackupTime :
LatestCopyBackupTime :
SnapshotBackup :
SnapshotLatestFullBackup :
SnapshotLatestIncrementalBackup :
SnapshotLatestDifferentialBackup :
SnapshotLatestCopyBackup :
LogReplayQueueIncreasing : False
LogCopyQueueIncreasing : False
ReplayLagStatus :
DatabaseSeedStatus :
OutstandingDumpsterRequests : {}
OutgoingConnections :
IncomingLogCopyingNetwork :
SeedingNetwork :
DiskFreeSpacePercent : 50
DiskFreeSpace : 20.02 GB (21,498,761,216 bytes)
DiskTotalSpace : 40 GB (42,946,523,136 bytes)
ExchangeVolumeMountPoint :
DatabaseVolumeMountPoint : E:\
DatabaseVolumeName : \\?\Volume{e6cb407f-e4f2-11e2-93eb-005056ae239d}\
DatabasePathIsOnMountedFolder : False
LogVolumeMountPoint : F:\
LogVolumeName : \\?\Volume{e6cb4087-e4f2-11e2-93eb-005056ae239d}\
LogPathIsOnMountedFolder : False
LastDatabaseVolumeName :
LastDatabaseVolumeNameTransitionTime :
VolumeInfoError :
IsValid : True
ObjectState : Unchanged
I am only interested in the 2 "ContentIndexState" - how can I pick these 2 out and put them into a variable?
I though the command "Get-MailboxDatabaseCopyStatus" would only display these two, since it is what happens if I run the command inside PowerShell on the server itself.

Similar Messages

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • How to get return values from stored procedure to ssis packge?

    Hi,
    I need returnn values from my stored procedure to ssis package -
    My procedure look like  and ssis package .Kindly help me to oget returnn value to my ssis package
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [TSC]
    -- Add the parameters for the stored procedure here
    @P_STAGE VARCHAR(2000)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    --SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
    truncate table [INPUTS];
    INSERT
    INTO
    [INPUTS_BASE]
    SELECT
    [COLUMN]
    FROM [INPUTS];
    RETURN
    END
    and i am trying to get the return value from execute sql task and shown below
    and i am taking my returnn value to result set variable

    You need to have either OUTPUT parameters or use RETURN statement to return a value in stored procedures. RETURN can only return integer values whereas OUTPUT parameters can be of any type
    First modify your procedure to define return value or OUTPUT parameter based on requirement
    for details see
    http://www.sqlteam.com/article/stored-procedures-returning-data
    Once that is done in SSIS call sp from Execute SQL Task and in parameter mapping tabe shown above add required parameters and map them to variables created in SSIS and select Direction as Output or Return Value based on what option you used in your
    procedure.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Getting Return values from RFC function call with visual basic

    Hi,
    I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
       SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
            Export parameters (to SAP):
                    - Student Name [char 10]         ==> "STUNAME"
                    - Student ID         [char 20]        ==> "STUID"
           Return values (From SAP):
                    - Results [char 10]        ==> "RESULT"
                    - Remarks [char 200]        ==> "REMARKS"
    i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
    Here's my vb code to accessing the function
            Dim R3 As Object
            Dim FBFunc As Object
            Dim returnFunc As Boolean
            Dim connected As Boolean
            R3 = CreateObject("SAP.Functions")
            R3.Connection.Client = "000"
            R3.Connection.User = "BCUSER"
            R3.Connection.Password = "minisap"
            R3.Connection.Language = "DE"
            R3.Connection.System = "dtsystem"
            R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx" 
            connected = R3.Connection.Logon(0, True)
            If connected <> True Then
                MsgBox("Unable to connect to SAP")
            End If
            FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
            FBFunc.exports("STUNAME") = "Jonny"
            FBFunc.exports("STUID") = "12345"
            returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
    thanks alot.
    Edited by: Eugene Tan on Mar 4, 2008 7:17 AM

    Hi Gregor,
    Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
    Below is the code snippet.
    Set impReturn = CHPASS_FN.Imports("RETURN")  <<=== is RETURN the standard keyword to get a                                                                                return object?
      expPassword.Value = currpass
      expNewPass.Value = newpass
      expFillRet.Value = "1"
    ''' Call change password function
      If CHPASS_FN.Call = True Then
        outFile.Write (", Called Function")
        Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return                                                               value variable names?
        outFile.WriteLine " : " & Message
      Else
        outFile.Write (", Call to function failed")
      End If
    thanks alot...all your help is very appreciated.

  • Subprocess 33 was not successful. Master cannot read return value from S 33

    Hi All,
    We are on BI 7.0 SP 19.
    We have submitted a planning sequence in the background with automatic packaging.
    The planning sequence has two steps:
    Step 1. Z_PLNG_FUNCTION1
    Step 2. Z_PLNG_FUNCTION2
    As per automatic packaging, the system chose 0ACCOUNT for packaging.
    When submitted, each step has been submitted to 30 packages as 30 subprocesses.
    For Step 1, the log shows that All subprocesses  executed.
    For Step 2, the log shows that the subprocess 33 and 58 failed, which means subprocess #3, and # 28 for the step 2 as the subprocess is numbered in the log in combination with step 1.
    The messages in the log for the failed subprocesses are as follows:
    @5C\QError@     Subprocess 33 was not successful
    @5C\QError@     Master cannot read return value from subprocess 33
    @5C\QError@     Subprocess 58 was not successful
    @5C\QError@     Master cannot read return value from subprocess 58
    Our question is on how to find the exact cause of the subprocess failure.
    I tried to look for the details on the error messages, they have been not helpful.
    What is meant by 'Master cannot read return value from subprocess' and how to get the exact cause of the failure?
    Thanks in advance,
    Best Regards,
    - Shashi

    Shashi,
    implement the following notes and check again:1368659, 1525723, 1532061.
    Regards,
    Marc
    SAP Techology RIG

  • How to Sort by the length of the returned value from a query.

    Hi,
    I was wondering if it is possible to sort by the length of the returned value from a query?
    For example if I want to get a list of people with the name 'Samuel', I would like to short by how short the length of the whole name is.
    Sort by length of the name in SQL
    Samuel Syda
    Samuel Indranaka
    Samuel Johnsons
    Samuel Longhenderson
    Thank you.

    Hi,
    Sorting is done by an ORDER BY clause at the end of the main query.
    In most cases, you can ORDER BY any expression, even f it is not in the SELECT clause.  In this case, it sounds like you just need:
    ORDER BY  LENGTH (name_column)
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Post your query, using an ORDER BY clause like the one above, and point out where that query is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • RE: (forte-users) Reading return value from Javaprogram

    when using the RunCommand method you can specify the an error file:
    task.part.os.RunCommand(command = l_tdCommandLine,
    isSynchronous = TRUE,
    inputFile = Nil,
    outputFile = Nil,
    errorFile = l_ErrorFile.GetLocalName(TRUE));
    BEGIN
    l_ErrorFile.Open(SP_AM_READ);
    EXCEPTION
    WHEN Ex: FileResourceException DO
    l_ErrorFile = NIL;
    task.ErrorMgr.Clear();
    END;
    IF l_ErrorFile <> NIL THEN
    l_tdFileContents : TextData = New();
    l_ErrorFile.ReadText(l_tdFileContents);
    l_ErrorFile.Close();
    END IF;
    Have you java program output the return value to the standard IO. This way
    you will have an error file that you can read from Forte.
    ka
    -----Original Message-----
    From: Anthony D [mailto:saigonxyahoo.com]
    Sent: Tuesday, September 12, 2000 7:49 AM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) Reading return value from Java program
    Hi,
    Does anyone know whether Forte application can
    read a return value from a Java program?
    I'm using the RunCmd method to invoke the Java
    program. I'd like to read the return value from the
    Java program. How do I go about doing it?
    Any suggestion will be appriciated.
    Thanks
    AD
    http://mail.yahoo.com/
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    when using the RunCommand method you can specify the an error file:
    task.part.os.RunCommand(command = l_tdCommandLine,
    isSynchronous = TRUE,
    inputFile = Nil,
    outputFile = Nil,
    errorFile = l_ErrorFile.GetLocalName(TRUE));
    BEGIN
    l_ErrorFile.Open(SP_AM_READ);
    EXCEPTION
    WHEN Ex: FileResourceException DO
    l_ErrorFile = NIL;
    task.ErrorMgr.Clear();
    END;
    IF l_ErrorFile <> NIL THEN
    l_tdFileContents : TextData = New();
    l_ErrorFile.ReadText(l_tdFileContents);
    l_ErrorFile.Close();
    END IF;
    Have you java program output the return value to the standard IO. This way
    you will have an error file that you can read from Forte.
    ka
    -----Original Message-----
    From: Anthony D [mailto:saigonxyahoo.com]
    Sent: Tuesday, September 12, 2000 7:49 AM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) Reading return value from Java program
    Hi,
    Does anyone know whether Forte application can
    read a return value from a Java program?
    I'm using the RunCmd method to invoke the Java
    program. I'd like to read the return value from the
    Java program. How do I go about doing it?
    Any suggestion will be appriciated.
    Thanks
    AD
    http://mail.yahoo.com/
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • Returning Values from Methods

    We ran across some code in one of our classes that calls a private method. That method returns an object, but the code calling that method does not capture it. What happens to the return value in a case like this? I would have thought that to be a syntax error.
    Example:
    myMethod(myObject, i);  // Call to myMethod without capturing its return value.
    private myObject myMethod(MyObject myObject, int i) {
       return myObject;
    }What happens to the return value from myMethod?

    (void) f(arg1, ..., argN); There's no
    provision in Java to allow you express that same
    intention.
    What?!?!?public void f(arg1, ...,
    argN);
    In the C code, function f was defined as having a non-void return type.
    The statement
    (void) f(arg1, ..., argN);shows the caller is knowing ignoring that returned value.

  • Capture Return Value from Contextual Events Subscriber Method

    Hi
    I was wondering if anyone knew whether you could capture the return value from a method exposed as  a subscriber for a contextual event?
    Requirement: We have 2 bounded task flows (parent-child) with the child task flow embedded as a region in a view activity in the parent task flow.  Based on an action in the parent task flow we raise a contextual event which calls an application module method exposed as a data control within the child task flow.  We need to be able to capture the return value from the method on the managed bean.
    Example method within child task flow application module:
    public String contextualEventSub(){
      Return "Y";
    So here we would like to capture String value when the event is raised by the event producer (parent task flow action).
    Within the Event Map on the page definition of the parent task flow view activity it is possible to set parameters to pass to the subscriber but it’s not obvious where you can capture the return value.
    Many thanks!
    Technology:
    ADF 11.1.1.7 – ADFbc with ADF task flows and page fragments

    Check this URL it may help you
    One size doesn't fit all: JDev 11g: Programmatic Contextual Events

  • Get a return value from a stored procedure.

    hi all ,
    i need to know where i am going wrong with the below code. I am trying to get a value from a stored procedure. the return type is int. The stored procedure works fine as i've debugged it. The variable have been declared correctly.
    int n = 0;
    proc = conn.prepareCall("{ ? = call SP_GETITEMCURRENTSOH(?,?) }");
                proc.registerOutParameter(1, java.sql.Types.INTEGER);
                proc.setString(1, locationCode);
                proc.setString(2, itemCode);
                proc.execute();           
                n = proc.getInt(1);thanks

    Hi ayub_a,
    According the [ *setString*|http://java.sun.com/javase/6/docs/api/java/sql/CallableStatement.html#setString(java.lang.String,%20java.lang.String)] method of the [*CallableStatement*|http://java.sun.com/javase/6/docs/api/java/sql/CallableStatement.html] interface, the first parameter must be a parameter name and not an ordinal position index !!!
    Edit : I've just found out the solution, it must be :
    int n = 0;
    proc = conn.prepareCall("{ ? = call SP_GETITEMCURRENTSOH(?,?) }");
                 proc.registerOutParameter(1, java.sql.Types.INTEGER);
                 proc.setString(2, locationCode);
                 proc.setString(3, itemCode);
                 proc.execute();           
                 n = proc.getInt(1);Edited by: Chicon on Jul 5, 2009 7:48 PM

  • Error getting return value from function

    Hello
    I'm getting a error calling a function with ODP.NET from C#
    Code:
    OracleCommand oraCom = new OracleCommand("NORMALIZACION.nif",oraCon);
    oraCom.CommandType = CommandType.StoredProcedure;
    OracleParameter param1 = new OracleParameter("numnif",OracleDbType.Varchar2);
    param1.Value= "73667866A";
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter("nif",OracleDbType.Varchar2);
    param2.Size = 10; //FIXME line
    param2.Direction = ParameterDirection.ReturnValue;
    oraCom.Parameters.Add(param1);
    oraCom.Parameters.Add(param2);
    oraCom.ExecuteNonQuery();
    nif_norm = oraCom.Parameters["nif"].Value.ToString();
    if i write the FIXME line i get a error (ORA-06502) complaining about the size, no matter the value i wrote.
    If i don't write the FIXME line, it works but nif_norm is always empty, although the function i call is a single return 'Hello';
    Where am I wrong??
    Any help, examples with varchar2 as return value???
    BTW: the same code with the MS provider for Oracle works fine.

    Good point -- i shall do so.
    What I think I'm missing, in my quest for ODP.NET competence, is a solid set of example code. I've searched around and found various fragements here and there, but when it comes to data access from .NET there must surely be some finitie set of possibilities (if we can discount bad practices like building dynamic SQL statements without bind variables).
    For example, possibly in increasing order of complexity ...
    * Read a single value from a SQL statement ... "select emp_name from emp where rownum < 2"
    * Read a single value by passing in a parameter ... "select emp_name from emp where user_id = :?"
    * read multiple values ... "select emp_name from emp where user_id in (:?,:?)"
    * execute a stored procedure with no in or out parameters
    * retreive a value from a function with no parameters
    * pass a parameter to a stored procedure
    * read an out parameter from a stored procedure
    Then work with in and out ref cursors, blobs, whatever.
    Thoughts?

  • How to get the returned value from Functions with Callable statement?

    I was glad to find that stored procedures can be invoke with Java class code by the object of Callable statement like :
    String stmt = "BEGIN departments_pkg.do_select(?,?,?); END;";
    and getting the output variables by
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    But i would like to get values returned from FUNCTION other than stored procedure, how can i achieve it? Thanks a lot!

    Here is  my code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1202.
      MODULE subscreen_find.
      CALL SUBSCREEN SUBSEARCH INCLUDING sy-cprog dynnr.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_1202.
      CALL SUBSCREEN SUBSEARCH.
    MODULE subscreen_find.
      case sy-ucomm.
        when 'SELECTED'.             "fcode
          case 'ZSKILL_SEARCH'.     "data element
            when '01'.                       " value range
              dynnr = 0110.
            when '02'.
              dynnr = 0111.
          endcase.
      endcase.
    ENDMODULE.
    kindly tell me what is wrong
    Edited by: Raji Thomas on Feb 8, 2010 10:20 AM

Maybe you are looking for

  • Photo orientation (portrait/landscape) differs between PC and Apple TV

    Hi, I have several pictures that have the correct portrait orientation when I watch them on the PC (with applications: PhotoShop, PaintShop, IrfanView, ...), however they are displayed in landscape on Apple.TV, resulting in a 90 degrees rotated pictu

  • Problem in collecting objects for BI Contents installation

    Hi All , While collecting objects in BI content i am getting some error. Every time in stus bar the status shows "Destination Check with client ". After this status comes the session logs out automatically and a Error massage come i.e. "PBI error : S

  • New to UIX : Need help in data binding

    I am new to UIX. I am using jDeveloper 9.0.5.2 (ADF UIX version is 2.2.8). I need to create a simple table with one column with checkbox, one column with input field and 2 columns from database query. How should I go about it ? I went through some tu

  • Periods in budget keyfigure

    Hello All, I try to find a way to prevent getting negative budget  in a PERIOD, using consistency check, but I could'nt find a way to define a keyfigure that refer to a period . Please advise . Best regards, Y. Golan

  • Method binding

    hi, i was trying to dynamically build a number of link buttons and associate them all using method binding to an action and this action is supposed to take as argument an ActionEvent object to detect what component triggered the action but when i run