Controlling on user assignment when starting a process programmatically

Hi all,
I m starting a process programmatically.Process initiation is working fine, but i also need to control on the user to which that process and task will be assigned to.
Please guide how can this be achieved.
Thanks and regards,
Sakshi

Hi George,
My scenario is :
I m using startProcess() method to start a process programmatically. I m using following line of code, that initiates the process:
rtm.startProcess(process, "HeaderUI(Start Demo)", "start process", user, roles, params, user);
In this, as per the documents that i found, the field, 'user' before roles refer to initiator and 'user' in the end of statement is some user.
Now if i tried to give two different values to both these user, so that initiator of the process is different person and the user working on tasks will be different then in that case it throw error and do not allow me to give different user values.
Make a note that the roles list that i m passing is an empty list.
So is it possible to assign process to a different user and different users for different actions inside the process.
Please guide.
Thanks and Regards,
Sakshi

Similar Messages

  • Assigning Group(of users)  to Role when starting a process programmatically

    Hi All,
    I m starting a process programmatically(using startProcess()).
    Process initiation is working fine, but i need to assign a 'Group' to the role, and not a user. It is a portal group, available at portal end only. How can this be done?
    Please guide.
    Thanks and Regards,
    Sakshi

    you can use the following code
    import com.sap.caf.eu.gp.process.api.GPProcessFactory;
    import com.sap.caf.eu.gp.process.api.IGPProcess;
    import com.sap.caf.eu.gp.process.rt.api.IGPProcessRoleInstanceList;
    import com.sap.caf.eu.gp.process.rt.api.IGPRuntimeManager;
    import com.sap.security.api.IUser;
    public void startProcess( java.lang.String processId )
       // retrieve the Runtime Manager
       IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
       // create an empty role assignment list
       IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
       // get the process role number
       int rolenum = process.getRoleInfoCount();
       // iterate over the required roles
       for (int i = 0; i < rolenum; i++) {
          // create a new role instance by specifying the role's unique name
          IGPProcessRoleInstance roleInstance = roles. createProcessRoleInstance(process.getRoleInfo(i).getRoleName());
          // add a user to the role instance
          roleInstance.addUser(roleUser);
          // add the new role to the assignment list
          roles.addProcessRoleInstance(roleInstance);    
    Thanks and Regards
    shanto aloor

  • Random SP2 error when starting oracle process through SHELL script

    Hi All,
    I am trying to process data in n-Number of tables through a package. The package is called through a shell script to create start data processing. All calls to the package are in a sql script which is basically exec calls-
    exec package.process ('T1','some param');
    exec package.process ('T1','some param');
    exec package.process ('T..n','some param');
    I have a shell script which I use to execute commands from the sql script. There is a reason behind using shell script. For some strange reason, I keep on getting -
    ERROR: logon denied - check for valid user with valid privileges
    SP2-0640: Not connected
    SP2-0641: "EXECUTE" requires connection to server
    SP2-0640: Not connected
    for some EXEC calls. Problem is, errors are generated at random. So in one run, I get error for T10,T11 and then in next run I might get for some other tables.
    However, when I am running the sql script from the sql prompt, all calls to the package are executed without any problem.
    This makes me think, it is something to do with the way database connection being initiated through UNIX.
    Has anyone faced similar issue? Your help/gudence is much appreciated.
    DB: Oracle 10.2.0.5
    OS: SUN Solaris 10
    Thanks in advance.

    Login credentials are provided inside the shell script.
    I did put a sleep(10) after EOF but no help. As mentioned if I run script file from sql promt, it runs without any hiccup. So it is the connection through the UNIX that is causing issue.
    As pointed out by Sybrand, I agree that it does not make a sense to connect and commit after every sql statement. So decided to change the shell script and so far, the result from my initial tests on a sample data is quite encouraging. Hopefully I will have a solution.
    But it will be nice to know why SHELL is doing what it is doing!!
    Legacy prog are sometime big time eye-openers..;)

  • Error when starting a Process

    Hi everyone,
    I am using NetWeaver 7.0 SP13, and I am trying to start a process that was created previously, however I get the following exception:
    com.sap.caf.eu.gp.exception.api.GPEngineException: Error filling role role.administrator of role type 3 during instantiation at
    com.sap.caf.eu.gp.process.rt.impl.GPRuntimeManager.checkRoleList(GPRuntimeManager.java:307) at
    com.sap.caf.eu.gp.process.rt.impl.GPRuntimeManager.startProcess(GPRuntimeManager.java:125) at
    com.sap.test.process.StartProcess.startProcess(StartProcess.java:311) at
    com.sap.test.process.wdp.InternalStartProcess.startProcess(InternalStartProcess.java:153) at
    com.sap.test.process.view.StartProcessView.onActionstartProcess(StartProcessView.java:145) at
    com.sap.test.process.view.wdp.InternalStartProcessView.wdInvokeEventHandler(InternalStartProcessView.java:140)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at om.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at
    com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at
    com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at
    Here is the code I´m using, the line that rises the exception is this:
    rtm.startProcess(process,
                             "API test by me", "This process has been started by me... :p",
                             user, roles, params, user);
    The error reported above is " role role.administrator of role type 3" which I do not understand or found information
    about it on help.sap.com.
              IWDClientUser wdUser = WDClientUser.getCurrentUser();
              user = wdUser.getSAPUser();
              IGPUserContext userContext2 = GPContextFactory.getContextManager().createUserContext(user);
              IGPProcess process =GPProcessFactory.getDesigntimeManager().getActiveTemplate( processId, userContext2 );
              IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
              IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
              int rolenum = process.getRoleInfoCount();
              for (int i = 0; i < rolenum; i++) {
                   IGPProcessRoleInstance roleInstance = roles. createProcessRoleInstance(process.getRoleInfo(i).getRoleName());
                   roleInstance.addUser(user);
                   roles.addProcessRoleInstance(roleInstance);
              params = GPStructureFactory.getStructure(process.getInputParameters());
              wdComponentAPI.getMessageManager().reportSuccess( params.toString() );
              String name = process.getAdminRole().getRoleName();
              IGPProcessRoleInstance roleInstance = roles.createProcessRoleInstance(name);
              roleInstance.addRuntimeDefinedUser(user);
              roles.addProcessRoleInstance(roleInstance);
              Date date2 = new Date();
              params.setAttributeValue("data", date2);
              rtm.startProcess(process,
                             "API test by me", "This process has been started by me... :p",
                             user, roles, params, user);
    Thanks in advance!
    Cheers,
    Francisco

    -> press '''CTRL''' + '''SHIFT''' + '''ESC''' to Open Task Manager -> Processes tab -> right-click '''firefox.exe''' and click '''End Process Tree''' -> close Task Manager
    Troubleshooting extensions and themes
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Troubleshooting plugins
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins
    Check and tell if its working.

  • User Error when exec scanning process

    Hi, I have a Desktop Windows 7 64 bits with MBSA 2.3 installed.
    When run the scanning process (from command line interface by mbsacli.exe) to Windows 2008 Server R2, the process fail and showme this messages:
    ===
    Microsoft Baseline Security Analyzer
    Version 2.3 (2.3.2208.0)
    (C) Copyright 2002-2013 Microsoft Corporation. All rights reserved.
    Scanning...
    1 of 1 computer scans complete.
    Scan Complete.
    XX\YYYYYYYY (192.168.1.9) User is not an administrator on the scanned machine.
    Computer Name,  IP Address,  Assessment,  Report Name
    ===
    The user account input from command line (/u testseguridad) was join to Local Adminitrator Group.
    I have an error but i dont see where.
    Can you help?
    Thanks for your help.
    Best Regards.

    Hi Markus,
    You need to assign the default roles to the processes. Check this link for the details: http://help.sap.com/saphelp_erp2005/helpdata/en/43/9f2d87c0a86756e10000000a11466f/frameset.htm
    Regards,
    Shubham

  • Problem when starting BPEL Process Manager 10.1.2.0.2

    Oracle BPEL Process Manager Full Cycle
    An unexpected error has occurred while executing your request. This is most likely related to a defect in the Oracle BPEL Process Manager product. We apologize you can post the error to the OTN forum and we will get back to you as soon as possible.
    That message is shown in WSIF's label of BPELAdmin.
    Also starting show us
    Cannot lookup jdbc datasource.
    The process domain was unable to lookup the TX datasource "jdbc/BPELServerDataSource".
    But jdbc looks good.

    It couldn't be such difficult.
    I have the jar's, the drivers in, the jdbc url connection as
    url="jdbc:oracle:thin:[USERNAME/PASSWORD]@IP:PORT:SID"/>
    Also I can connect via sqlplus with this string conn.
    The main error I get is
    "Cannot lookup jdbc datasource.
    The process domain was unable to lookup the TX datasource "jdbc/BPELServerDataSource"."

  • When downloading pictures, process freezes up - already restarted a few times but freezes up every time on different photos - help!!!

    Question - What to do when 3G iphone freezes up when dowloading/syncing pictures??

    I figured a work-around - when starting the process of downloading/syncing and the Wizard comes up, manually choose (check mark) the pictures that have not already downloaded.  I did it by groups of about 200 and it worked.  This time.

  • How Assigned TO field will be updated in "start Approval process" Task Action

    I have created a reusable workflow in sharepoint designer. Am using “start Approval process“ Task Action. I have a question in “start Approval process“ Task Action.
    I have username field in the list.  I have created a task form field with name username in “start Approval process“ Task Action. I have assigned list username field to task field username field.
    I have entered a user details in list user name field for new list item. Once the workflow has been started for that item a mail has been sent to the user whose name I have entered in the list user name field. Task has been assigned to the user whose name
    I have entered in the list user name field.
    When I have checked start Approval process task a send mail activity is present (Email Task notification currentitem:Assigned TO) .
    I have not update Assigned To field explicitly.
    1. Where / how the Assigned TO field is getting updated ?
    2. Workflow Initiation and task creation will be done internally by the user who created the item in the list?
    Thanks

    Hi,
    According to your post, my understanding is that you had questions about the “start Approval process“ Task Action.
    When you add the “start Approval process“ Task Action, you need to to select the user who the task assign to.
    To assign the user whose name you have entered in the list user name field, you add action as below:
    After you select the user, the Assigned TO field is getting updated.
    In addition, workflow Initiation and task creation will be done internally by the user who created the item in the list.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • OIM 9.1.0.2: Remove user assigned to a task in Provisioning Process

    I have read Note: Ability to Have Multiple Approvers Per Resource Object in OIM [ID 429999.1], and executed each steps described in it. But when grant these resource object to some user. First the request was not sended directly to a approval process, as had been expected that I would. The request was send to a provisioning process, specifically to user has been assigned a task, when the user approves the request until the request is then sent to approval process.
    I need to send directly to a approval process, because that's where I have defined my levels of approval.
    I'm using oim 9.1.0.2 BP18 running on OC4J 10.1.3.5 on AIX 6.1 64-bit clustered install with two nodes, Oracle Database 10.2.0.4 on AIX 6.1 64-bit on RAC.

    Hello Everyone,
    Thanks for your response. Actually i have a Approval Process, where i have defined my levels of approvals. In Resume I have this Env. :
    1.- A Resource: ResourceA
    2.- A Provisioning Process in relation with ResourceA.
    3.- A Approval Process in relation with ResourceA.
    The request was send to a provisioning process, specifically to user has been assigned a task, when the user approves the request until the request is then sent to approval process.
    I need to send directly to a approval process, because that's where I have defined my levels of approval. In other words i need to bypass the user assigned a task in provisioning process.

  • My Iphone 4 32GB started having this issue when I downloaded the 2 last 6.1.X... VOICE CONTROL pops-up even when I sleep and calls random people just by the sound of the snoring... in FACETIME even more annoying. I confirm that it does this day and night

    My Iphone 4 32GB started having this issue when I downloaded the 2 last 6.1.X... VOICE CONTROL pops-up even when I sleep and calls random people just by the sound of the snoring... in FACETIME even more annoying. I confirm that it does this day and night

    Turn off Voice Control.
    Otherwise, basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).

  • Start BPM Process from ABAP with another User as GUEST

    Hi all,
    i would like to start the BPM Process by a webservice. It works if the user GUEST has the role BPM_SuperAdmin.
    My question is: How can i chance this user, who call the webservice starting the process. The user, who starts the process by calling the webservice should be my own user instead of GUEST.
    Thanks in advance.
    Regards,
    Christoph

    the last reply is regarding the configuration at consumer side.
    of course you have to configure at the service provider side to enable the logon ticket as acceptable authentication method.
    I checked at my side, i found the the service for triggering bpm is already configured to use id/pwd and logon ticket as authentication method.
    you can check in this way,
    CE nwa-> SOA  Management->Application and Scenario Communication-->Single Service Administration
    find your service, if you haven't assign any profile to your service, there will be only one configuration generate by system
    you can edit this configuration.
    go to configuration tab, select the endpoint, select security tab in the bottom tab list.
    change the setting there.
    Edited by: John Wu on Sep 10, 2010 7:29 PM

  • Starting a process as a different user.

    I am trying to launch a script from my java application. My java application runs as root on my Solaris box. I'm using Runtime.getRuntime().exec() to launch the script. My problem is that I would like to run the script as a different user. So is there a way to do this? I am using sudo to switch users which appears to work fine, but if I use the 3rd parameter within exec() to set the working directory of the process then sudo cannot be found.
    Is there a better way of starting a process as a different user in Java?

    I'm running as root for testing purposes. When we roll it out we will be creating a special no-interactive shell account. Besides, all socket communications are going to be encrypted, security policies, etc. Additionally we are behind a corporate firewall.
    I'll have to think about the script thing. I was hoping for a more elegant pure java approach.
    Thanks for the input.

  • Error occured when starting process chain

    When we want to start a process chain via SAP_BW_ProcessChainRun we get the following error log:
    Failed to start process chain /NSN/C_DSP_TR_GLOBAL_II. No logid was returned by the BW-SCH API.
    com.redwood.scheduler.connector.sap.rfc.connection.exception.SapBapiException: BAPI exception while calling RSPC_API_CHAIN_START: E RSPC 022 Processes with Error
    BAPI exception while calling RSPC_API_CHAIN_START: E RSPC 022 Processes with Error
         at com.redwood.scheduler.connector.sap.rfc.jco2.connection.impl.ClientConnectionImpl.checkBapiReturnCode(ClientConnectionImpl.java:789)
         at com.redwood.scheduler.connector.sap.rfc.jco2.connection.impl.ClientConnectionImpl.handleRscpApiErrors(ClientConnectionImpl.java:808)
         at com.redwood.scheduler.connector.sap.rfc.jco2.connection.impl.ClientConnectionImpl.call(ClientConnectionImpl.java:505)
         at com.redwood.scheduler.connector.sap.rfc.connection.AbstractRfcConnection$4.doPerform(AbstractRfcConnection.java:296)
         at com.redwood.scheduler.connector.sap.rfc.connection.RemoteFunctionCall.perform(RemoteFunctionCall.java:120)
         at com.redwood.scheduler.connector.sap.rfc.connection.AbstractRfcConnection.perform(AbstractRfcConnection.java:461)
         at com.redwood.scheduler.connector.sap.rfc.connection.AbstractRfcConnection.execute(AbstractRfcConnection.java:289)
         at com.redwood.scheduler.connector.sap.rfc.jco2.connection.impl.SapFunctionModuleWrapper.execute(SapFunctionModuleWrapper.java:200)
         at com.redwood.scheduler.connector.sap.rfc.jco.AbstractSapFunctionModule.execute(AbstractSapFunctionModule.java:109)
         at com.redwood.scheduler.connector.sap.rfc.command.impl.BwProcessChainCommand.execute(BwProcessChainCommand.java:98)
         at com.redwood.scheduler.connector.sap.rfc.command.AbstractXbpCommand.doExecute(AbstractXbpCommand.java:86)
         at com.redwood.scheduler.connector.sap.rfc.command.AbstractCommand.execute(AbstractCommand.java:56)
         at com.redwood.scheduler.connector.sap.rfc.service.operation.RunJobOperation.doWork(RunJobOperation.java:103)
         at com.redwood.scheduler.connector.sap.rfc.service.SapJobWork.doWork(SapJobWork.java:38)
         at com.redwood.scheduler.infrastructure.workqueue.Worker.run(Worker.java:74)
         at java.lang.Thread.run(Thread.java:579)
    What could be the reason?
    Thanks
    Br
    Günter

    O.K. I can answer the question by myself: Is an authorisation issue. The rfc user who starts the PCs didn't have enough rights.
    Br
    Günter

  • User assigned to the process instance

    How to get in an automatic activity in PBL code, the user assigned to the process instance.
    In other words, if a previous activity is this.participant.next = Participant.findByName ( "ereyes")
    in the activity that follows I want to get that user.
    Can I get one?

    Thanks Dan for responding.
    I need help to assign the variables that tell me, mySavedParticipantName.
    The design process is as follows.
    1 .- Begin Activity
    2 .- Begin activity is connected to an interactive activity in the PBL method with code only does a log "Interactive Activity".
    3 .- interactive activity is connected to the end activity.
    4 .- The interactive activity is connected by a "Due Transition" to an automatic activity.
    5 .- The automatic activity has a transition to the Interactive Activity
    6 .- The PBL code of automatic activity is executed when it meets the deadline of interactive activity. This code is where I need to know which user was assigned to the interactive activity.
    The stage of the process is as follows.
    A. - It creates a process instance.
    B. - User "Dan" is assigned the process instance but NO running interactive activity.
    C. - The automatic activity reaches its deadline.
    D. - Runs the code of automatic activity. and there need to know the user who was assigned, ie, the user "Dan"
    If the code did not execute interactive activity, how can I assign the variable mySavedParticipantName for automatic activity and has a value?.
    Thank you and hope you can help me.
    Greetings

  • Itunes is not authenticating my User Name when I try to remove Parental Control

    Why is iTunes store unable to "Authenticate" my User Name when I try to unlock the Parental Control? This started after I downloaded the latest version 10.5

    See Here  >  http://support.apple.com/kb/HT1808
    This will not necessarily work if the Device has been Modified.

Maybe you are looking for

  • Download vs retail purchase

    Hi all, I was under the impression that if you bought Photoshop Elements, you received both the Windows AND the Mac versions.  I looked at the retail media at Best Buy and saw it has both versions.  I assumed that if I bought it through the Adobe Sto

  • How to determine the field size

    I am going to make a multiplatform application that hopefully will run on linux and windows 2000.If the os is 2000, then I will use vb.net/aspx else I'll use java servlets. I make the connection to the web server ( through HTTP) not directly to datab

  • How do I change the white background color in a b/w line drawing jpg?

    How do I change the white background color in a b/w line drawing jpg?

  • InputStream.available() doen't work always

    I have a remote HTTP resource of 11kb that I want to retrieve through InputStream obtained from HttpURLConnection (of J2SE) and HttpConnection (of J2ME). If I download it byte after byte with this code ("is" is InputStream instance from Http) : int c

  • N8 screen works eventually - worthwhile to fix?

    My son gave me his Nokia N8 when he got his new phone, basically for me to play audio books on but now my trusty old E52 looks like it might be on its last legs. Problem is the screen on the N8 is not "touch" anymore. It's more like "bash - several t