Using ProcessService in Automatic Activity

I want to use the ProcessService inside an Automatic Activity to search for a process instance already dealing with a contract (no 2 or more process instances are allowed to work on the same contract). The following code works perfectly:
ProcessService ps;
ps.connectTo(url : Fuego.Server.directoryURL, user : "pelo", password : "pelo");
InstanceFilter instanceFilter;
instanceFilter.create(processService : ps);
SearchScope searchScope =
    new SearchScope(ParticipantScope.ALL,StatusScope.ONLY_INPROCESS);
instanceFilter.searchScope = searchScope;
instanceFilter.addAttributeTo(variable : "caseId", comparator : Comparison.CONTAINS, value : "GN" + contractNummer);
Instance[] instances = ps.getInstancesByFilter(filter : instanceFilter);The problem here is that the connectTo method contains the user and password. Is there any other way to get a ProcessService instance differently in an automatic activity? Or is it possible to get the credentials to be used in the connectTo method?

Pelo,
To avoid burying connection credentials in source code, you might specify them as Business Parameters (under Organization). That way they can be configured at run time.
I hope this helps, but I also hope you get a better suggestion.
John

Similar Messages

  • Global Automatic Activity - Process to Process

    Hi,
    How can we invoke another process from one process using a Global automatic activity..Is PAPI the only way? How can we use PAPI code inside of a Global Automatic Activity to call another process?v Any examples?
    Edited by: user647659 on Oct 27, 2008 11:02 PM
    Edited by: user647659 on Oct 28, 2008 11:49 AM

    I am not sure what you saying..Did u mean Global Creation ? But that would have a user to invoke the process..I want to invoke it automatically...I got a part of the answer...But it takes all instances..and creates multiple instances..I want to isolate the instances previously been transferred..What I am doing is ..Using a Global Automatic to invoke the other process.Writing a PAPI code to call the other process from this process...and Polling By Interval every 1m..
    Here is a code:-
    ProcessService ps;
    ps.connectTo(url : Fuego.Server.directoryURL, user : (String)BusinessParameter.getValue(name : "USER_NAME"), password : (String)BusinessParameter.getValue(name : "PASSWORD"));
    logMessage("Process Service connected--->" );
    businessProcess = ps.getProcess(process : "StartProcess");
    InstanceFilter instanceFilter;
    instanceFilter.create(processService : ps);
    SearchScope searchScope = new SearchScope(ParticipantScope.ALL,StatusScope.INPROCESS_AND_COMPLETED);
    instanceFilter.searchScope = searchScope;
    result2 = businessProcess.getInstancesByFilter(filter : instanceFilter);
    logMessage("Length ==>" +length(result2));
    length = length(result2);
    logMessage("Length Transferred==>" +length);
    test["name"] = "testing";
    if(length > 0)
         for(int i=0; i < length; i++)
              ProcessInstance.create(arguments : test, argumentsSetName : "BeginIn");
    else
         logMessage("length is-->" + length);
    length = 0;
    Any suggestions on how to isolate the previous obtained instances would be appreciated..
    Thanks,

  • Create Process via Global Automatic activity

    Hi!
    I´m trying to automatize some process, that can auto-execute one time at a day. For this, i'm thinking of use the global automatic activity, and I 've scheduled to execute (for testing) every minute. But this never happends
    If the global has no bp.Method inside, obviusly, nothing happends. Hence, when i wrote this code:
    logMessage "Se ha iniciado el proceso de consulta de calendario a las:" +'now'
         using severity = INFO
    ProcessInstance.create(processId : "/ConsultarCalendarioCompras", arguments : null, argumentsSetName : "")
    how could i solve this?
    Thanks

    Hi,
    Are you seeing your log INFO statement in the log file every minute? Assuming you are, I think all you're missing is a valid value for the third parameter. Try changing your logic to this:
    ProcessInstance.create(processId : "/ConsultarCalendarioCompras",
         arguments : null, argumentsSetName : "BeginIn")
    . . .Once you get this working, take a look at this thread for information on how to pass in argument variables into the work item instance using the second parameter: Re: How to create Instace of another process from running process.
    Hope this helps,
    Dan

  • Trigger a Begin event running Global Automatic activity

    Hi
    I have a situation explained as follows:
    The BPM Process flow would be triggered when a message comes into a JMS Queue.
    I have configured the JMS Messaging Service as an external resource and used a Global Automatic Activity as an Automatic JMS Listener to listen on that queue.
    Once the message is received on the queue, I want my actual process flow to be instantiated and activities following the begin activity to be executed.
    In the Studio Reference document, it is mentioned that
    You can trigger a Begin event running Global Automatic activity.
    Can someone tell me the steps to trigger the Begin Event from Global Automatic Activity and create the process instance.
    Thanks

    You have to call this method
    ProcessInstance.create(arguments : args, argumentsSetName : "BeginIn")
    Args is Any[String] where you put you input arguments that you have in your begin activity and BeginIn is the set of arguments you have in the begin activity.
    HTH

  • Process creation using Global Automatic Activity - OBPM 10g

    Hi,  I would like create the process instance for my application on every 2nd business day of a month. I also have a calendar defined for checking business day.  But I am unable to figure out to how use that calendar to determine second business day of any month. Global Automatic type is set to Automatic schedule and monthy option was selected. But I believe this would trigger the process on every second day of the month, without considering the fact whether its  business day or not. There is Runs on Holidays checkbox, but not sure what it really does. If it checks for holidays then which calendar does it refers to. Hence, please let me know how can i specify a calendar or any alternate solution to trigger process creation. Thanks, Namit
    n

    I am not sure what you saying..Did u mean Global Creation ? But that would have a user to invoke the process..I want to invoke it automatically...I got a part of the answer...But it takes all instances..and creates multiple instances..I want to isolate the instances previously been transferred..What I am doing is ..Using a Global Automatic to invoke the other process.Writing a PAPI code to call the other process from this process...and Polling By Interval every 1m..
    Here is a code:-
    ProcessService ps;
    ps.connectTo(url : Fuego.Server.directoryURL, user : (String)BusinessParameter.getValue(name : "USER_NAME"), password : (String)BusinessParameter.getValue(name : "PASSWORD"));
    logMessage("Process Service connected--->" );
    businessProcess = ps.getProcess(process : "StartProcess");
    InstanceFilter instanceFilter;
    instanceFilter.create(processService : ps);
    SearchScope searchScope = new SearchScope(ParticipantScope.ALL,StatusScope.INPROCESS_AND_COMPLETED);
    instanceFilter.searchScope = searchScope;
    result2 = businessProcess.getInstancesByFilter(filter : instanceFilter);
    logMessage("Length ==>" +length(result2));
    length = length(result2);
    logMessage("Length Transferred==>" +length);
    test["name"] = "testing";
    if(length > 0)
         for(int i=0; i < length; i++)
              ProcessInstance.create(arguments : test, argumentsSetName : "BeginIn");
    else
         logMessage("length is-->" + length);
    length = 0;
    Any suggestions on how to isolate the previous obtained instances would be appreciated..
    Thanks,

  • Aborting an Automatic Activity from OBPM 10GR3 workspace

    Hi all,
    I can abort Interactive Activities from the OBPM 10GR3 workspace just by selecting that instance, the selecting the action as ABORT from the BULK ACTIONS on the right hand side and the entire instance is aborted.
    But how do I abort Automatic Activities from the OBPM 10GR3 workspace?
    When my instance arrives at an automatic activity, I am unable to abort it from the BPM workspace.
    There is no option when you right click an Automatic Activity and select RUNTIME , which says, "If enabled, the instance can be aborted by the user".
    So how do we do that ( from the OBPM 10GR3 Workspace)?

    The "If enabled, the instance can be aborted by the user" needs to be selected when you abort via PAPI...
    Since aotumatic activitys do not appear in the workspace you cannot abort them from there.
    You can connect via PAPI, find the instance and abort it from another instance.
    Even though must automatic activitys are built so they finish before you can even go and abort them.
    I think its a strange design to have an aotumatic activity that is up long enough for you to cancel it but as i said above...
    1) Select abortable on the activity.
    2) Find the instance and abort
    Fuego.Papi.InstanceFilter ifilter = new InstanceFilter();
    ProcessService.connectTo(url : Fuego.Server.directoryURL, user :<username>, password : <password>);
    ifilter.create(processService : ProcessService);
    ifilter.searchScope = new SearchScope(participantScope : ParticipantScope.ALL , statusScope : StatusScope.ONLY_INPROCESS);
    //Notice i write public variable and not instance variable
    ifilter.addAttributeTo(variable : <public variable (such as description or one of your own)>, comparator : Comparison.<the one that fits you>, value : <value>);
    Fuego.Papi.Instance[] cInstances = ProcessService.getInstancesByFilter(filter : ifilter);
    foreach (instance in cInstances)
    //Second type of filtering (checking current activity and process), you can check just the activity name if its a unique name
    if (instance.activityName == <aotumatic activity name> && instance.processId.contains(regexp : '/<process name>/'))
    instance.abort();
    I use a similer code snippet to remove Interactive activities.
    Just notice that you filter only the instances you really want to take down.

  • Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoyi

    Downloading images used to go automatically to the last folder used to save images, even when reopening Firefox. In just the past few days, possibly coinciding wih the most recent updates, the folder defaults to the 'Downloads' folder. This is most annoying. What happened? Internet Explorer 8.0 did the same thing. This was one of the reasons why I started using Firefox to download all images. I went into Tools>Options and it only lets me set another folder. I dont want to set a specific folder I want it to always go to the last folder used. So what gives?
    == This happened ==
    Every time Firefox opened
    == possibly when the most recent updates were installed, a few days ago

    Thanks jscher 2000. I guess I didn't make it clear. "It restarts with all the addons activated, and resumes with the tabs that were open before closing it." IE, it's running fine now with all the extensions activated. Everything is OK now.
    So something in the Firefox code was causing the bad behavior. It's not essential that I find out what the problem was - I'm just curious. And if anybody else has this same problem, it might be nice to have it corrected at the source.

  • Automatic Active Sync failed to Start at appropriate time

    Hellos,
    Its holiday season here. We had a FF Active Sync process that failed to start up.
    Ops noted an overheating CPU at 2am. Server was brought down.. App server stopped, Database stopped. Fan fixed and Server rebooted.. Database started Ok, App server started Ok.. according to AS Log idM started up ok... but the 'automatic' Active Sync process refused to start.
    What could prevent it?!
    I have seen various people's opinions.. e.g.
    "Hi,
    There can be lot of reasons , for not starting activesync.
    if you are using activesync between SIM and database ,
    then lets start from activesync wizard ,
    1)check the i/p activesync form(version should be correct)
    2)check the startup type
    3) if you are using query based activesync
    check the first and last predicate fields and you need to ensure that the logic you have used in i/p activesync form will generate some processing once you start active sync otherwise you will not see active sync in executing state.
    you can check weather activesync has performed operation or not in IAPI in the debug page under configurator
    if your CPU utilisation on server is very high activesync will not start
    these are general things
    if you can give some more specific details abt your application and problem i can help you out.
    Warm Regards,
    Gajanan"
    This process had been left unstarted for some time. Noone checked.. why should they.. its automatic (obviously IdM isnt an R.E.M. fan)
    Surely an automatic start type should (re)start after a reboot for hardware reasons!
    Is the only thing we can we put in a Solaris shell script to test that these ****ing active sync process have been started and are running after a reboot/restart of App.server is a date test of the log file? i.e. if log file has not been touched in x days raise an alarm... seems something that is better built into IdM than a script.
    How has this problem been faced and met by others out there? I am sure we are not the only people who have had to shutdown and restart IdM.

    Indeed it does. The problem is that a log is just that.. a log of what has happened. In our case the 'automatic' AS process failed to start automatically.
    We are forced to use the log and reverse apriori reasoning to detect whether the AS process actually started.
    I hope you agree this situation isnt really satisfactory, is it?

  • Automatic Activation in cons

    Hi,
    I know that when I activate my activity the changes from dev inactive get integrated with dev active. And after I release the activity and import into cons it is available both in cons inactive and cons active. This activation in cons is not clear to me. Is there any automatic activation in cons?
    As far as I know developers work in dev workspace and cons is not touched? Why do we have inactive/active workspace in cons?
    Any inputs here would be useful to me.
    Thanks & Regards,
    Akshatha

    Hi,
    Consolidation system link might be helpful to you.
    Ashu

  • Transfer value from global automatic activity in Aqualogic BPM Suite

    Hi, I am new to Aqualogic BMP suite and stuck with the following problem :
    In aqualogic bpm suite, if we are setting some values to some variables in a global automatic activity in a process how to get those values back in some other activities (say an Interactive activity) in the same process or how to assign the values to some instance variables in the Begin activity ??
    We have a scenario where we are creating some process instances from the Global Automatic activity using the following :
    args["name"] = abc
    create ProcessInstance using parameters = args
    Now how to get the value "abc" and assign this value to an instance variable in the Begin activity(/access the value "abc" in an interactive activity)within the same process.
    Thanks,
    Suman.

    Hi,
    Let's say you have an Argument Set defined in your Begin activity called BeginIn. The arguments in this Argument Set can be "a", "b" and "c" of type String, Int and boolean accordingly.
    If you want to use the ProcessInstance.create method, then you would need to have a PBL script like this one:
    args[] = [ "a" : "SomeStringLiteral", "b" : 1234, "c" : true ];
    ProcessInstance.create(processId : "/MyProcess", arguments : args, argumentsSetName : "BeginIn");
    HTH,
    eduardoc.

  • A few process instances in automatic activity  simultaneously

    Hi
    I am creating and initiating new process instance using Global Creation activity. I have put screenflow in Global Creation. An instance after completing the screenflow in Global Creation activity goes to BeginIn of the process. When I test it many times I get only  from time to time warning:
    Instance '/BackgroundUpdate#Default-1.0/157/0@xxx' is not in activity '/BackgroundUpdate#Default-1.0/doUpdate'.
    Details: Instance is in activity '/BackgroundUpdate#Default-1.0/WaitToProcessNextPackage' and has status 'RUNNING (1)'.
    "doUpdate" and "WaitToProcessNextPackage" are activities (automatic components) placed after Begin in the process ("doUpdate" is subsequent for BeginIn and "WaitToProcessNextPackage" is subsequent to "doUpdate" activity). When I get this warning no logic is executed for the process instance in "doUpdate" activity.
    How to solve it? Only one process instance created with Global Creation activity can be in one automatic activity? If there two process instances simultaneously in automatic activity, then one them won't be processed?
    Thank you in advance
    Regards
    Peter
    Edited by: Piotr85 on Apr 21, 2010 6:03 AM

    what does they means by service thing here,,,,and how do we specify it? or use it?
    Any application running in Oracle RAC clusterware is considered as a service. What is a service in the windows,its kinda same. If its a part of RAC and an application and running,its service.
    Read from here about services,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/mgmt_db.htm#sthref2266
    If you don't know RAC yet, better is to leave it.Its the core of RAC if you ask me.
    does resource_consumer_grp and Service name parameter in job class definition are mutual exclusive?or not
    Did you check in the docs for the same?
    HTH
    Aman....

  • Invoke subflow from method implementation of automatic activity

    Hi,
    I am able to invoke a process from automatic activity (Process Creation), but if I want to invoke it as a subflow i.e. (calling process wait for sub flow to return and the sub flow send back the result to the calling process), how can I do that. If any body has done that please let me know the steps. Actually my requirement is to call a process as subflow from screenflow automatic activity.
    If this is not possible can I call a procedure from screenflow automatic activity.
    Regards,
    Ketan

    Hi Ketan,
    If you're forced to use PBL to create an instance in another process from an Automatic task inside a screenflow and then have the child spawned synch back with the parent process, here's an approach you could take.
    1) Downstream in the parent process add Notification Wait activity where you want the child subprocess to return to the parent when it completes. You'll need to define the argument variables in this activity that you want mapped back.
    2) In your child process, add an automatic activity as the last step in your process. Inside this Automatic activity, have it send a notification via PBL to the corresponding Notification Wait activity in the parent process and have it pass the argument variables you want returned to the parent process.
    Hope this helps,
    Dan

  • Bought iPhone 4S as Christmas gift, but got email saying it will be automatically activated now

    I bought an iPhone 4S on my AT&T account as an upgrade on one of the lines. It is a Christmas gift. I don't want to activate it until Christmas so the recipient's current iPhone will continue to work. It is my understanding that their current iPhone won't work once the new once is activated. I got an email last night from the "iTunes Store" saying that if I don't activate the phone within the next 5 days, "we will automatically complete your activation." The email goes on to say "this has the potential to disrupt your existing phone service." How can I stop this automatic activation (and deactivation of the current iPhone) from taking place?

    Iphone4user5.01ios wrote:
    Well first of all you dont need a sim card to use any apple product. The only thing you need to do is activate it and create a apple id. But if you want you can give me your email and i can email you instructions since i am a iphone expert/specialist and own .2% of the company because of my stocks.
    It's very, very hard to use a GSM phone without a SIM. In fact, it's impossible. This does not lend much credence to your claims to expert status.

  • Invoke process from method implementation of automatic activity

    Hi,
    I want to invoke a business process from automatic activity of another business process deployed on same engine and in same project as well. Please provide steps, if possible for the same.
    Thanks in advance.

    Hi Ketan,
    Here's how you can create an instance in a process using logic in an Automatic activity's method. This uses the "Fuego.Lib.ProcessInstance.create()" method shown below inside a process:
    // "args" is an associative string array (Any[String])
    argsIn as Any[String]
    // this assumes that the Begin activity has two argument variables
    //   named "nameArg" and "amountArg" and you're setting them
    //   to the variables "name" and "amount" respectively
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    // logic here to determine the name of the process to create an instance in
    idOfProcess as String
    idOfProcess = <hard coded string that has the id (not the name of the process to instantiate>
    ProcessInstance.create(processId : "/" + idOfProcess, arguments : argsIn, argumentsSetName : "BeginIn") ProcessInstance is in the Catalog inside Fuego.Lib.
    The processId parameter (the "idOfProcess" variable in the above logic) is the thing I most commonly screw up with this. It is the text you see when you right mouse click the process in the Project Navigator tab -> "Properties". Look at the value in the "Id" field and not the "Name" field here (the name without any space characters). Prefix it with a "/" as is shown here and if you've deployed this using an organization unit (OU) then prefix this to the string also.
    The third parameter is almost always "BeginIn". Begin activities in a process can have many incoming argument mappings, the default is "BeginIn". To see yours, double click the process's Begin activity and look at the mapping's name in the upper left corner of the dialog.
    "argsIn" is the set of incoming argument variables you want passed into the process. A common mistake is to type in the names of the incoming argument variables without the double quotes like this:
    // this will *NOT* work
    argsIn[someArgVarName] = "Hello"
    argsIn[someBpmObject] = myBpmObject
    . . .Here is the correct syntax:
    // this *WILL* work
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    . . .In this example, the process has two argument variables. It does not matter if the incoming argument variables are primitive type arguments (e.g. String, Integer, Decimal...) or BPM Objects, it is always done the same way. In this example, there is a String incoming argument called "someArgVarName" and a BPM Object incoming argument called "someBpmObject".
    Hope this helps,
    Dan

  • Configure how long a automatic activity  can run before timeout

    I have a long running job in this step. Can I configure how long that automatic activity can run before it will time out. How do I configure this when running in the BPM Studio and when deploy the apps to the server?
    Alternatively, I was try to use a SecureShell to run a unix job with nohup but somehow it doesn't execute properly and the shell would exit out but the script would not run. When I run the same nohup command line in the external host, it does run properly. Is there any special way to call nohup through SecureShell.
    Thanks,
    Wing

    You can define the timeout of the BP-Methods that is actually the value that should be used for the method in your automatic activities. This is configured into the Engine preferences and it's the Maximum BP-Methods+ Timeout parameter, both for the studio and the enterprise.
    Remember to handle the timeout exception when using this parameter. If not correctly handled, your process will abort.
    HTH
    Giuliano

Maybe you are looking for

  • Windows Media Center

    I have a Pavilion p6724y PC with Windows 7 Home Premium 64Bit Service Pack 1 and I'm trying to view tv on my pc. The product code is QP720AA#ABA. When I go to the tv options internet tv is not listed. What do I need to watch tv on my pc????

  • Can I move photos?

    I have an Apple desktop with OS X Lion.  I was able to save my photos from my old Windows machine, and they are now in iPhoto.  Will I be able to move those photos from iPhoto to Photoshop Elements Editor (which I am ordering from the Apple App store

  • HT1918 request billing info by itune when I want to download a free application

    I have an apple ID with choosing None for billing information when I was created about 2 years ago. from last week when I wanted to download a free applicatin by itune from App store, a message was appeared that said " You must verify your payment in

  • Donated Assets

    Hi We often get assets donated to us I'm wondering how others capture the entry in SAP? DR Asset    CR  ????? Is there a t.code for the entry? Thanks alot JUlian

  • 30EA2 - UNIT TESTING - Dynamic Value Query truncating time from dates.

    So i've been using the SQL Developer Unit Testing facility (very nice by the by) for a bit now and just recently upgraded to the latest beta release (3.0.02.83). It looks like a bug was introduced whereby the dynamic value queries are truncating all