Re-assign Instances in Bulk

Hi,
In our project we have a requirement of reassigning the instances which are currently pending with user to another user from a screenflow. An admin user will enter a ID of a user and also provide the ID of the user the requests need to be assigned to. Then all the instances that are pending with one user would be reassigned to the other user. Can anyone please help me with a way of designing this functionality.
Thanks!

Hi Sree,
Here's logic I use to automatically reassign instances in bulk.
It assumes that the participant that you're assigning the instances to ("instanceToActOn.participantId" in the logic below) is a valid participant for the activity you're assigning him to.
Note also for this to work, the process has to have a Grab activity (called GrabAutomatic" in this example) with its property set to "From all / To all". The participant "AUTOCLIENT" has to be assigned the role where the Grab activity is located. I use an "AutomaticGrab" because not all activities have their "Assignable" property set.
Use your own logic to search and populate the list of instances to reassign ("instf" variable in the logic below).
<pre class="jive-pre"><p /> logMessage "PapiHelper: actionAssign: Entry: instance: " + instanceToActOn.instanceIn
using severity = DEBUG
logMessage "PapiHelper: actionAssign: participant: " + instanceToActOn.participantId
using severity = DEBUG
bp as BusinessProcess
instF as InstanceFilter = InstanceFilter()
instances as Fuego.Papi.Instance[]
instanceDescription as String
connectTo bp
using url = Fuego.Server.directoryURL,
user = "AUTOCLIENT",
password = "P",
process = "/" + processName
logMessage "next is prc id"
create(instF, processService : bp.processService)
instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL,
          statusScope : StatusScope.ONLY_INPROCESS)
addAttributeTo instF
using variable = VarDefinition.INSTANCE_NUMBER,
comparator = Comparison.IS,
value = instanceToActOn.instanceIn
instances = getInstancesByFilter(bp, filter : instF)
logMessage "instances" using severity = DEBUG
for each inst in instances do
logMessage "Found it: " + inst.id
do
logMessage "Select: " + inst.selected
if inst.selected then
logMessage "instance selected"
     unSelect inst
end
logMessage "instance selected"
reasign(inst, participant : instanceToActOn.participantId)
logMessage "assigned it to " + instanceToActOn.participantId
on e as Exception
logMessage "Exception: ->" + e.message
description as String = String(getVar(inst, var : "PREDEFINE_DESCRIPTION"))
logMessage "Trying grab for " + description
do
grab inst
using grabActivity = "GrabAutomatic"
logMessage "Grabbed Instance Status: " + inst.grabbed
using severity = DEBUG
runTask inst
using activity = "GrabAutomatic"
logMessage "Ran Grab " + inst.grabbed
using severity = DEBUG
route inst
using activity = instanceToActOn.activityName
logMessage "Routed back"
using severity = DEBUG
reasign(inst, participant : instanceToActOn.participantId)
logMessage "reassigned it to " + instanceToActOn.participantId
on e1 as Exception
logMessage "Exception w/i exception: " + e.cause
errors = errors + "Instance: " + description + " could not be reassigned\n\n"
logMessage "Errors: " + errors
end
end
end
disconnectFrom bp
logMessage "PapiHelper: actionAssign: Exit: instance: " + instanceToActOn.id
using severity = DEBUG</pre>
Hope this helps,
Dan

