How to get current assigned participant id?

Hi mates,
This might be a basic questions, but useful for me :)
How to get current assigned participant id from screenflow? Or How to pass it as an argument from interactive activity?
Below is what I tried.
Participant.id or Instance.participant.id - returns login user id
Thanks

Hi,
Please correct me if I understood wrong.
You want to know whether an instance is assigned or not and if assigned then you want to fetch the assigned participant id.
If this is your requirement then please find the code below and make the necessary changes into it.
Write the following code in screen flow automatic activity but before that you need to pass the instanceid as argument to the screen flow.
In the process as well as screen flow layer make an instance variable instanceid as Int.
Then make an argument variable instanceidArg as Int in both the screenflow and process layer and map accordingly so that it will take the instanceid from process layer to the screen flow layer.
Assign instanceid = id.number; in process layer automatic activity but before the global interactive activity where you have maped the screen flow.
Write the following code in screen flow automatic activity.
logMessage("============= instanceid ==============" + instanceid); //instanceid is the id of the instance that you have passed from process layer.
ProcessService ps;
InstanceFilter instF = InstanceFilter();
ps.connectTo(url : Fuego.Server.directoryURL, user : "<userid>", password : "<password>"); //In studio the userid and password will be same
logMessage("Connected");
instF.create(processService : ps);
instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
//<ProessId Name> is the id of the process where you want to know the assighed participant id
instF.addAttributeTo(variable : VarDefinition.processid, comparator : Comparison.CONTAINS, value : "/" + "<ProessId>");
instF.addAttributeTo(variable : VarDefinition.INSTANCE_NUMBER, comparator : Comparison.IS, value : Int(instanceid));
Fuego.Papi.Instance[] instances = getInstancesByFilter(ps, filter : instF);
foreach (instance in instances) {
logMessage("Assigned ?: " + instance.participantId.empty);
logMessage("instance.participantId: " + instance.participantId);
ps.disconnectFrom();
Bibhu

Similar Messages

  • How to get current view name on clicking device back button?

    Hi,
    iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
    code samples will be helpful.
    my app.controller.js looks like below
    sap.ui.controller("com.opensap.App", {
      onInit : function() {
      document.addEventListener("deviceready", onDeviceReady, false);
      onBeforeShow : function(evt) {
      navButtonTap : function(evt) { 
    function onBackKeyDown(){
      //alert("hai");
      //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
      //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
      //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
    function onDeviceReady(){
       document.addEventListener("backbutton", onBackKeyDown, false);

    I somehow managed to find the solution
    function onBackKeyDown(){
      var app = sap.ui.getCore().byId("LoginDetail").app;
      app.back();

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get current version of safari. without having safari browser?

    how to get current version of safari. without having safari browser?

    I don't understand the question. Safari is a browser.
    Can you elaborate on what your are trying to do that initiated the question? People may be able to come up with some other option that gets you working the away you want.
    When you respond, please post the version of the Mac OS and the version of Safari you currently have. Otherwise, people are guessing and the quailty of help you get plummets.

  • How to get current rowindex of clicked object in cr2008 preview control

    hi
    i want to get selected raw data when user click on crystal report 2008 preview control.
    i can achieve using following code for particular row no.
    Dim repReport as new ReportDocument
    repReport.Rows(RowIndex).Item(ColumnIndex)
    how to get current rowindex ? 
    Thanks
    Sanjiv Sharma

    Only way I can think of is to use the rowset controller from the InProc RAS SDK. Here is a snippet of a sample code on how to:
    //Load the report
    if (clientDoc != null) {
    //create metadata structure
    RowsetMetaData rowSetMetaData = new RowsetMetaData();  rowSetMetaData.setDataFields
    (clientDoc.getDataDefinition().getResultFields());
           Fields fields = rowSetMetaData.getDataFields();
           String colName,colTypeName;
           int colType, len;
           Field field;
           HashMap colNames = new HashMap();
           HashMap colTypes = new HashMap();
           for (int i = 0; i < fields.size(); i++) {
                   field = (Field) fields.get(i);
                   colName =field.getDisplayName(FieldDisplayNameType.description, Locale
    .ENGLISH);
                   colNames.put("COL"+i,colName);
           colType = getColTypeFromVariant(field.getType().toVariantTypeString());
           len=field.getLength();
                  //Placeholder
            //add column metadata to data structure or XML
            Object colValue;
            int rowCount=0;
            if (getMaxRows() != 0) {
                   RowsetCursor rowsetCursor = clientDoc.getRowsetController(). createCursor
    (null, rowSetMetaData);
                  //Setting the batch size to make sure that you get back all the
                  //rows by setting the batch size.
                        clientDoc.getRowsetController().setRowsetBatchSize (rowsetCursor
    .getRowset().getTotalRecordCount());
               //Getting the Results back starting from the first row
               RowsetCursor resultCursor = clientDoc.getRowsetController(). createCursor(null,
    rowSetMetaData);
               resultCursor.moveTo(0);
                  while (!resultCursor.isEOF()) {
                      for (int i = 0; i < fields.size(); i++) {
                               colName=(String)colNames.get("COL"+i);
                               colTypeName=(String)colTypes.get("COL"+i);
    colValue=record.getValue(i);
                                //Placeholder
    //add row data to data structure or XML
    resultCursor.moveNext();
    For more details, consult the Report Application Server .NET SDK Developer Guide
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to get Current row of ViewObject in the DoDML methode

    Hi all
    I have two ViewObject EmplyesView and DeptView
    How to get Current row of ViewObject DeptView in the DoDML methode of EmplyesView

    OK, we can play this game on and on...
    I'll ask for a use case (http://en.wikipedia.org/wiki/Use_case) and you don't give any info we don't already know. After an other 10 posts we probably know what you real problem is and can give you the advice which you could have gotten in the fist place.
    So please take some time and describe the problem as if you would ask your mother for help. Tell us how the data model is build and how the VO are related. Is there any input from an user involved? Which information from the other view do you need? How do you get to the doDML method? Is there a button in the ui involved?
    Timo

  • How to get current month and last month dynamically??

    how to get current month and last month dynamically
    like
    month = getCurrentMonth();
    lastmonth = getcurrentMonth() -1;
    please help
    thanks

    hi :-)
    /* depracated but can be still useful */
    java.util.Date dtCurrent = new java.util.Date();
    int month = dtCurrent.getMonth();
    int lastmonth = dtCurrent.getMonth() - 1;
    System.out.println("* " + month);
    System.out.println("* " + lastmonth);
    /* better to use this one */
    Calendar cal = new GregorianCalendar();     
    int imonth = cal.get(Calendar.MONTH);
    int ilastmonth = cal.get(Calendar.MONTH) - 1;
    System.out.println("*** " + imonth);
    System.out.println("*** " + ilastmonth);
    regards,

  • How to get current IUser (com.sapportals.portal.security.usermanagement)

    Hi,
    does anybody know how to get IUser for the current user?
    I know how to get current IUser from com.sap.security.api package:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    but I need to have IUser from com.sapportals.portal.security.usermanagement package.
    Regards,
    Ladislav

    Ladislav,
    Try this:
    Get the IUser uisng the API com.sap.security.api.IUser and store it in a variable, say <i>sapUser</i>.
    Then,
    // Convert the logged in user to old EP5 usermanagement API
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try
         com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
    catch (UserManagementException e)
         e.printStackTrace();
    Bala

  • How to get current date for posting date

    hi,
    how to get current date for posting date ? any sample code ?
    Thanks

    Hi......
    Use
    Select getdate()
    for current date.......
    Regards,
    Rahul

  • Urgent : How to get current user id

    Hello,
    fnd_global.user_id returns -1
    fnd_profile.get('user_id',x_user_id) return null
    can anyone help how to get current logged in user to apps.
    Regards,
    Dinesh.

    Hi Dinesh,
    You must also make sure you have initialised the app.
    If you run this from sqlplus then it will return -1.
    If however you run this from within a concurrent program then the user id will be returned.
    Try using this from sqlplus fnd_global.apps_initialize
    Eg.
    begin
    dbms_output.put_line(fnd_global.user_id);
    fnd_global.apps_initialize(user_id => 3551,
    resp_id => 1,
    resp_appl_id => 1);
    dbms_output.put_line(fnd_global.user_id);
    end;
    /

  • How to get current time and date??

    How to get current time and date from my PC time and date to the java application??
    i use java.util.* package but got error, that is:
    - java.util.* and java.sql.* class are match
    - abstract class cannot be instantiated
    so what can i do, pls guide...thanks...

    There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
    Don't import *. Import the specific classes you need.
    Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother.

  • How to get current task ID in BPM

    Hi guys,
    I have a requirement where I need to get the current active UWL task id in BPM context. I  have seen the following code to create a direct execution url for a BPM task.
    // begin session
          IUWLSession uwlSession;
          uwlSession = uwlService.beginSession(uwlContext, sessionIdleTimeout);
          uwlContext.setSession(uwlSession);
          IUWLItemManager itemManager = uwlService.getItemManager(uwlContext);
          QueryResult result = itemManager.getItems(uwlContext, null, null);
          ItemCollection items = result.getItems();
          Item item = null;
          for (int i = 0; i < items.size(); i++) {
            item = items.get(i);
            Map params = new HashMap();
            params.put("taskId", item.getExternalId());
            String executionURL = WDURLGenerator.getApplicationURL("sap.com/tc~bpem~wdui~taskinstance", "ATaskExecution", params);
    This works fine, but this is looping through all the tasks assigned to a user.  How do I get the current task ID. I want to use the code inside webdynpro application which is caled as a human activity in BPM. When this WebDynpro application is called I would like to know the current task ID.
    As an FYI , UWL configuration passes the current task ID as a Dynamic parameter to "sap.com/tcbpemwdui~taskinstance"
    application.
    Please help if someone can identify how to get this value in my custom WD.
    Thanks,
    Yomesh.

    Yes. there is no API to get the current task.
    Try this:
    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("wi_id");
    But i still say a bit confused with your requirement.
    The task id gets created only upon creation of a task. And you want this current task id in the BPM Process context? How is it possible unless and until some action takes place and the data is passed from WDJ to BPM Context?
    Please clear my doubt.

  • How to get current JNDI inside of bean?

    Hello! I want to have two JNDIs for the one bean class. So there is no problem if I deploy the one bean twice in the same application with different JNDI. But at run time I want to know what JNDI's entry calls my bean. In this case how to get the current value of JNDI inside of instance of my bean?

    Okay guys. I will explain the reason of this question,
    may be then someone will be interested to this topic
    and cold propose another idea how to arrange the
    decision.
    The question is about security. For example I have two
    objects that realize two business warehouses. And I
    want to use the one bean class for both objects of
    course and also I want to have different permissions
    with every of them. So my idea is to deploy two beans
    contained the same class, into the one application jar
    and assign different JNDIs to each bean.
    That's is not a very smart idea. Why dont use EJB security features ?
    Create two roles: warehouse1 and warehouse2. Pass authentication information from those EJB clients to container when you lookup a bean home interface. (That's the reason why you' r idea wouldnt work).
    Now you can specify whis warehouse can call which EJB method. Also you can check it programmaticaly with isCallerInRole method.
    best regards,
    Maris Orbidans
    SCJP SCWCD SCBCD
    Then I could
    set different permissions to every bean. Everything is
    okay but also I don't want an explicit warehouse's ID
    parameter for my bean class. Let it gets the ID of
    warehouse as value of bean's JNDI. Only the problem I
    don't know how to access to JNDI from the instance. I
    supposed that I could get JNDI from current session
    context, but there is no way to access the bound JNDI.

  • How to get tasks assigned to me or group in which I belong to using Search Query?

    Hello,
    I want to get the tasks assigned to me or tasks assign to me in which I belong to. I know how to get it using CAML query however I want to get it in my custom search display template using Content Search Web Part.
    <Or>
    <Membership Type="CurrentUserGroups">
    <FieldRef Name="AssignedTo"/>
    </Membership>
    <Eq>
    <FieldRef Name="AssignedTo"/>
    <Value Type="Integer">
    <UserID/>
    </Value>
    </Eq>
    </Or>
    Please let me know how to filter tasks assign to group in which I belong to.
    Here is query which shows tasks assign to me but not to tasks assign to my groups
    (ContentType:Task OR ContentType:RequestTaskContentType OR ContentType:DelegacyAccountingContentType) AND
    AssignedTo:{User.Name} AND
    -Status:Completed AND -Status:Closed AND Status:"Not Applicable"
    Thanks & Regards,
    Jay
    Jayesh Prajapati

    Hi Jay,
    No, you can filter tasks assign to group in which you belong to using Content Search Web Part. Because there is no Query variable for current user group in SharePoint 2013 Search Query. You can have a look at the article:
    https://technet.microsoft.com/en-in/library/jj683123.aspx?f=255&MSPPError=-2147217396
    For a workaround, you can use the My Tasks web part outside of MySites:
    http://bernado-nguyen-hoan.com/2013/03/03/making-my-tasks-web-part-available-outside-of-mysites/
    http://yalla.itgroove.net/2014/04/27/use-sharepoint-tasks-web-part-outside-sites/
    Best Regrads,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get current tab name or tab id or related info?

    Hi ,
    I would like to hide/show tabs according to users' page privileges list. So I need get current tab ID or tab Name in runtime environment to know if show/hide it for current user. :APP_USER
    Could you please provide any info about this requirement? Or do you have alternative method to control tabs' hide/show?
    thanks
    Ruiping

    最爱用中文 wrote:
    Hi Jari,
    Thanks for your info. Even if set authorize schema to tabs, I still need to get the relationship between "current tab" and "privilege&users". So I think evrm's hard-code method above is avaliable.I agree with Jari: APEX provides Authorization schemes specifically for this purpose. You need to reverse your thinking on how to implement this.
    For more information consult the documentation on APEX security, specifically using authorization schemes to restrict access to pages and control rendering of components.
    Tutorial: Adding Security to your Database Application (APEX 4.0)
    Use Authorization Schemes to control access/rendering for security ("only managers see/access this page and it's associated tab"); and Conditions to control rendering for functional reasons ("region only displayed if account is in arrears").
    Authorization Schemes have the benefits of being reusable, performing better, and allowing central maintenance of security-related code. This makes it easier to change the implementation&mdash;say moving from role information held in database tables to groups defined in LDAP.
    I worked for a number of years with an application where authorization schemes are not properly used (decisions made before my involvement) and all security and business logic relating to rendering and processing is wrapped up in spaghetti code in conditions. It's impossible to maintain.
    It is of course advisable to make both authorization scheme and business logic condition code more reusable and maintainable by locating it in API packages.

Maybe you are looking for

  • Different languages used while uploading file from java Application

    Hi everybody, i have a problem with multiple languages , let me clear you the question, i were developing a java application using spring ,hibernate frame works, so i got a problem while uploading a file with chinees language or other it was saving w

  • FPN - End user permission

    Namaste all, I have followed https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70191d1e-2bd1-2a10-d9b7-ba19500da527 for setting up FPN. But I didn't understand how to assign end-user permission for a person at the consumer portal. C

  • Issue with Purchase Requisition Release Strategy (Approval)

    Hi There, I am facing an isssue with the PR Release Strategy. Please read the description below. When a PR is created the PR Release Strategy is getting determined correctly. But the problem is that for example, if the Strategy has found a two level

  • Changing units before making a document

    While specifying pages size I want the units to be inches or millimetres according to my choice. How can I do it? I know changing units after the document is made but is there a way for a prior setting?

  • Can I buy iPhone in China and use it on Russia?