Starting workflow from WB (java)

Hi there WD guru's,
I am new on Web Dynpro (WD) and i do have some questions. What i have to realise is when the WD fields are filled in and the user pushed the "submit" button there need to be a workflow started in R/3.
What i have in mind is this:
1. Create a model in WD for SAP_WAPI_START_WORKFLOW
When i import this BAPI there is a yellow triangle in front of the BAPI. I think that it is a warning, but i do not know for sure. Hope somebody can tell me?  Is this SAP_WAPI_START_WORKFLOW the correct way? What you need to know is that we don't want that the data is first saved in R/3 before it is approved.
2. In the <b>DoInit()</b> fase of the Component Controller i want to create a new element of the SAP_WAPI_START_WORKFLOW_INPUT. This works fine. But when i create a new element of the INPUT_CONTAINER it goes wrong. As far is i understand, the input_container is a multi line structure. Can someone tell me if it's possible to fill the structure with the correct data? If there is a alternative, pls let me know.
The code looks like this:
// Create a new element in the Sap_Wapi_Start_Workflow_Input node
Sap_Wapi_Start_workflow_Input input = new Sap_Wapi_Start_workflow_Input();
// Create new elements in the Input_Container node
input.setInput_container(new Swr_Cont()); [here it goes wrong]
wdContext.nodeSap_Wapi_Start_Workflow().bind(input);
I hope i described it well enough. If there are questions, pls let me know.
Thx in advance
Regards,
Maarten

Hi Mukesh,
Thx for the answer, hope you (or somebody else) can help me i little bit more.
When i try,
input.setInput_Container("Param value");
It is not working. The setInput_Container(); is of type AbstractList arg0. Can somebody tell me how to fill this input container.
The input container has 2 fields ELEMENT and VALUE. I need to submit more lines in the input container.
Thx in advance.
Regards, Maarten.