Similar Messages

  • How to assign Activity to Participant with less assigned Instances??

    Hi!
    I'm trying to automatically assign the next Interactive Activity to the participant who has less assigned instances.
    I already know how to get a list of the participants who have the corresponding role, but I don't know how to get the number of assigned instances of a determined process that each participant has.
    Any ideas?? Thanks in advance!

    OK, I finally managed to do it :^O
    I get all participants with the Role "Iniciador", then get how many instances of the process they have assigned. And finally I send this instance to the participant with less work.
    logMessage("AutoAssign - Entering...");
    DirectorySession dirSession = DirectorySession.currentEngineSession;
    DirOrganizationalRole role = DirOrganizationalRole.fetch(session : dirSession, id : "Iniciador");
    Fuego.Fdi.DirHumanParticipant[] participants = role.fetchAssignedParticipants();
    BusinessProcess.connectTo(url : Fuego.Server.directoryURL, user : "redscare", password : "redscare", process : activity.process.name);
    String nombre="";
    int c=0;
    logMessage("AutoAssign - Entering foreach");
    foreach (element in participants) {
         filtro = InstanceFilter();
         filtro.create(processService : BusinessProcess.processService);
         filtro.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
         filtro.addAttributeTo(variable : VarDefinition.PARTICIPANT_ID, comparator : Comparison.IS, value : element.id);
         instances = BusinessProcess.getInstancesByFilter(filter : filtro);
         if(nombre=="" || instances.length()<c){
              nombre=element.id;
              c=instances.length();
    logMessage("AutoAssign - Exiting foreach");
    participant.next = Participant.find(name : nombre);
    participant.sticky = true;
    logMessage("AutoAssign - Exit. Participant.next= "+participant.next.name);

  • ClassCastException during Deserialization : Assigning instance of class...

    Hi All,
    I'm writing a client-server application.
    The server sends serializable objects to the client via a socket.
    When the client try to deSerialize the Object( in.readObject() ),
    I got Exception:
    java.lang.ClassCastException: Assigning instance of class java.io.ObjectStreamClass to field seda.sandStorm.lib.http.httpResponse#contentType
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2266)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
    at seda.Dseda.internal.ObjectReader.readObj(ObjectReader.java:96)
    at seda.Dseda.internal.ObjectReader.readPacket(ObjectReader.java:77)
    Both client and server have exactly the same copy of the classes.
    Any help would be apprciated.
    Thanks, Gil.

    Hi,
    I hava managed to solved the problem:
    The ObjectOutputStream need to be reset after every write(..).
    Gil.

  • Create Value assignment instance in CG02

    Hello All,
    I am trying to create a Value assignment instance in CG02 transaction using BAPI 'BAPI_BUS1077_CREATE'.
    I dont get any error in my execution. However, the instance is not getting saved in databse.
    FYI, I have used BAPI 'BAPI_TRANSACTION_COMMIT' and 'BAPI_BUS1077_SAVEFROMBUFFER' to save the data.
    Does anybody have any idea?
    Thanks.

    Hello All,
    I am trying to create a Value assignment instance in CG02 transaction using BAPI 'BAPI_BUS1077_CREATE'.
    I dont get any error in my execution. However, the instance is not getting saved in databse.
    FYI, I have used BAPI 'BAPI_TRANSACTION_COMMIT' and 'BAPI_BUS1077_SAVEFROMBUFFER' to save the data.
    Does anybody have any idea?
    Thanks.

  • Script to assign licenses to bulk AD synced user's office 365

    i have dirsync so all my local ad users are synced with office 365 tenant
    Now I am migrating mailboxes and I need to assign licenses to a bulk migrated users using csv
    This process requires 2 steps ‘cmdlts’
    $usagelocation = “SA”
    Set-MsolUser –UserPrincipalName user@domain -UsageLocation $UsageLocation
    After defining the location above time to assign the licenses
     Set-MsolUserLicense –UserPrincipalName user@domain  -AddLicenses company:ENTERPRISEPACK
    So how can I script this and use a CSV file?
    Also strange thing, I have ran the above to about 13 users manually, I placed the command on a notepad
    Copied all lines and past on the PS, after that other users who already had licenses had their licenses removed! So what did I do wrong? I am asking this to make sure the script you will provide will not remove the currently assigned licenses

    this script will work for you given the below conditions
    1- you have csv file with only one
    Column named "UserPrincipalName" and has all users need to be licensed
    2- all users in the above file in the format of [email protected]
    3- All users are having the same license
    $path= Import-Csv -Path "usersFiles.csv"
    foreach ($item in $path){
    $MSOLUserName= $item.UserPrincipalName
    $password = ConvertTo-SecureString "password here" -AsPlainText –Force
    $credential = New-Object System.Management.Automation.PsCredential("your username here",$password)
    $cred = Get-Credential -cred $credential
    Import-Module MSOnline
    Connect-Msolservice -cred $cred
    $AccountSkuId = "tenantdomain:ENTERPRISEPACK"
    $UsageLocation = "SA"
    $LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId
    Set-MsolUser -UserPrincipalName $MSOLUserName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $MSOLUserName -AddLicenses $AccountSkuId -LicenseOptions $LicenseOptions

  • How to assign instances within an OU?

    Hi,
    I have two OU's as follows:
    OU1
    |
    +-Sales_1
    |
    +-Infrastructure_1
    OU2
    |
    +-Sales_2
    |
    +-Infrastructure_2
    Right now if a Sales_1 participant generates an instance, both, Infrastructure_1 and 2 can see the instance in their inbox.
    What i need is: if the Sales_1 participant generates an instance, this instance must be only in the Infrastructure_1 participant's Inbox, and the same behavior if the instance is created by Sales_2 -Infrastructure_2. Is it possible to do this?
    Regards!!

    Hi,
         Essentially, the access to business process is determined by these 2 artifacts: OU and roles.
         For a person to have access to an activity in a process, this participant should belong to the Organizational Unit in which the process has been deployed as well as having the right roles assigned to him/her.
         In the event of a process connecting to a sub-process, the instance will be created without any problem even when the main process and sub-processes are deployed to different Organizational Units. The only problem may be that if the sub-process is deployed to a different Organizational Units, it will ONLY be visible by participants in the sub-process Ous and with the right roles assigned.
              eduardoc.

  • ME21N : account assignment mandatory for bulk material

    Dear guru.
    For a raw material used as bulk in production with material type ROH and quantity/value updating I need that when I create purchase order the system send an error message that account assignment is mandatory.
    I know that for an NLAG or UNBW material type the system send this message.
    For internal reason  I need to maintain material type ROH  with quantity/value updating , do you know a solution , any exit , in order to solve my problem  ?
    Thanks for you help.

    CONS  SAP wrote:
    Dear
    > I need that this component in the bill of material must be managed with position type L and I donu2019t want to do consumption movements.
    > I have verified that I can create a purchase order with account assignment for this material , I need only that the system send a message for these bulk materials.
    > Thanks.
    position type L means it is a inventory managed material.
    why do want the material to be inventory managed and at the same time dont want to record consumption movements?

  • Assign instances in a big organization

    Hi,
    I have a questions about how do you implement a big organizational unit with Fuego BPM.
    For example,
    - A bank with some offices (Example: 50 offices)
    - With Director and Subdirector (Different Roles)
    When I want to send an instance to the Director of the Office number 70, How can I send this instance to the correct Director?
    I can't use parametric roles, because the customer don't want to update all the changes in their offices manually.
    The customer wants to read all participants from an active directory and update these attributes in a oracle fdi.
    It's similar to re-assign by role, or re-assign by role and participant.
    I suppose that this problem has been solved in some big customers.
    Thanks in advance

    To model your organization you have basically 2 dimensions:
    1) Organizational Units (OUs)
    2) Roles
    you can plan a layout of both concepts so that you can implement the functionality you need. Basically OUs define visibility of processes and Roles define the permissions on them.
    Take a look at the concepts in the documentation to learn more about them.
    Mariano

  • Assign Instances to a Participant

    Is it possible to assign an instance to a participant within PBL code or is that something that is only done with the Workspace?

    Yes. Here's an example of how to assign the instance to the participant that created the instance:
    participant.next = creation.participant This logic just needs to be in an Automatic activity upstream of the Interactive activity.
    If all you have is the participant's name, you might do this using logic like this:
    // this assumes that "participantName" is a string that has already been set
    part as Participant
    // Using this name, find the participant and set it to the "part" object
    find Participant
      using name = participantName
      returning part
    // Now use the "part" object to set the predefined variable for
    //   next participant
    participant.next = partDan

  • How to assign roster to bulk employee

    Dear,
    1.Roster 1
    2.Roster 2
    We are facing the problem while assigning roster around more than 100 employee. is there any way to assigne roster through dataloader/api. Seconldy, have any option through we can set roster as default so that user create an employee system attache roster with them automatically.
    thanks.

    Hi User-keen,
    I'm afraid there are no public APIs.
    You can have the schedule defined for the organization and all employees under the Org would have the default schedule.
    And then you can override it for some employees.
    If you have a different schedule for each person, then how would you pass values to the API, if there were one.
    The tables which store the schedule info -
    CAC_SR_SCHDL_OBJECTS
    CAC_SR_SCHDL_DETAILS
    CAC_SR_PUBLISH_SCHEDULES
    You can use the below code if needed -
    INSERT
    INTO CAC_SR_SCHDL_OBJECTS
    VALUES
        objectSequenceNumber,
        l_schedule_id,
        'PERSON_ASSIGNMENT',
        i.assignment_id,
        start_date,
        end_date,
        fnd_global.user_id,
        sysdate,
        fnd_global.user_id,
        sysdate,
        fnd_global.login_id,
        NULL,
        NULL
    -- CAC_SR_SCHDL_DETAILS
    cac_avlblty_pvt.POPULATE_OBJECT_SCHDL_DETAILS ( l_schedule_id,objectSequenceNumber,start_date,end_date,NULL );
    INSERT
    INTO CAC_SR_PUBLISH_SCHEDULES
    VALUES
    (    CAC_SR_PUBLISH_SCHEDULES_S.nextval
        , 'PERSON_ASSIGNMENT'
        , i.assignment_id
        , l_schedule_id
        , start_date
        , end_date
        , fnd_global.user_id
        , sysdate
        , fnd_global.user_id
        , sysdate
        , fnd_global.login_id
    Cheers,
    Vignesh

  • Bulk assign colors or flags?

    is there a way to assign colors or flags to all the images in an Album?
    For bulk flags I have advice to "select all "Meta Data > Flag" but if I right click I don't see a meta data option and if I click on the meta data tab i only have been able to assign flags to one image even though they are all selected.
    Also I'd love to start assigning colors in bulk to images in Albums if this is possible. thanks

    Hi Leonie.
    I am trying this and the software is fantastic. Also your help is fantastic.
    But some things in here are very tricky because it is so powerful.
    For instance, can i please ask you if copying a version from an album to another album - will create two versions of the same image in the destination album (if there are versions of the same master in both)? i mean, in Finder it will ask me if I want to overwrite the file or if I don't want to move or copy or whatever.
    If I am trying to consolidate two albums so that there are not duplicates in the final album, can i copy the ones in the first to the second and delete the first? Or will there be two versions in the final if these exist?
    I am trying to test this but it is tricky since the images look very similar and I can't really tell at the moment which reference the same masters.
    Is duplicating in this case always happening, never happening, an option I can decide upon?

  • I3 Window Manager Applications Wont go to the assigned desktop[solved]

    I have played with this configuration for a while now and I can't figure out why some applications go where I tell them to and some don't.
    These are my current programs that wont go to the directed desktop either through hot keys or if I try to launch at boot.
    nmcpp -- Tried using urxvt but then I thought that might be confussing the issue so I changed to lxterminal and same issue.
    Thunar -- is an issue as well . I was using dolphin and that obeyed the syntax but I prefer Thunar.
    i3 - config file -->
    http://pastebin.com/u/jv2112
    Any ideas ?
    Thanks in advance for your response.
    Last edited by jv2112 (2013-08-10 02:33:47)

    jv2112 wrote:
    Changing Thunar designation to class did the trick.  -- > Thank You !!! progandy.
    Still working on ncmpcpp.  No dice with this change ...
    bindsym XF86_Tools exec --no-startup-id urxvt -title urxvt -e ncmpcpp
    assign [class="urxvt"] "3 : Tunes"
    See: http://i3wm.org/docs/userguide.html#command_criteria
    For your case, I believe you'd want to use -name for urxvt.
    bindsym XF86_Tools exec urxvt -name ncmpcpp -e ncmpcpp
    assign [instance="ncmpcpp"] "3 : Tunes"
    Edit: Also, you might find this script useful. It requires libnotify and a notification daemon. I have it bound like this:
    bindsym --release $mod+F1 exec --no-startup-id xprop_notify
    I just press Mod4 + F1 then click on a window and it reports the instance, class, and role of the window via dunst.
    The command criteria are case-sensitive, so the reason why assign [class="urxvt"] ... wasn't working for you is because by default the class for urxvt is URxvt. And urxvt -title doesn't change the class, it just changes the title of the window.
    Last edited by Ledti (2013-08-03 04:48:23)

  • How to Increase the retreving size of instances using PAPI filters.

    Hi,
    How to Increase the retreving size of instances using PAPI filters.
    In my engine database instance size exceeds 2500 then we are getting following exception.
    If we login in to user workspace able to see the instances but while trying to retrieve from PAPI getting below exception and showing the user's inbox aize as 0.
    In Process Admin console we set all the required parameters.
    Still I m getting the same problem.
    Can you please lgive mev the solution.
    <Mar 23, 2010 8:58:24 PM SGT> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: fuego.ejbengine.EJBProcessControl_1zamnl_EOImpl.getInstancesByFilter(Lfuego.papi.impl.j2ee.EJBSecureEngineInfo;Ljava.lang.String;Lfuego.papi.Filter;)
    java.lang.ClassCastException: cannot assign instance of java.util.HashSet to field fuego.view.FilterImpl.attributes of type java.util.List in instance of fuego.view.FilterImpl.
    java.lang.ClassCastException: cannot assign instance of java.util.HashSet to field fuego.view.FilterImpl.attributes of type java.util.List in instance of fuego.view.FilterImpl
         at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2032)
         at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1953)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    Regards,
    Bharath.
    Edited by: bg57295 on Mar 24, 2010 6:45 PM

    Hi Bharath,
    Believe me, you have an incompatibility between different build#.
    PAPI has an instance cache. When certain process has more instances than the maximum specified, the cache is switch to status OPEN. That means, that PAPI will not be able to resolve some instance queries using the information in the cache. When that occurs, PAPI forward all those queries to the engine.
    The incompatibility introduced is in the communication between PAPI and Engine. So, you only get the exception when you have more instances than the maximum cache size.
    Regards,
    Ariel

  • Dynamic  Instance for a MOVIE CLIP

    Hi Please help me!!!!!!!!!!
    I am creating dynamic Movie Clip using as3, but I don't have
    any idea about dynamic Instance name, please give me some idea that
    how I can assign Instance name for a movie clip.
    I am waiting your reply.
    Thanks
    Sushil Kumar

    You can assign a value to the name property of the MovieClip,
    but refering to the variable name of your MovieClip instance is
    preferable. This code illustrates the difference:

  • Giving things instance names. Flash cs4

    Ive been using adobe flash cs4 for a while now and have had little trouble giving things instance names. Now though, whenever i double click on something like i normally do to give it an instance name, the blue box no longer comes around it, i click on properties, and change the instance name. I now get a dashed line along the lines of the picture. and when i go to properties, it just says shape, and I cant edit the instance name. Just position and size, then the fill and stroke.  What is going on?

    You do not assign instance names to objects in the library.  Instance names are assigned to object on the stage.  Instance names are unique for each item on the stage.... meaning the same library object can be used multiple times... each instance of it will have a different name.  If you want to assign a name you do it either by manually entering it in the properties panel or thru actionscript code when the object is added to the movie.

