Invoke the "return of workflow" to a Java method

Hi, I have the following problem:

I have a link that calls a taskFlow call. This workflow has a Java method as a default activity. In this Java method, I make little validation and if the validation fails, I want to return to the original page.

Can I do this if I use:

ExternalContext ectx is FacesContext.getCurrentInstance () .getExternalContext ();.

HttpServletResponse response = (HttpServletResponse) ectx.getResponse ();

String url = ectx.getRequestContextPath () + "page." 

response.sendRedirect (url);

But this way, I lose the context and I can't show a message in the FacesContext like this:

FacesContext context = FacesContext.getCurrentInstance ();

FacesMessage msg is new FacesMessage (FacesMessage.SEVERITY_FATAL, "Information", "message");.

context.addMessage (null, msg);

I want to know if I can call it the 'task flow back' this method of java (or any other form of redirecting to the page) so that I can keep the context and display the message correctly.

I use JDeveloper 11.1.2.3.0.

I appreciate if anyone can help. Thank you.

You can add a default activity navigation case to the stream return axtivity task. Then, you set the action of the method to the results chain and return the name of navigation to the workflow of return if your validation fails, otherwise, you return the case of normal navigation.

Timo

Tags: Java

Similar Questions

  • Re-start a workflow in the return of the child TF

    Hello

    I use Jdev 12.1.2.0.0

    I have a workflow that calls another workflow. In the child workflow, I have a return activity that returns control to the movement of parent task.

    I need to restart the workflow as soon as default with the return of the child, the parent TF. The workflow share the data controls.

    Could you help me to achieve this?

    Thank you

    Mozakkir

    The activity return returns a string which ID flow of the target of the navigation in the parent task. If you return for example the string "start_again" in the child workflow, you can add a rule of wild-card navigation to the parent and add a navigation of this wild card the default activity rule and the name "start_again". When your child task flow end the return of workflow is executed and "start_again" is passed as the next navigation to the parent workflow. The Joker takes this navigation and the default activity is executed.

    Timo

  • get the return value of a method of the application module in the workflow

    Hello

    I use jdeveloper 11.1.1.7.0

    I defined a method (return type is useful java card) in the Module of the Application and add this method to the client interface.

    also I have a workflow and in this TF firstly I should execute this method and put the return value for the pageFlowScope parameter. I know that to use this method as a methodCall and set it as an activity by default, but I don't know how to get the return value before entering the jsff page and set the pageFlowScope parameter.

    Habib

    Concerning

    When you add the activity to the way to deal, there are 'Return value' property that you can set to #{pageFlowScope.yourVariable}

    Dario

  • How to get the return value of the activity of the method in the stubborn workflow

    Hi all

    I use Jdeveloper 11 g R2 (11.1.2.3) & Weblogic 10.3.5.0

    I have a stubborn workflow, default activity is a call method than calling a method in the app module
    This method returns an id

    I need this code in my project to do something else
    Is there a way I can access the return value of the method call activity?

    Concerning
    Mohsen

    Set the value of return as #{{pageFlowScope.myBean.returnValue} pageFlowScope.myBean.returnValue} in the method, call the property inspector and get the value in your managed bean.

    String returnParam = (String) JSFUtil.getFromPageFlow ("returnValue");

  • Boolean Boolean value in the returned java action script implementation

    Hi all

    I have a called checkLogin() actionscript function that calls a remote java method called login()). Login supports two channels, user name and password and returns true if the combination is found in the database, and false if not.

    CheckLogin function either displays an alert if the connection function returns true or it'll run an animation sequence if it is false.

    The problem is that, although my java connection method returns true I can't define her revealing Boolean in the true action script. The Boolean remains "authenticated" as false. I know because I used a breakpoint after that that he has created and used the debugger to check the value of the variable.

    I know that my remote object is configured correctly because using network monitor I see the answer as true.

    It is the button that triggers the function:

    < s:Button = "8" x = "83" label = "Login" click = "checkLogin ()" / >

    Here is my function checkLogin() actionscript:

    private function checkLogin (): void {}
    authenticated = mainentry.login (username.text, password.text) as Boolean;
    {if (Authenticated)}
    Alert.Show ("connected!");
    } else {}
    Shake.Play ();
    }
    }

    Here is my statement of the remote object:

    < mx:RemoteObject id = "Mainentrance' destination = 'hand '.

    source = 'infrastructure. Hand '.

    / >

    Here's my exit Network Monitor: (Please note the right login and password for this application example is "admin" "admin"

    Request:

    Flex Message (flex.messaging.messages.RemotingMessage) operation = connection clientId = null destination = hand messageId = B1FF60B2-40E8-2580-209D-13CF5BCB9547 timestamp = timeToLive = 0 body 0 = [ admin, admin ] hdr (Iddm) = 2B5D49D7-A10B-DEA0-4A20-1D57FB576314 hdr (DSEndpoint) = my - amf

    Answer:

    Flex Message (flex.messaging.messages.AcknowledgeMessageExt) clientId = 2B5D53DD-8C0E-F45F-B5B1-19CF70CA88F6 correlationId = B1FF60B2-40E8-2580-209D-13CF5BCB9547 destination = null messageId = 2B5D53E2-6E0F-74FC-F37C-2170EAB2DEAD = 1284527580238 = 0 = true body timeToLive timestamp

    Any help would be greatly appreciated.

    -Felix

    Remote service calls are asynchronous in flex. You need listen to the EEG of result the result to the server event.

    private void mainentry_resultHandler(event:ResultEvent):void
    {
    authenticated = event.result;
    }

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

    I am running shell from a (GR 11, 2) Oracle database commands on aix.
    But, I would get a return value of a shell comand... as 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 the return value...

    Published by: user9158455 on 22-Sep-2010 07:33

    Hello

    Your pr.exitValue () has tried?

    I think you also need a finally block that destroys the sub-process

    Concerning
    Peter

  • invoking the finalizer

    Hello

    I use the shell of the user DynamicTab interface and I put in place the concept of finalizer in all workflows. whenever I try to get out of the task through the finalizer of return activity is getting called it is fine for me. In case of tab close finalizer is getting invoked also that I demanded.

    I don't get any exception also when the tab is closed.

    under the lines from Guide of Oracle® Fusion Middleware Fusion Developer for Oracle

    A finalizer is custom code that is called when you exit a workflow ADF bounded by a return workflow activity or because an exception occurred. The finalizer is a method on a managed bean. Finalizer common tasks include releasing all resources acquired by the ADF defined workflow and cleaning performance before leaving the workflow.



    Reg,
    Brahma B.

    BRM,

    It is logical to me that if the finalizer is designed to clean and release resources when you exit a workflow that it should occur if the user leaves a workflow by closing the tab. If anything, I would say to refresh the docs to indicate this as well business.

    John

  • Invoking the application of a midlet blackberry email client.

    Hi guys, I am trying to invoke the blackberry native E-mail application, trying to do until now I'm able to view email compose screen and the data filled in, but my problem is after he gets invoked from in my application it never get all events, as I can not kick it, the BlackBerry shortcut menu does not appear the menu only one that works is the menu that appears by pressing the keys (trackball).

    All events, including the characters of that type in the body of the message i don't get it.

    Please help me.

    what I have done until now is the following:

     net.rim.device.api.system.Application.getApplication().invokeLater(new Runnable()
                {
                    public void run() {
                        MessageArguments mArgs = new MessageArguments                                          (MessageArguments.ARG_NEW,to,msubject, mbody);
                        Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, mArgs);
    
                    }
                });
    

    with the code above in invokeLater, I even tried without invokeLater but in vain.

    my scenario is a user clicks an option in the menu contextual app Feeback Email application opens and with the preset values user can edit too with his comments.

    Thank you

    JH

    Thanks guys, but now I found the solution for my problem mentioned above.

    the issue was with event management, even if my app was painted with screen e-mail editor events received to my main application screens, so I put control of all handlers on the current active form.

      public boolean checkActiveScreen()
       {
           net.rim.device.api.ui.Screen scr = net.rim.device.api.ui.UiApplication.getUiApplication().getActiveScreen();
           net.rim.device.api.ui.Field f = scr.getFieldWithFocus();
           if(null != f)
           {
               return false;
           }
             if (scr instanceof net.rim.device.api.ui.container.FullScreen)
            {
                return false;
            }
            else if(scr instanceof net.rim.device.api.ui.container.MainScreen)
            {
                return false;
            }
            else if(scr instanceof net.rim.device.api.ui.container.PopupScreen)
            {
                return false;
            }
    
           return true;
       }
    

    If the function above has solved my case.

  • BlackBerry SmartPhone App Submission - invoking the browser

    Hello

    Is it possible to submit an app in the BlackBerry App World which simply called the BlackBerry browser with a link to my mobile site? Are there disadvantages to this approach? I am very grateful for a quick response because I need an immediate response. Thank you

    (a) I suspect that this will help.

    http://supportforums.BlackBerry.com/T5/Java-development/invoke-the-browser/Ta-p/445362

    (b) I think I have already answered this question.

  • [ADF, JDev12.1.3] Why dynamic region is not spend if I re - call the currently displayed workflow?

    Hallo,

    I have a page with a dynamic region that is managed by a range backingBean bean.

    Functions "startBtf...". "are called when a menu item is clicked.

    The workflow as BTF3 is called by two different functions and each function passes a different value (used by a component of router) to the workflow through the hash table.

    The problem is that startBtf3_Search is called after the startBtf3_Create (and vice versa) the dynamic region is not updated.

    How can I solve this problem?

    Thank you

    Federico

    public class MainDynamicRegion {
      private HashMap parameters = new HashMap();
    
      public MainDynamicRegion() {
      }
    
      public TaskFlowId getDynamicTaskFlowId() {
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        String currentTaskflowId = (String) adfFacesContext.getPageFlowScope().get("CurrentTaskflowId");
        if (currentTaskflowId == null || currentTaskflowId.trim().equals("") == true) {
          currentTaskflowId = "/WEB-INF/empty-btf.xml#empty-btf";
          }
        return TaskFlowId.parse(currentTaskflowId);
      }
    
      private void setCurrentTaskflowId(String currentTaskflowId) {
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.getPageFlowScope().put("CurrentTaskflowId", currentTaskflowId);
      }
    
      public void startBtf1(ActionEvent actionEvent) { 
        this.setCurrentTaskflowId("/WEB-INF/btf-1.xml#btf-1");
        this.parameters.clear();
      }
    
      public void startBtf2(ActionEvent actionEvent) { 
        this.setCurrentTaskflowId("/WEB-INF/btf-2.xml#btf-2");
        this.parameters.clear();
      }
    
      public void startBtf3_Search(ActionEvent actionEvent) {
        this.setCurrentTaskflowId("/WEB-INF/btf-3.xml#btf-3");
        this.parameters.clear();
        this.parameters.put("mode", "S");
      }
    
      public void startBtf3_Create(ActionEvent actionEvent) {
        this.setCurrentTaskflowId("/WEB-INF/btf-3.xml#btf-3");
        this.parameters.clear();
        this.parameters.put("mode", "C");
      }
    
      public void setParameters(HashMap parameters) {
        this.parameters = parameters;
      }
    
      public HashMap getParameters() {
        return parameters;
      }
    }
    

    The workflow as BTF3 is called by two different functions and each function passes a different value (used by a component of router) to the workflow through the hash table.

    The problem is that startBtf3_Search is called after the startBtf3_Create (and vice versa) the dynamic region is not updated.

    How can I solve this problem?

    You call the taskflow even without leaving the previous.

    To update the workflow, you have several options:

    -Give taskflow refresh 'ifNeeded' parameter and change the value of the input parameter (unfortunately, it is not applicable to your usecase because you use the parameter mapping and not point settings so setting change cannot be detected)

    -use the property RefreshCondition

    For more details, see: 23 by using task flows in regions (12 c (12.1.3))

    BTW,

    currentTaskflowId = "/WEB-INF/empty-btf.xml#empty-btf";
    

    Instead, you can change the return type for getDynamicTaskFlowId() to a string and use an empty string ("" ") instead of emptying the BTF (and in this case you don't need even of TaskFlowId.parse (part)).

    Dario

  • Passing the parameter of workflow with shows the http 404 error pages

    Hello

    I have a parent workflow with fragments of page deleted as a region on a page. The fragment of a page in the parent workflow displays the read-only table employees. The service Id of the table appears as a link. When you click this link, the following is provided:

    • action listener is called which calls the managed bean that retrieves this Department Id and defines in the pageFlowScope.
    • Pass this value as an input to the child workflow parameter. Child workflow contains its display type is inline-popup page.

    The problem is that when there is no parameter passed to the child workflow the popup is fine. But if the parameter is passed it gives the following error:

    ADF_FACES - 60105:HTTP error state Code: 401.

    Parameters passed from parent to child, such as:

    #{pageFlowScope.DepartmentIdBean.value}

    (DepartmentIdBean is the bean class that gets and sets the Id selected Department)

    Parameter received in the child as workflows:

    #{pageFlowScope.pdeptId}

    Can someone please help me solve this problem? Is that the path parameter is spent creating problem? The same scenario works very well if the child workflow is invoked with fragments of page and like exterior window. I use JDev 12 c.

    I looked at the code and modify it to make it work. There were a few errors. the way main reason you got the error was that you tried to read the non-existing parameter values.

    Download the app from work OTNempDeptTaskFlow.zip | JDev & amp; Goodies ADF

    After downloading the doc you rename to zip and can then decompress.

    Timo

  • How to read the particular file workflow ID?

    Hi all

    I'm currently reading case workflow ID (E.g.: two folders are there library & MyWorkflows, I want to read MyWorkflows workflow ID). Below the code, I saw, but it returns all workflows of VCO.

    var workflowId = "";

    var workflows = System.getModule("com.vmware.library.workflow").getAllWorkflows();

    foreach(var wf in workflows) {

    if(wf.name == workflowName) {

      workflowId = wf.id;

    }

    }

    Thanks in advance,

    Add an entry to your workflow in the workflow type category (workflowCat1)

    cat1Workflows = workflowCat1.workflows;

    Then you can iterate through them.

  • Get the workflow parameter value before the end of the SOAP client workflow execution

    I'm calling webservices SOAP Orchestrator of my request to run a workflow. I want to get a parameter/attribute value before execution of the workflow.

    Brief:

    I have a XYZ workflow that adds two numbers provided by my application. After that my workflow perform some other features that say 5 minutes.

    My application is the result of the addition from the addition is performed. I don't want to wait for these 5 minutes to finish after what my worlkflow is finished and then obtain the result.

    Hello DeepakPN - first of all, if you use vCO 5.x, we strongly recommend to use the api instead of the old api SOAP REST.

    Now, to answer your question:

    When you run a workflow, the returned soap body includes a return workflow id: this is your workflow token id - essentially the Runspace of your workflow. He looks a bit like this:

    
       
          
             
                ff80808141e74b090141f05c5d2c00f7
    

    There are several additional lines less than retail, but I left it as an important component of the info here is this tag . The value that it contained should be used with the operation "getWorkflowTokenForId". By providing this ID and your credentials, the resulting SOAP body will contain details of your performance at the time of your request. So, if you have your amount stored as an attribute at the time that you run the query, you will see the results. For my simple test, here is my operation "getWorkflowTokenForId" for a test flow that I came through SOAP:

    
       
          
             
                ff80808141e74b090141f05c5d2c00f7
                Any Test
                1a568e2e-5c15-4b68-9bab-20cb955f0004
                item0
                completed
                completed
                
                20131025120447-0400
                20131025120447-0400
                
    
    
    >
    >
    
    
    
    ]]>
             
          
       
    
    

    Inside the tag, there is a tag that contains each of my entries/attributes. In the code above, 'anyInput' is the input parameter for my workflow and of the "inputTypeName" as an attribute.

    Hope this helps

  • No Service has been invoked, the request echoed (in OSB 11 g R1).

    -> created the project with the WSDL resources.

    -> created a Business Services, capable of performing successfully in commercial services

    -> created a proxyservice, when I send the request using proxy wondered even returned as a response, with the error below.

    No Service has been invoked, the application is resumed.

    I asked the BusinessService beside the proxyService solved my problem

  • Invoke the bean of calendar (from Oracle) on the TIMING of the CLICK of MOUSE events in a text box

    Hello
    I want to get the date the user has selected in a calendar of bean (supplied by Oracle), currently my practice is to put a bean for each calendar and after date selection I am pushing this field required date, suppose I need calendar half dozen in my form I have to place the beans a half dozen, basically I don't want user of bean rather , I want him to click on the text box then CLICK event, it will display a calendar of the bean click and on the selection value will return to the text element.
    Please guide is it possible if yes how.

    Version of Oracle Forms. 10.1.2(webutil installé)
    Database. Oracle 10g Enterprise


    Thank you and best regards,
    Syed Khawar

    now when the user clicks on bean, it appears calendar through trigger WCIE

    It's a way to view the calendar of Java, however, you can simply place a button on your canvas for each calendar you wish to view and then in the trigger Button-When-Pressed (WBP) to run code similar to the following:

    /* Code example assumes you have a CONTROL block with a */
    /* block Item called: CALENDAR_ITEM, which will act as a variable */
    /* to record which date item the Java Calendar was called for. */
    BEGIN
       :CONTROL.CALENDAR_ITEM := 'MY_BLOCK.DATE1';
       Set_Custom_Property('CALENDAR.BEAN_AREA',1,'SHOW_CALENDAR','50,50);
    END;
    

    This code displays the calendar and assign the value "DATE1" to your 'Variable' control block, so that you know what Date is your calendar was called for. Then, in your trigger when-Custom-point-Event (WCIE), you manage the date returned by your calendar of Java Bean and assign the value to the element of date in your CONTROL. Field of Calendar_Item.

    DECLARE
      v_event_name      VARCHAR2(30) := :SYSTEM.Custom_Item_Event;
      v_event_vals      ParamLIst;
      n_event_val_type  NUMBER;
      jb_date           VARCHAR2(256);  -- Complete Date as returned by the JavaBean
      d_formated_date   DATE;
      jb_day            VARCHAR2(256);  -- Day Number (1-31)
      jb_month          VARCHAR2(256);  -- Month Number (1-12)
      jb_year           VARCHAR2(256);  -- Year Number (YYYY)
    BEGIN
      IF ( v_event_name = 'CALENDAR_EVENT' AND :CONTROL.Calendar_Item IS NOT NULL ) THEN
        v_event_vals := Get_Parameter_list(:SYSTEM.Custom_Item_Event_Parameters);
        Get_Parameter_Attr(v_event_vals, 'CALENDAR_EVENT_DATE', n_event_val_type, jb_date);
        Get_Parameter_Attr(v_event_vals, 'CALENDAR_EVENT_DAY', n_event_val_type, jb_day);
        Get_Parameter_Attr(v_event_vals, 'CALENDAR_EVENT_MONTH', n_event_val_type, jb_month);
        Get_Parameter_Attr(v_event_vals, 'CALENDAR_EVENT_YEAR', n_event_val_type, jb_year);
    
        /* The variable JB_DATE contains the full date formated as MONTH DD, YYYY */
        /* Our date format is different, so I get the elements of the date in the */
        /* jb_day, jb_month, jb_year variables so I can format them the way I need them. */
        d_formated_date := TO_DATE(jb_month||'/'||mb_day||'/'||jb_year,'mm/dd/rrrr');
        COPY(d_formated_date, :CONTROL.Calendar_item);
      END IF;
    END;
    

    This code example will allow you to use a single area of bean to support several calendar items on a canvas. If you have more than one canvas and you have an element of date on each canvas, you would need a surface of bean / canvas.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

Maybe you are looking for