Similar Messages

  • Starting Workflow from Generic Object Services

    Hi All.
    We are on ECC6. In transaction MM02 when I excute 'Start Workflow' from Generic Object Services, no workflows are found. Can anyone help me with the following issues;
    1. What is the underlying object in transaction MM02 (I believe it is BUS1001006)
    2. How can i ensure that the proper workflows in this transcation are started through some  
        customisation, enhencement or user-exit.
    Regards.

    I think you have to maintain the Workflow Template as General Task and then only it will appear in the GOS.
    Thanks
    Arghadip

  • Start Workflow from particular Step and assign to particular group of members

    Hi
    We are working on workflow using CQ 5.5.
    Is it possible start workflow from particular Step and assign this workflow to particular group of members dynamically(Using Process Step).
    Workflow Name : Single Page Workflow
                        Start
                            |
                        Step 1
                            |
                        Step 2
                            |
                        Step 3
                            |
                        Step 4
                            |
                        Step 5
                            |
                        Step 6 (Process Step)
                            |
                         End
    In Step 6 , we will start workflow for list pages dynamically , for that we written code as
    public class PublishTranslation implements WorkflowProcess{
        public void execute(WorkItem item, WorkflowSession wfsession, MetaDataMap metadata)
                throws WorkflowException {
               WorkflowModel  model = wfsession.getModel(item.getWorkflow().getWorkflowModel().getId());
               WorkflowData wfdata= wfsession.newWorkflowData("JCR_PATH",pagePath[i]);
               wfsession.startWorkflow(model, wfdata);
    This code starting workflow from step 1.
    I need help on
    1. How can i start workflow from step 2 or 3 ?
    2. How can i assign this workflow to group members ?
    Thanks & Regards

    Hello Ravindra,
    Logically it shouldn't allow you to do that and same happening because start workflow call on model will always trigger the workflow from starting point (means the very first step after start component in workflow design)
    To achieve this you have other ways, i would suggest to try below if it works for you.
    1. Instead of creating a new workflow just branch it programmaticaly and route back to previous step
          List<Route> routes=wfsession.getBackRoutes(item);
                     Route route=routes.get(WHAT_EVER_STEP);
                     wfsession.complete(item, route);
    2. Create a new workflow model which starts from second step and using code get access of that workflow
         wfsession.getAllWorkflows();
    for delegation as mentioned by Yogesh, you can try wfsession.delegateWorkItem(WorkItem item, Authorizable participant)
    Thanks,
    Pawan

  • Trigger MDM workflow from Webdynpro Java

    Hi All,
    After updating records in MDM, I want to trigger an MDM workflow from Webdynpro Java and pass those updated records to workflow. Any inputs on how to accomplish this. Workflow has already been developed using MSVISIO by the MDM team.
    Thanks,
    Tom

    By following steps, it is possible to integrate  workflow (or any workflow designed in MDM) within portal:
    1. UWL (Universal Worklist): The UWL gives users unified and centralized way to access their work and the relevant
    information in the portal. It collects tasks and notifications from multiple provider systems. One can expose MDM
    workflow functionality on Portal using UWL.
    2. JAVA APIu2019s: MDM Java API consists of set of classes related to MDM workflows through which one can create an
    application that provide the MDM workflow functionality and expose the application as an iView in the portal.

  • Start Workflow from the After startup database trigger

    Hallo,
    I try to startup a workflow process from a database trigger :
    the after startup database trigger. But when I do this, he
    doesn't startup. When I add a commit-statement after the call
    to startup the workflow, my database never gets open.
    What do I have to do ? And what command is used ?
    Thanks a lot.
    Filip Huysmans.

    See the Posting: Starting Workflows From a Database Trigger
    Hallo,
    I try to startup a workflow process from a database trigger :
    the after startup database trigger. But when I do this, he
    doesn't startup. When I add a commit-statement after the call
    to startup the workflow, my database never gets open.
    What do I have to do ? And what command is used ?
    Thanks a lot.
    Filip Huysmans.

  • Can not start workflow from Servr OM code

    Hello all ,
    i want to start sharepoint 2013 workflow when a list item is updated based on some condition.
    i have writen bellow code
    var workflowServiceManager = new WorkflowServicesManager(web);
                    var workflowSubscriptionService = workflowServiceManager.GetWorkflowSubscriptionService();
                    //get all workflows associated with the list
                    //get lsit
                    SPList list = web.Lists["Leave"];
                    if (list != null)
                        var subscriptions = workflowSubscriptionService.EnumerateSubscriptionsByList(list.ID);
                        //run all workflows associated with the list
                        SPListItem item = list.GetItemById(Convert.ToInt32(drpRequest.SelectedValue));
                        foreach (var workflowSubscription in subscriptions)
                            //initiation parameters 
                            var inputParameters = new Dictionary<string, object>();
                            //inputParameters.Add("List", leaveList.ID);
                            workflowServiceManager.GetWorkflowInstanceService().StartWorkflowOnListItem(workflowSubscription, item.ID, inputParameters);
    on the last line it throws unauthorised access exception .
    while current user have owner permissions.
    here is error .
    i have run full profile sync and user is availiable in UPS.
    Please Help
    Mukesh

    Hello  all,
    After running full profile sync i am able to deploy workflow.
    it is running
    but how can i elevate privilege to start workflow.
    from code
    Mukesh

  • Error while starting workflow from warning msg or error msg?

    Hello experts,
    I m tryin to start and workflow from error msg of ME21...whn we juss click enter without entering any value, it gives error as -" enter Purch org  ". whose msg class - ME and msg num - 083.
    thn from t-code SWUY,i creating and linked workflow for the msg.
    Now while testing,when m goin to t-code ME21, and goin to the long text of tht error msg.....the button to start workflow is not getttin enabled. tht is still disable.
    PLease tell r thr any other back ground settings to be done for this.
    Regards
    Nitin

    Hi,
    Your workflow landed up in Error and you want to Restart it right.
    Go to SWPR and check that workflow is there.
    If found, select it and Restart it.
    Regards,
    Surjith

  • Starting workflow from messages

    Hi,
    I am trying out the possibility of starting workflows when a message is raised (Error/Warning). Once i create the message to workflow linkage i am able to start the workflow from the message long text.
    In this scenario is there a way to start the workflow automatically whenever that particular error message occurs?
    For example consider transaction PA30. Now if i try to enter a character value in place of personnel number i get an error message "Enter a Numeric Value". Now once i link the workflow to the message i am able to start the workflow manually. But can this be done automatically on the occurence of this message?
    Thanks,
    Prasath N

    Hi Karun,
    Thanks for your response. I have done this already and it is workfing fine when i start the workflow manually. I would like to know if there is an option to start the workflow <b>automatically (without pressing the workflow button)</b> when the message is raised.
    Thanks,
    Prasath N

  • Starting Workflow from VA02/03 Problem

    Hi,
    I have a problem, I want to start the workflow in VA03 Transaction, from menu "Service Object"==>" Workflow"==>"Start Workflow", but I can't see the workflow I want to start, the window is empty, this does not happen in our Quality an Production System, I can see it there in VA03 and in SWUI transaction, but in our Development System is not possible to see it, is there any configuration missing or some tasks thet need to be performed to see the workflow to start it manually from VA02 & VA03 Transactions??.
    Best Regards,
    Moisés.

    Hi Moisés,
    If you want a workflow to be triggered via GOS then it must be in the Start Workflow list in transaction SWUI and in order for it to be in the list it must not have an mandatory import elements and you must also be a possible agent (Set the agent assignment of the workflow template to General). Can you make sure the above 2 conditions are met and then test.
    Regards,
    Eddie

  • Start Workflow from transaction

    Hi ,
    Please let me know, where can i subscribe my custom workflow to trigger the workflow if we want to start the workflow manually from transaction FV60.
    Thanks in advance
    Sarath

    Hi
    I am not very much sure about how the txn FV60 look and feel would be , but the solution to your answer is already in your post, Assuming that there would not be any kind of button on the application tool bar of the standard txn FV60, you might have customized it, in sucha  way that you could include the button START WORKFLOW on application tool bar.
       As per your requirement you want to initiate the workflow only in case when the end user clicks on the START WORKFLOW button, In that case I think by using the Module pool programming you can actually resolve the requirement. By just simply validating the SY-UCOMM , if the fcode is equal to the FCODE of START WORKFLOW button, then by using either SAP_WAPI_CREATE_EVENT or SAP_WAPI_START_WORKFLOW. You can start manually.
    Instead of implementing some Badi's or User Exits..
    Regards
    Pavan

  • Starting applications from a Java GUI

    Hi,
    I am creating a main menu application that will act as a front end for users to a selection of other applications. They will use this main menu application to start any of the other applications.
    Most of these other application are written in Java, however, some of the applications have been written in Xview and until I can convert them to Java I have to be able to start them from my main menu application. When I exec these Xview applications they fail every time with the following message:
    X Error of failed request: Bad Access (attempt to access private resource denied)
    Major opcode of failed request: 89 (X_StoreColors)
    Serial number of failed request: 152
    current serial number in output stream: 153
    Now from what I can gather the problem is (apart from my lack of Xview knowledge) the Xview application is trying to change and lock the colormap which I assume is locked by the java application or something along these lines. I don't suppose anyone has come across this problem themselves and has any suggestions???
    Cheers
    Jim

    Welcome to the forums!
    Keynote does not support the use of AppleScript in that fashion.

  • How to check for errors in starting workflow from plsql?

    Hi All,
    I am using the below code to start a custom workflow.
    DECLARE
    l_itemtype VARCHAR2(30) := 'XXPWA';
    l_itemkey  VARCHAR2(30) := '1116410C';
    error_code VARCHAR2(2000);
    error_msg  VARCHAR2(2000);
    BEGIN
        wf_engine.createprocess(l_itemtype, l_itemkey, 'XX_WEBADI_APPROVAL');
        wf_engine.setitemuserkey(itemtype => l_itemtype
                                ,itemkey  => l_itemkey
                                ,userkey  => 'USERKEY: ' || '1116410C');
        wf_engine.setitemowner(itemtype => l_itemtype
                              ,itemkey  => l_itemkey
                              ,owner    => 'SYSADMIN');
        wf_engine.setitemattrnumber(itemtype => l_itemtype
                                   ,itemkey  => l_itemkey
                                   ,aname    => 'BATCH_ID'
                                   ,avalue   => 1116410);
        wf_engine.startprocess(l_itemtype, l_itemkey);
    EXCEPTION
    WHEN OTHERS THEN
    error_code := SQLCODE;
    error_msg  := SQLERRM(SQLCODE);
    dbms_output.put_line(error_code||error_msg);
    END ;
    The script completes successfully without errors.
    I am sending a notification from this workflow. I can see the records getting created in tables like WF_NOTIFICATIONS and WF_ITEM_ATTRIBUTE_VALUES. But i cannot see any thing if i query from Status Monitor. Also I am not getting the said notifications. How can i find what is the issue?

    Hi Manu,
    Thanks for sharing the information, If you think of speeding up finding were exactly your notification is struck, You can use the below query (Input parameter would be your notification id), Hope this information is good, I liked this very much, the way it was narrated.
    SELECT n.begin_date,
           n.status,
           n.mail_status,
           n.recipient_role,
           de.def_enq_time,
           de.def_deq_time,
           de.def_state,
           ou.out_enq_time,
           ou.out_deq_time,
           ou.out_state
      FROM applsys.wf_notifications n,
           (SELECT d.enq_time def_enq_time,
                   d.deq_time def_deq_time,
                   TO_NUMBER((SELECT VALUE
                               FROM TABLE(d.user_data.parameter_list)
                              WHERE NAME = 'NOTIFICATION_ID')) d_notification_id,
                   msg_state def_state
              FROM applsys.aq$wf_deferred d
             WHERE d.corr_id = 'APPS:oracle.apps.wf.notification.send') de,
           (SELECT o.deq_time out_deq_time,
                   o.enq_time out_enq_time,
                   TO_NUMBER((SELECT str_value
                               FROM TABLE(o.user_data.header.properties)
                              WHERE NAME = 'NOTIFICATION_ID')) o_notification_id,
                   msg_state out_state
              FROM applsys.aq$wf_notification_out o) ou
    WHERE n.notification_id = &NOTIFICATION_ID
       AND n.notification_id = de.d_notification_id(+)
       AND n.notification_id = ou.o_notification_id(+)
    This single query links all together and shows you the current state of the message.
    Column 5 & 6 shows the enqueue & dequeue time of WF_DEFFERRED queue.
    Column 7 shows the message status in WF_DEFFERRED
    Column 8 &  9 shows the enqueue & dequeue time of WF_NOTIFICATIONS_OUT queue.
    Column 10 shows the message status in WF_NOTIFICATION_OUT.
    Below is the sequence of activities going on between the PL/SQL trigger of the business event and the e-mail received from notification mailer in the tail -end
    1. EBS user sends email – To send an email EBS modules use standard API. Email API is implemented in PL/SQL package WF_NOTIFICATION (I will cover it in the next article).
    1.1. Provides application data – First of all user’s session inserts business data (recipient, message type, message text etc.) into WF_NOTIFICATIONS table (do not mix up with PL/SQL package mentioned above);
    1.2. Defers processing Generates event – a user or process leaves EBS to run further email processing steps. It is done using a Business Events System (BES). Session raises an event k“oracle.apps.wf.notification.send” via the WF_EVENT PL/SQL package (BES processing to be covered in the next articles). Each deferred event is put in one of the two Advanced Queues WF_DEFERRED or WF_JAVA_DEFERRED for further processing. All email sending events go through the WF_DEFERRED queue.
    2. Deferred Agent Listener – is a process responsible for ALL BES events processing. It executes all deferred events calling subscriptions’ functions defined for each business event. There are several more things to explain about Agent Listeners and subscription processing (e.g. there are several differed agents, subscriptions groups etc.) This is one more subject for further articles.
    2.1. Reads event and starts subscriptions processing – Strictly speaking there is no any enabled subscription for the “oracle.apps.wf.notification.send” event (submitted during the first step). This event is a part of “oracle.apps.wf.notification.send.group” event group. The Deferred Agent executes subscriptions for that group rather than for the stand alone event. At this stage the Agent knows that it should process the notification with given notification id (it is a part of the event data passed via the event).
    2.2. Reads application data – in order to generate the email/notification the Agent reads business data from the WF_NOTIFICATIONS table and a few related tables and during the next step builds up the email’s text in XML format.
    2.3. Generates data for outbound interface – This is the last step executed by the Deferred Agent Listener. It generates XML representation of email to be sent and together with other important bits of information posts it to the Notification Mailer outbound queue WF_NOTIFICATION_OUT.
    3. Notification Mailer – As you see it was a long journey even before we started to talk about the Notification Mailer. There are a lot of things which may go wrong and this is why it is important to know the whole flow of the events to troubleshoot the mail sending functionality in EBS. We’ve come to the last processing step before the message leaves EBS boundaries.
    3.1. Reads message – the Notification Mailer dequeues messages fromWF_NOTIFICATION_OUT queue on regular basis. In fact this is the only place where it looks for the new messages to be sent. This means if a notification doesn’t has a corresponding event ready for dequeuing in the WF_NOTIFICATION_OUT queue it will never be send. As soon as a new message arrives Notification Mailer dequeues it and gets prepared for sending;
    3.2. Sends email via SMTP – This is the step when the message leaves EBS. The Notification Mailer sends the email using text retrieved from the advanced queue during previous step;
    3.3. Updates status – as the last step in the notification sending process the Notification Mailer updates a MAIL_STATUS column in WF_NOTIFICATION table.

  • Start workflow from DAM-folder

    Hi,
    is it possible to declare a workflow model so that it is possible to start it by selecting the folder in the DAM rather than the DamAssets?
    The case is that we would like to add properties to all assets in the selected folder, a variant of the Bulk Edit.

    We have a component that does this kind of things today, but would like to push the functionality to a workflow that is startable from the DAM or WCM. The usecase is this (using Geometrixx):
    Open the DAM
    Browse to the Geometrixx-folder  (http://localhost:4502/damadmin#/content/dam/geometrixx)
    Right-click on "Banners"
    Select "Workflow" and then Select what workflow to start.
    It is at step 4 I get stuck. There I can't get the "Workflow" to be enabled.
    Another variant is if we can set the tag on the folder an have it inherited by all sub-assets?

  • Starting workflow from where ?

    hi,
    is it possible to start a workflow 'behind' a transaction code ?
    i want to have a menu-entry in user-menu in ERP where the user can click on
    a self-written workflow. but how can i give them the possibility to enter this workflow ?
    reg, Martin

    REPORT  YGERTEST_START_WF.
    data: gw_task type SWW_TASK,
          gw_wf_id type SWW_WIID,
          gw_wi_id type SWW_WIID,
          gw_return_code type sysubrc,
          gw_status type SWR_WISTAT,
          gt_message_lines type STANDARD TABLE OF SWR_MESSAG,
          gw_message_line type SWR_MESSAG.
    start-of-selection.
      CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
        EXPORTING
          task                      = 'WS94400047'
    *     LANGUAGE                  = SY-LANGU
    *     DO_COMMIT                 = 'X'
    *     USER                      = SY-UNAME
    *     START_ASYNCHRONOUS        = ' '
    *     DESIRED_START_DATE        =
    *     DESIRED_START_TIME        =
    *     DESIRED_START_ZONLO       = SY-ZONLO
    *     IFS_XML_CONTAINER         =
        IMPORTING
          RETURN_CODE               = gw_return_code
          WORKITEM_ID               = gw_wf_id
          NEW_STATUS                = gw_status
        TABLES
    *     INPUT_CONTAINER           =
          MESSAGE_LINES             = gt_message_lines
    *     MESSAGE_STRUCT            =
    *     AGENTS                    =
    write: / 'Return code from start: ', gw_return_code,
           / 'WF ID: ', gw_wf_id.
    loop at gt_message_lines into gw_message_line.
      write: / gw_message_line.
    endloop.
    write: / 'New status: ', gw_status.
    select max( wi_id )
           into gw_wi_id
           from swwwihead
          where top_wi_id eq gw_wf_id.
    CALL FUNCTION 'SAP_WAPI_EXECUTE_WORKITEM'
      EXPORTING
        workitem_id          = gw_wi_id
    *   LANGUAGE             = SY-LANGU
      IMPORTING
        NEW_STATUS           = gw_status
        RETURN_CODE          = gw_return_code
      TABLES
        MESSAGE_LINES        = gt_message_lines
    *   MESSAGE_STRUCT       =
    write: / 'Return code from execute: ', gw_return_code,
           / 'WI ID: ', gw_wi_id.
    loop at gt_message_lines into gw_message_line.
      write: / gw_message_line.
    endloop.
    write: / 'New status: ', gw_status.
    Works like a charm. You could enhance the selection on SWWWIHEAD with the type of task you expect and even wait for it to exist if it's not the first step in the workflow.
    Good luck,
    Gert.

  • Starting Workflow from Record

    Dear all,excuse me for my english.
    1) I want to create workflow with
    record.For doing this i'm creating service provider for workflow
    and use standart function to start wf.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/057 03a1ff16f68e1
    0000000a11402f/content.htm
    For this function programm send input container , that must
    include parameters:
    - RECORD Business object RECORD.
    - AKTID: ID of the record
    - ACTCL: Document class of the record
    - RMSID: RMS ID of the RMS in which the record was
    created.
    - AKTSPSID: Element type of the record
    - FIRSTAGENT: "US" + current user name
    - AKTLOGSYS: RFC destination of the system in which
    Records
    But in debug mode i can see only last 4.What i must do for
    programm sends also record,aktid, actcl?
    2)When adding a document to case we may execute method create, but in this method we need that BO reading elements from container.
    How i can solve this problem?
    Help me plz, thanks.

    You have created your own function module to start the workflow, is that correct? The obvious question then is: How do you set up the container to pass parameters to the workflow? This isn't done with customizing when you create your own function module, it is done with ABAP coding.
    There are (at least) two possibilities for passing a BOR object instance to a workflow. The simple one is to raise an event for the object, then the BOR object will be found as the event object and can be bound from the triggering event. Another possibility is to fill the container manually. That means you must create the object ID (persistent object reference). Typically you will use the macros available in <cntn01> to create this object reference. Then you must put this object ID in the container with the correct element name, i.e. the name you find in the workflow definition.
    <i>PS: When you put a URL in here, use the URL option to hide the address so the link works. Your URL contained two spaces and didn't work immediately. When pasting into Firefox the spaces in the URL were converted to underscores, so at the URL is technically valid, but the page is not found.</i>

Maybe you are looking for

  • J2SE Plain Adapter - Continuous Operation

    Hi All, I would like to ask for your assistance in configuring the J2SE Plain Adapter Engine for continuous operation. This is the scenario: We currently have the db_receiver (jdb receiver) adapter up and running. The connection to the DB is ok and a

  • How to include "@someword"  verbatim in a documentation?

    I fear this is quite a beginners question... The text of a class documentation must contain words that start with an "@" symbol because this is the kind of data the class processes. How can I prevent the error message "@someword is an unknown tag"? (

  • Problems Exporting to Excel in Acrobat XI

    I have some problems exporting a PDF to excel in Acrobat Std or Pro XI but not in Acrobat Std or Pro X.  When exporting in X all the columns and rows are created as they should be, but in XI everything is slammed to the left in one column.  Has anyon

  • Cp6 - Feature request (locked but editable objects)

    I know I complain a lot.   But it is all for the greater good... I want Captivate to become an even better product. One thing that greatly annoys me and I know one or more others have complained about this, is that if you lock an object, you cannot d

  • How to generate the documentation of nested private class?

    When I generate the documentation with the flag -private (the less restrictive), I get only the javadoc class block comment for the nested classes, is there any way to see the information about fields, operations, constructors, etc. I am using jdk 1.