Get the output parameter of workflow using soap in PHP

Hi all, I have a question on how to print the output in php parameter using the soap Protocol. I create the workflow with 1 single task scriptable with variable name of virtual machines as output like that.

var sdkConnections = VcPlugin.allSdkConnections;
vms = new Array();
for (var i in sdkConnections) {
  var host = sdkConnections[i];
  var found;
  if (host.isInventoryServiceAvailable()) {
  found = host.getAllVirtualMachines();
  }
  for (var j in found) {
  vms.push(found[j]);
  System.log(vms);
  }
}

And my php, source code

<?php

include ("parameters.inc");
$vco = new SoapClient('https://' . $vco_server . ':8281/vmware-vmo-webcontrol/webservice?WSDL');
$workflowid = "f73f2521-0e6b-48e8-81b9-388b13fc3fea";
$param = array(workflowId=>$workflowid,username=>$vco_user,password=>$vco_pass);
echo '<br>';

$result3 = $vco->executeWorkflow($param);
print_r($result3);
echo '<br>';

foreach ($result3 as $token)
{
        $tokenID = $token->id;
}

$param2 = array(workflowTokenId=>$tokenID,username=>$vco_user,password=>$vco_pass);
$wftokenstatus = $vco->getWorkflowTokenStatus($param2);
print_r($wftokenstatus);
echo '<br>';

$wftokenresult = $vco->getWorkflowTokenResult($param2);
print_r($wftokenresult);
echo '<br>';
?>

When I try the same, executed release in web

stdClass Object ( [executeWorkflowReturn] => stdClass Object ( [id] => ff808081440b6eb90144316de4bc04fe [title] => Copy of Get virtual machines by name [workflowId] => f73f2521-0e6b-48e8-81b9-388b13fc3fea [currentItemName] => __item-undefined__ [currentItemState] => running [globalState] => running [businessState] => [startDate] => 20140215002449+0700 [endDate] => [xmlContent] =>         ) )
stdClass Object ( [getWorkflowTokenStatusReturn] => )
stdClass Object ( [getWorkflowTokenResultReturn] => stdClass Object ( [name] => vms [type] => VC:VirtualMachine [value] => ) )

I see in customer orchestrator, my workflow work well and in the logs tab I see all my VM appear, but I'm trying to print all components of table in my php script using print_r(), the value of the object always null, only can get name and type as above... No idea how to get the value of the output parameter?... Thanks before

Change this code to your:

for (var j in found) {
  vms.push(found[j]);
  System.log(vms);
  }

To do this:

for (var j in found) {
  vms.push(found[j].name);
  System.log(vms);
  }

In this code, j is a VC:VirtualMachine object, instead of pushing the entire object in your table, just push the virtual machine to .name property. Additionally, make sure that your output variable is of type: Array of Strings

Tags: VMware