Maybe you are looking for

  • Cannot install software

    i'm trying to install the ipod nano software onto my imac and after i put the hard drive as the location the boxes for the software come up gray and i am unable to install them. i have tried the cd on a powerbook and did not have that problem. also t

  • Spatial view

    Hi. I'm using Oracle 8.1.7 with MapInfo 6.0 Is it possible to create a view on a spatial table and see it a spatial table to open the view in MapInfo ? I try it by cerate a view (CREATE VIEW sql statement) and insert a line in the user_sdo_geo_metada

  • Where do it get the photoshop cS6 serial

    Hy, Im new to Adobe Creative Cloud and i just made my first payment. Now I downloaded Photoshop cs6 and when Im trying to install it, the system asks for a serial number. Where do I download it? Thanks in advanced Andres

  • Monitoring UCCE by SCOM

    Hello All, Our customer has a UCCE version 8.5. And asked me if the Microsoft SCOM is supported in order to do monitoring/alerting. If yes, exist Management Pack SNMP traps for SCOM? Many thanks for your answer. -marcel

  • About mx:states top left bottom right border

    Hello, I have question maybe somebody can help me. I want to use states in my application by i have discoveder one disadvantage. Using states it comes with some value of left, right, bottom, top. So i cant find our how to place states which fits 100%