Similar Questions

  • Impossible to activate and deactivate the button "submit" all keeping the condition on the output parameter

    Hello

    I try to enable and disable the submit button based on the status of output parameter that I call in lov.

    Concerning

    Asia.


    Hi AJ,.

    Thanks for the reply

    I tried the method above, but it does not work.

    I am trying to enable and disable the submit button based on two input parameters and an output parameter.

    Based on two input parameters, I'm able to get the output parameter, and if the output parameter is "S" then iam allowing the submit button.

    on the other

    disable the submit button.

    Here is my code:

    IAM calling this co

    OASubmitButtonBean submitbean = (OASubmitButtonBean) webBean.findChildRecursive ("Submit");

    String crreason = pageContext.getParameter ("Reason")';

    Invnum string = pageContext.getParameter ("InvoiceNumber");

    String status = "";

    String ValidationDesc ="";

    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl) getTransaction ();

    Try

    {

    String sql_qry = "BEGIN WEPIS_CM_DM_PKG. WEPIS_CM_RAISE_VALIDATION (P_CM_REASON =>: 1, P_INVOICE =>: 2, P_VALDIDATION_S "+)

    "(TS =>: 3, P_VALDIDATION_DESC =>: 4); END; « ;

    OracleCallableStatement sqlstmt = (OracleCallableStatement) oadbtransactionimpl.createCallableStatement (sql_qry,-1);

    sqlstmt.setString(1,crreason);

    sqlstmt.setString(2,invnum);

    sqlstmt.registerOutParameter(3,Types.CHAR);

    sqlstmt.registerOutParameter(4,Types.VARCHAR);

    sqlstmt. Execute();

    status = sqlstmt.getString (3);

    ValidationDesc = sqlstmt.getString (4);

    If ("S".equals (status))

    {

    submitbean.setRendered (true);

    }

    on the other

    {

    submitbean.setRendered (false);

    }

    }

    catch (SQLException sqlexception)

    {

    throw OAException.wrapperException (sqlexception);

    }

    catch (System.Exception Exception)

    {

    throw OAException.wrapperException (exception);

    }

    Concerning

    S.Asia

  • When I try to install Firefox, I get an error "could not open the output file. I used Firefox before and it doesn't work anymore, so I uninstalled. Cannot re - install now.

    When I try to install Firefox, I get an error "could not open the output file. I used Firefox before and it doesn't work anymore, so I uninstalled. Cannot re - install now.

    This has happened

    Each time Firefox opened

    I tried to download firefox.

    User Agent

    Mozilla/4.0 (compatible; INTERNET EXPLORER 6.0; Windows NT 5.1; SV1; AntivirXP08; GTB6.3; .NET CLR 2.0.50727; MS - RTC LM 8)

    When you click on the download link on GetFirefox.com, you should be asked if you want to run or save the file. If this situation occurs when you try to run the download, try instead to record and put the file on your desktop or in a similar place, where you are certain that you can find.

    When the download is complete, try double-clicking on the downloaded file in the normal Windows Explorer (browse your way to the file from the desktop). This should start the installation.

    If, in the Explorer window, you notice that the file seems to be missing the Firefox icon orange/blue, right click the file and select Properties. The image should look like the attached picture (except that mine is in Danish, but that is irrelevant) if saved correctly - if it don't look like this, would you please describe the content or attach a screenshot of the box. Especially what it says under "File Type" - it must be 'program '. If this isn't the case, will have to focus on what could be the problem here.

    A bit off-topic, your Internet Explorer seems to be quite a bit outdated (IE 6, where the current version is IE 8), so I highly recommend that you try to run Windows Update to get your system up to date. Is it as a society (such as a thin client Terminal Server computer) system, this is not possible, and most likely, your system administrator will have to help you.

  • Switch the output of a workflow parameter to another workflow as input parameter?

    Hi all

    I have created a list of resources and want to add a virtual machine in this resource pool. There are two workflow, 1. Pool of resources & 2 creation. Cloning a VM. I'm creating a different workflow and by adding this two workflow. I don't know how to pass the value of the output parameter of the first stream of work performed as input to another workflow running. Can anyone help? Can anyone attach the workflow example?

    Thanks in advance.

    Hello

    You must create workflow attributes (in the "General tab" of your workflow) and link out of the first workflow settings that you call to them. You can then link the same attributes as parameters to the second.

    Watch this video (and all others in the www.vmwarelearning.com/orchestratorseries) for an explanation: http://vmwarelearning.com/2nB/understanding-variables-and-variable-binding-overview/

    See you soon,.

    Joerg

  • the output parameter mapping

    How can pass us values as output parameters that never I assign it says that it is limited and cannot be done.

    What values we can pass as output parameters. for a mapping of the output parameters.

    Thanks in advance.

    Hello

    You can use the function that you created in the process flow and set its result in a variable (or bind the output parameter of mapping a process flow variable), the variable can then be tested in conditions of transition, conditions, etc. in loop.

    See you soon
    David

  • How to get the output of a compiled solution?

    I'm writing an automation, but I'm unable to get the output of devenv, but receive nothing.  I have reduced my example considerably.

    I have a lot of files that looks like this

    "B:\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "My_Types\My_Types.sln" /build >... \Output\Build.txt

    And it produces Build.txt

    Microsoft (R) Visual Studio Version 9.0.21022.8.
    Copyright (C) Microsoft Corp. All rights reserved.
    -Build started: project: Rotair_Types, Configuration: Debug Any CPU.
    Rotair_Types-> C:\IntuitiveDev\Bin\Rotair_Types.dll
    = Build: 1 succeeded or up-to-date, 0 failed, 0 was ignored.

    So now, I try to do it from code:

    Compile = new Process()
    With Compile.StartInfo
    . UseShellExecute = False
    . RedirectStandardOutput = True
    . FileName = "b:\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
    . Arguments = "/build" «C:\Code\Projects\My_Types\My_Types.sln»»»
    Ends with
    bSuccess = Compile.Start)
    strOutput = Compile.StandardOutput.ReadToEnd)
    Compile.WaitForExit)

    But strOutput is an empty string.  This is confirmed by the issuance of the following at the command prompt:

    /build "C:\Code\Projects\My_Types\My_Types.sln" "b:\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"

    But it does not compile because I can remove the dll, and it returns.  I would get the result to determine if the compilation is successful.  Any suggestions?

    JM

    Hello

    Your question is addressed in these forums of consumers.

    The MSDN Developer forums should be able to answer your question.

    Issues related to the overall development of the Windows Desktop:

    https://social.msdn.Microsoft.com/forums/en-us/home?category=windowsdesktopdev

    Concerning

  • Where can I get the software or driver to use my xbox live vision webcam?

    Original title: xbox live webcam

    where can I get the software or driver to use my xbox live vision webcam on my laptop

    Hello

    What is the exact version of Xbox Live vision webcam?

    If you use a Xbox 360 Live Vision Webcam, then after connecting the webcam to the laptop, you can try to run the Windows updates and look for the optional updates for the installation of the drivers/software for the webcam.

    For more information, see the article:

    Automatically get recommended drivers and updates for your hardware

    You can also get in contact with the Xbox support for help.

    For more information, see the article:

    Set up and use the Xbox LIVE Vision camera

    Hope the helps of information.

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • How to get the frame number current timeline using jsx?

    How to get the frame number current timeline using jsx?

    Thanks for the link!

    Clarification: I was looking for the current image on the timeline of the video. OP he mentions that he had found how to get that so I searched a bit more and found this thread: Re: can I inpoint in read/write and out-point of the clips in a group of video with scripts? They have the following functions, I have not tried yet, but it seems like it should work.

    function getCurrentFrame() {}

    try {}

    Var ref = new ActionReference();

    ref.putProperty (charIDToTypeID ('Rprp'), stringIDToTypeID ('currentFrame'));

    ref.putClass (stringIDToTypeID ('timeline'));

    var / / desc = new ActionDescriptor();

    desc.putReference (charIDToTypeID ('null'), ref);

    var TC = executeAction (charIDToTypeID ('getd'), desc, DialogModes.NO);

    Return TC.getInteger (stringIDToTypeID ('currentFrame'));

    } catch (e) {return null ;}

    };

  • Is it possible to get the appid, pageid and sessionid using javascript?

    Hello world

    I need to get the appid, pageid, and sessionid using javascript, is it possible to do this?

    Hello

    If your JavaScript is in file:

    $v ("pFlowId") = application id

    $v ("pFlowStepId") = the page id

    $v ("pInstance") = session id

    Kind regards

    Jari

  • I bought Photoshop elements &amp; elements of Prime Minister to Best Buy 2 years.  Finally opened and I tried to get the serial number online by using the identity card, but said website code is not valid.  They called Best Buy, said that adobe should hav

    I bought Photoshop elements & elements of Prime Minister to Best Buy 2 years.  Finally opened and I tried to get the serial number online by using the identity card, but said website code is not valid.  Called Best Buy, they said that adobe should have canceled activation because it has not been installed in a timely.  How can I get a serial number for installation?

    jotison64 wrote:

    I bought Photoshop elements & first items at Best Buy 2 years.  Finally opened and I tried to get the serial number online by using the identity card, but said website code is not valid.  Called Best Buy, they said that adobe should have canceled activation because it has not been installed in a timely.  How can I get a serial number for installation?

    Work your way through this document in the end, step by step, and finally try to start a chat session. I hope that Adobe will straighten this out for you.

    Contact the customer service

  • I just bought a year of CC version... When I login my account, the payment is visible, I downloaded photoshop and I wasn't able to get the work permit im always using an aplication free period. It is said that no payment or upated is the registry under t

    I just bought a year of CC version... When I login my account, the payment is visible, I downloaded photoshop and I wasn't able to get the work permit im still using a free period aplications. It is said that no payment or upated is the registry under this ID

    Hello

    Please check the help below document:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Kind regards

    Sheena

  • Is the version of the output parameter 32 bits 12.1.0.2 Oracle ODBC driver truncating values a known issue?

    We test 12.1.0.2 Oracle and ODBC see problems with the stored procedure being cut output parameter values and Associates when we use the 12.1.0.2 driver (we use the 32-bit version). We see a function sequence error every time that happens, too.

    For example, a stored procedure takes a NVARCHAR2 name and it out as a separate NVARCHAR2 output parameter. Using the 12.1.0.2 of the ODBC driver, if we "Basketball", the output can be "Basketball" (with a function sequence error).

    What is happening to many of our stored procedures. We do not get the errors of sequence of function or output truncated if parameters we use the 12.1.0.1 version of the ODBC driver to connect to our 12.1.0.2 database, or if we use the version 11.2.0.4 or 11.2.0.2 ODBC driver.

    Is this a known problem in the 12.1.0.2 ODBC driver?

    Thank you

    Daniel Meyer

    to submit a bug report to MOS

  • Displaying the output in a workflow in a provisioned VM

    I try to determine a way to show return the content of a variable of an entity of the VM once the machine is built, preferably in the tab 'Machine' of the details of the article. I don't seem to be able to find a way to do it (I tried to update the value of "__Notes", but appears not to pass to the Portal). Basically, we generate a temporary password for the end user, and we want to show in the portal, rather than by e-mail.

    Can someone tell me if there is a way to display data in the portal once commissioning is complete, outside the person a Manager and viewing the properties directly? If not, is it possible to display data by using a custom action of resource?

    Thanks for all the ideas.

    Thus, the easiest way (I think) would update the description field of the virtual machine. Who is be a property of the entity of the virtual machine within the IaaS API, so that you'd run the workflow of update a vCAC model entity under library-vCloud Automation Center-> Infrastructure Management >. This workflow must have two specific entries:

    (1) the entity: that can be gained when the heel is launched as an entry in the heel

    (2) the input properties to update... This one gets a little more fun. You can do this with a very simple action / scriptable job. The task / action will have an entry (for this example) passwordattribute, which is the temporary password configured and an output for an attribute properties in the workflow called (for this example) vCACModelProperties. The code block, you would use would look like this:

    var p = new Properties ();
    if (password) { p.put("Notes","The password for your virtual machine is: ".concat(password)); }
    vCACModelProperties = p;
    

    After this scriptable task / action outputs Properties, you should be able to feed in the workflow of update, and the value appears in the item once it is filled with the completion of the workflow state.

  • Capture the output of a workflow in a different workflow

    I'm calling a WF1 workflow from another workflow WF2. I am able to do and WF1 is running perfectly in the background and the desired output via a return number. Newspapers of WF1 to verify that.

    But I want to capture the output (table/integer) to WF1 by WF2. I can't pass the exit (snapshots) WF2.

    I enclose the code and the journal of WF2. I enclose the code and WF1 journal as well.

    Well, well, you seem to met a strange problem... It was me frustrating because your code resembles a re-work of my code here:

    How to retrieve the details of Workflow

    ... If I run MY library workflow that checks the chips of workflow, the output, but all the variations, I tried to get out of the current token element has ended in the same result as what you had: null.

    So, as executions of audit workflow worked rather than the active token, wait until the workflow has completed, and then loop through the workflow runs until you find the one with the matching id of the token you just ran... once that you find, parse the output.

    Given two workflows you set in the last post, replace your task Scriptable text in the 'test' WF follows him with and run it (feel free to delete the code useless, I left all my code test in place in there something of another case may be useful):

    var inputParameters = new Properties();
    inputParameters.put("name", name);
    System.log("name '" +name);
    System.log("hostResource '" +hostResource);
    var curToken = wf.execute(inputParameters); //,"root","vmware");
    while (curToken.state == "running"){
        System.log(".. still running ..");
        System.sleep(1000);
    }
    var tokens = wf.executions;
    // Each execution is a "workflowToken" object
    for each (token in tokens){
        if (token.id == curToken.id && token.isStillValid){
            System.log("");
            System.log("=============== Checking token ===============");
            System.log("Token ID: "+token.id);
            System.log("Start Date: "+token.startDate);
            if(token.endDate != null){
                System.log("End Date: "+token.endDate);
            }
            System.log("Business State: "+token.businessState); // Indicates the business state as defined by the workflow dev in each of the elements of the workflow (not always specified)
            System.log("State: "+token.state); // Indicates the system state of this workflow
            /* State values are likely to be one of the following:
            waiting <- waiting for user input
            failed <- an exception was thrown to cause the workflow to fail
            completed <- workflow competed running successfully
            canceled <- user right-clicked and canceled the workflow
            running <- workflow is still processing
            */
            System.log("");
            System.log("==== Token Inputs ====");
            var inputParams = token.getInputParameters();
            if (inputParams != null){
                for each (key in inputParams.keys){
                    var value = inputParams.get(key);
                    System.log(key + ": " + value + " ("+System.getObjectType(value)+")");
                }
            }
            System.log("");
            System.log("==== Token Attributes ====");
            var attributes = token.getAttributes();
            if(attributes != null){
                for each (key in attributes.keys){
                    var value = attributes.get(key);
                    System.log(key + ": " + value + " ("+System.getObjectType(value)+")");
                }
            }
    
            System.log("");
            System.log("==== Token Outputs ====");
            var outputParams = token.getOutputParameters();
            if (outputParams != null){
                for each (key in outputParams.keys){
                    var value = outputParams.get(key);
                    System.log(key + ": " + value + " ("+System.getObjectType(value)+")");
                }
            }
    
            System.log("");
            System.log("==== Token Log Events ====");
            var logEvents = new Array();
            logEvents = token.logEvents;
            var eventCount = logEvents.length;
            System.log("Event Count: "+eventCount);
            for (i=eventCount-1; i>-1; i--){
                var logEvent = logEvents[i];
                System.log("");
                System.log(" == EVENT ENTRY "+(eventCount - i)+" == ");
                System.log("logTimeStamp: "+logEvent.logTimeStamp);
                System.log("longDescription: "+logEvent.longDescription);
                System.log("originatorId: "+logEvent.originatorId);
                System.log("originatorUri: "+logEvent.originarorUri);
                System.log("originatorUserName: "+logEvent.originatorUserName);
                System.log("severity: "+logEvent.severity);
                System.log("shortDescription: "+logEvent.shortDescription);
            }
        }
    }
    

    And to get an idea of the output, my tab newspapers looked like this:

    [2014-08-01 16:29:25.632] [I] name 'demo
    [2014-08-01 16:29:25.632] [I] hostResource 'null
    [2014-08-01 16:29:26.351] [I] .. still running ..
    [2014-08-01 16:29:27.365] [I]
    [2014-08-01 16:29:27.365] [I] =============== Checking token ===============
    [2014-08-01 16:29:27.365] [I] Token ID: ff80808146af57140147934349c10567
    [2014-08-01 16:29:27.365] [I] Start Date: 2014-08-01 16:29:26
    [2014-08-01 16:29:27.365] [I] End Date: 2014-08-01 16:29:26
    [2014-08-01 16:29:27.365] [I] Business State: null
    [2014-08-01 16:29:27.367] [I] State: completed
    [2014-08-01 16:29:27.367] [I]
    [2014-08-01 16:29:27.367] [I] ==== Token Inputs ====
    [2014-08-01 16:29:27.371] [I] name: demo (string)
    [2014-08-01 16:29:27.371] [I]
    [2014-08-01 16:29:27.371] [I] ==== Token Attributes ====
    [2014-08-01 16:29:27.374] [I] restOperation: null (null)
    [2014-08-01 16:29:27.374] [I] statusCodeAttribute: null (null)
    [2014-08-01 16:29:27.374] [I] snapshotids: null (null)
    [2014-08-01 16:29:27.374] [I] RESTHost: null (null)
    [2014-08-01 16:29:27.375] [I] hostResource: null (null)
    [2014-08-01 16:29:27.375] [I] errorCode:  (string)
    [2014-08-01 16:29:27.375] [I]
    [2014-08-01 16:29:27.375] [I] ==== Token Outputs ====
    [2014-08-01 16:29:27.378] [I] snapshots: 1966,2262,2555,2927,3272,3586,3895,3903,3909,3987,4041,4430,4734,5048 (Array)
    [2014-08-01 16:29:27.378] [I]
    [2014-08-01 16:29:27.378] [I] ==== Token Log Events ====
    [2014-08-01 16:29:27.423] [I] Event Count: 2
    [2014-08-01 16:29:27.423] [I]
    [2014-08-01 16:29:27.423] [I]  == EVENT ENTRY 1 ==
    [2014-08-01 16:29:27.423] [I] logTimeStamp: 2014-08-01 16:29:26.364
    [2014-08-01 16:29:27.423] [I] longDescription: Workflow has started
    [2014-08-01 16:29:27.423] [I] originatorId: a4e950d3-c575-4ddd-8b7f-dd838cdf7b2e
    [2014-08-01 16:29:27.423] [I] originatorUri: undefined
    [2014-08-01 16:29:27.423] [I] originatorUserName: bazbill
    [2014-08-01 16:29:27.424] [I] severity: 0
    [2014-08-01 16:29:27.424] [I] shortDescription: Workflow has started
    [2014-08-01 16:29:27.424] [I]
    [2014-08-01 16:29:27.424] [I]  == EVENT ENTRY 2 ==
    [2014-08-01 16:29:27.424] [I] logTimeStamp: 2014-08-01 16:29:26.401
    [2014-08-01 16:29:27.424] [I] longDescription: Workflow is completed
    [2014-08-01 16:29:27.424] [I] originatorId: a4e950d3-c575-4ddd-8b7f-dd838cdf7b2e
    [2014-08-01 16:29:27.424] [I] originatorUri: undefined
    [2014-08-01 16:29:27.425] [I] originatorUserName: bazbill
    [2014-08-01 16:29:27.425] [I] severity: 0
    [2014-08-01 16:29:27.425] [I] shortDescription: Workflow is completed
    
  • How to get the return parameter in sequence teststand ran by labview labview

    Hello

    Executes a test sequence of labview (essentially running "\Examples\TestStand API\Executing sequences using API\LabVIEW\Execute with no Model.vi process") I need to get a parameter returned in 'Settings', after the sequence has run.

    My problem is that I get the value upon registration of the sequence and not the value after execution.

    How?

    Vagn

    Vagn,

    in order to obtain the values of the execution, you need access to execution. The following screenshot shows how to access.

    Please note that this VI is lying will be called by TestStand. DO NOT USE THIS VI IN A CUSTOM USER INTERFACE!

    Thank you

    Norbert

    EDIT: This dummy code shows how to read the string parameter 'Return '. Each parameter must be read separately with appropriate playback function.

Maybe you are looking for

  • Clarification of the Etrecheck

    Hi all, I have seen a couple of these posts and tried to make sense of them, but I am at a loss. My iMac (end 2013) was unbearably slow (safari, finder, photos, whatever- allbeach balls) for the better part of a year now. In fact, we have abandoned f

  • Question about the Bios Tecra 8100 2.5

    HelloI installed the latest version of the Bios on my tecra 8100. My Question is, what is the maximum size of hard drive for these phones? Now I have 13 GB hard drive, but I want to have a bigger. And 512 MB of Ram is the maximum, right (2x256mb)? Ca

  • Cannot start exe in the execution engine

    Hello, I know that there is a thread on this problem, but it did not help me, so I start a new thread. Link Here is my problem: The message from the MessageBox is: in German: "Das ist nicht ausfuhrbar VI. Zur Behebung der Fehler ist das LabView Full

  • Vista - Error Code: 80240016 (cannot install the update for my mouse)

    error code 80240016: updated of the mouse, I can't seem to install correctly under windows vista, HP dv9727cl laptop.Help please. Thank you. Synaptics PS/2 PORTtouchpad

  • BSOD when you try to use a graphics tablet

    Hey everybody.I recently bought an Amzdeal® 8.0 "x6.0" Ugee-M860 USB graphic tablet pen so I can start to learn how to do the graphic design on the computer. " The instillation of the pilot program went smoothly and without any problems. I plugged in