Best approach to add Task interaction processes using BeanShell in ExcecuteScript operation

I am wondering if the following is the best way (thinking not) to accomplish the goal of determining the possible routes from a Task (Task ID is known) using BeanShell in the ExecuteScript operation in a short-lived LC process (taken from API docs and tweaked slightly).  The code does work, this is just a question of what would be optimal to build similar processes that can reach into more details.  I would like to know the best practice before building more such processes.
import java.util.*;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.idp.taskmanager.dsc.client.query.TaskRow;
import com.adobe.idp.taskmanager.dsc.client.query.TaskSearchFilter;
import com.adobe.idp.taskmanager.dsc.client.task.ParticipantInfo;
import com.adobe.idp.taskmanager.dsc.client.task.TaskInfo;
import com.adobe.idp.taskmanager.dsc.client.task.TaskManager;
import com.adobe.idp.taskmanager.dsc.client.*;
import com.adobe.idp.um.api.infomodel.Principal;
import com.adobe.livecycle.usermanager.client.DirectoryManagerServiceClient;
import java.util.List;
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://servername:1099");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceC lientFactoryProperties.DSC_EJB_PROTOCOL);         
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);
TaskManager taskManager = TaskManagerClientFactory.getTaskManager(myFactory);
long taskId = patExecContext.getProcessDataLongValue("/process_data/@taskId");
TaskInfo taskInfo= taskManager.getTaskInfo(taskId);
String [] routeNames = taskInfo.getRouteList();
List routeNameList = patExecContext.getProcessDataListValue("/process_data/routes");
for (int i=0; i<routeNames.length; i++) {
    String currentRouteName=(String)routeNames[i];
    routeNameList.add(currentRouteName);
patExecContext.setProcessDataListValue("/process_data/routes",routeNameList);

I am wondering if the following is the best way (thinking not) to accomplish the goal of determining the possible routes from a Task (Task ID is known) using BeanShell in the ExecuteScript operation in a short-lived LC process (taken from API docs and tweaked slightly).  The code does work, this is just a question of what would be optimal to build similar processes that can reach into more details.  I would like to know the best practice before building more such processes.
import java.util.*;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.idp.taskmanager.dsc.client.query.TaskRow;
import com.adobe.idp.taskmanager.dsc.client.query.TaskSearchFilter;
import com.adobe.idp.taskmanager.dsc.client.task.ParticipantInfo;
import com.adobe.idp.taskmanager.dsc.client.task.TaskInfo;
import com.adobe.idp.taskmanager.dsc.client.task.TaskManager;
import com.adobe.idp.taskmanager.dsc.client.*;
import com.adobe.idp.um.api.infomodel.Principal;
import com.adobe.livecycle.usermanager.client.DirectoryManagerServiceClient;
import java.util.List;
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://servername:1099");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceC lientFactoryProperties.DSC_EJB_PROTOCOL);         
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);
TaskManager taskManager = TaskManagerClientFactory.getTaskManager(myFactory);
long taskId = patExecContext.getProcessDataLongValue("/process_data/@taskId");
TaskInfo taskInfo= taskManager.getTaskInfo(taskId);
String [] routeNames = taskInfo.getRouteList();
List routeNameList = patExecContext.getProcessDataListValue("/process_data/routes");
for (int i=0; i<routeNames.length; i++) {
    String currentRouteName=(String)routeNames[i];
    routeNameList.add(currentRouteName);
patExecContext.setProcessDataListValue("/process_data/routes",routeNameList);

Similar Messages

  • Human interaction process using BPM

    Hi Experts,
    Is it possible to create Human interaction process using BPM?
    Regards
    Sara

    An insurance analyst has access only access to the backend, not to XI. So send the message to the backend, start a workflow here and send a message back.
    You can use ABAP proxy to implement this.
    In PI 7.1 there will be human interaction in BPM, but this requires a user in the PI system and is useful only for administrators, as there are no application data in PI which enables the user to decide, whether he should approve or reject the request.
    In PI 3.0/7.0 there is no user interaction in BPM.
    Regards
    Stefan

  • Best approach to add Z custom field to IC Agent Inbox search and results view

    Hi Experts,
    We are having a requirement to add a Z custom field to IC Agent Inbox search and results view. I got multiple forums and ideas, but looking for the best approach for handling this. I am sure, you experts, would have already done this.
    Thanks in advance.
    Regards
    Siva

    Hi Sivakumar,
    AET is the best way by far to create a custom field in this area. It is easy and simple.
    Also, field once added in one business object it can be used at different objects as well.
    There is also a demo available for AET on sdn.
    Please let me know if any more help is required.
    Thanks,
    Bhushan

  • What is the best approach to add new fieds to an extractor

    I am working with an infocube wher i need to get the day of the week based off the created on date.  I need the number like 1-7 and then tie this to another table to get the actual name like Monday, Tuesday.  Etc. 
    I was planning on creating an update rule which would find the day of the week and the name of the day.  I am not sure the best approqch as far as loading the data and the inforobject.  Should i load the text 1 time becaue that will never change, like Monday etc. or do Ioad it in the start routine?    also do I create 1 infoobject with text or do I create 2 separate one?

    You can create a new infoobject with text and manually create 7 records.
    In update rules ou can use function module DATE_COMPUTE_DAY or DAY_IN_WEEK to get the numeric value of the day of the week.
    Hope it helps.
    Regards

  • Best approach to report on ports in use during the month

    I have been asked to come up with a report once a month outlining the network devices ports that are in use per cust
    omer location.
    I see the report device manager but it doesnt appear to give the simple number of ports in use by the device during the past 24 hours.
    Any thoughts or ideas would be great. It appears our customer doesnt want to pay for installed ports, just ports that are used during the month.
    Thanks,

    Hi Peter,
    You don't say what type of reporting that you want to do? I'm assuming that it is probably something like displaying the last 1000 most recently approved forms or similar?
    If that's the case then you may be able to achieve what you need using the Search Core Results Web Part with some clever querying and is likely to be the most performant method.
    Once you have a result set back, you can then look at styling this using XSLT in the SCRWP or alternatively look at using the Search Query Model from code in a farm solution/webpart.
    Alternatively you could look at using SSIS to extract the data using the SharePoint List into a SQL table on a nightly basis. (This article covers how to get data out of SharePoint and into SSIS..
    http://msdn.microsoft.com/en-us/library/hh368261.aspx)
    Regards
    Paul.
    Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and helps prevent the same questions being asked multiple times.

  • What's the best approach to migrate to Snow Leopard using the time machine?

    I have a time capsule, and have noticed the restore from backup option once I had to replace the HD on my MacBook Pro.
    I am about to buy a new MacBook Pro which will probably ship with Snow Leopard, and am wandering, if when I setup the new OS I can restore from a backup of my old system?
    Thanks
    Miguel

    don't use the full system restore from backup option with a new computer. that can only be used on the same exact computer. also, that option erases the destination drive and replaces it with the copy of the backed up system. this is not what you want.
    when you first turn on the new computer you'll get a setup assistant which will give you an option to Migrate your user data and applications from a TM backup. you can also do it later using Migration Assistant located in Applications/Utilities.

  • Best approach to add MVs in OBIEE

    Hi Gurus,
    Is there a best practice in adding Materialized Views in rpd.
    Rgds,
    Amit

    Hi,
    Look at this...its about MV... http://gerardnico.com/wiki/database/oracle/materialized_view?s[]=materialized&s[]=views
    Thanks,
    Srikanth

  • Regd. use of enterprise services : Best approach

    Hi Experts,
    I have configured a scenario using standard enterprise services,used soamanager of ABAP and tested the services,it works perfectly.
    But the issue came with terms of security ,it seems we cannot expose our sap system as url for the services.
    need to use PI to connect to the third party...I need suggestions on following
    1. Can we connect ABAP of PI to ABAP of SAP ,with some configuration , i dont want to create any additional
        structures is PI apart from the one which i imported.
    2.If i set up a soap to proxy(ABAP) then i need to duplicate the structure for source and use the standard ES
       service at proxy receiver, but i want to avoid duplication as it is cumbersome to do for all services.
    3.If i create communication /service user i need to give access for some of sap tables  to support the service functionalities.
    what is the best approach for exposing services from PI using standard enterprise service.
    Any pointer will be appreciated.
    Regards,
    Srinivas
    Edited by: Srinivas on Jul 7, 2010 7:29 PM

    Hi
    Following is answer of your question:
    >(1)How can I search relevant Enterprise services in PI for the SAP R/3 BAPI.
    There is no way to look for enterprise service for BAPI, ES are harmonized services based on GDT whereas BAPI is more SAP oriented in datatype definitions, only way is to find out is look into code as many ES are calling BAPI internally. Best way to identify correct ES is business use (like Purchase Order Creation etc)
    >(2)If relevant ES is available then what are the steps to be performed?
    It depends how you want to use this ES, you can call this ES from outside world (read thirdparty tools, application) and these services can be used as ready-to-use building block for new applications. You must know URL of wsdl and security setting (user/password) to use it with any application. You can call it from ABAP, .Net, Java applications. You can test ES with any SOAP testing tool like WSNavigator or SOAP UI.
    >(3)If relevant ES is not availabe then what are the steps to be performed?
    You have few options if ES is not available, design of your own by following proper governance model (i.e. PIC process) or you can live with existing BAPI, RFC and convert them into Web Service using webservice wizard available in SE80 and SE37.
    Regards,
    Gourav

  • Best approach to integrate BizTalk - JDE EnterpriseOne

    Hi All,
    Need guidance on following:
    Scenario:
    1. Outbound: Get data from JDE EnterpriseOne into BizTalk  
    2. Inbound : Send data into JDE EnterpriseOne from BizTalk  
    So after going through MSDN articles I see that we can go with either of approach,
    1. JDE EnterpriseOne exposing the business function as services(BSSV) which would push data in BizTalk and  same way from BizTalk to JDE EnterpriseOne.
    2. JDE EnterpriseOne creates files at file system and BizTalk reads the directory and for sending BizTalk JDE adapter to be used.
    Which one is the best approach(I understand both can be used) and what are pros and cons of the approaches (like performance, configuration, coupling etc.)

    You can go ahead with consuming the web service exposed by the JDE EnterpriseOne .This will be better solution as it can be used in future needs as a endpoint .
    Thanks
    Abhishek

  • Human interaction process installation

    Hi Experts,
    I have to do one human interaction process using Guided procedure. Actually, we have installed Netweaver 2004s. Could you please tell me what all needs to be done(installation/configuration) for CAF and Guided Procedure.
    Regards
    Sara

    Hello Sara,
      if u have NW04s sr1 CAF and gp should already be part of the installation. u can di a quick test by launching the url http://server:port/caf
    abdul

  • Best approach to creating a TOC for product catalog using data merge

    What is the best approach for creating a TOC for a product catalog (over 1,000 items) using Data Merge?
    The TOC would contain the product Categories. 
    So for example, Category A items could go from pages 1 - 3, and Category B items would start at pg 4, but if new items were added to Category A, then Category B may start from pg 6. 
    From the Data Source, there are 5 Data Fields I've chosen to be displayed.  If this were a regular digital print document, I could use the Paragraph Style method for creating a TOC, but if I make any one of the Data Fields a certain Paragraph Style and use that for the TOC, it'll populate the TOC with that Data Field for all the items. 
    Any suggestions?

    Peter Spier wrote:
    TOC is not interactive in the ID file, though it can be in a PDF that you export (there's a checkbox to create PDF bookmarks). You might want to think about using Cross-references (rather than hyperlinks, I think) to build the TOC. You have to do it manually, but once done it should maintain itself, whereas a TOC is built automatically, but must be regenerated after you edit the doc.
    One caveat witih TOCs created from cross-references: Although changing the text of an x-ref source paragraph (for example from "Patatas and tamatas" to "Tomatoes and Potatoes,"and/or when the source paragraph flows to the next or previous page) update automatically or when invoking "Update cross-references," MOVING a cross-reference source paragraph to a location before or after another source paragraph, does not change their sequence in the pseudo-TOC. You'll need to manually move the reference in the pseudo-TOC to the correct position in the sequence of cross-refs. So, put the task of checking the order of x-refs in the pseudo-TOC on your before hand-off check list.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Best approach for uploading document using custom web part-Client OM or REST API

    Hi,
     Am using my custom upload Visual web part for uploading documents in my document library with a lot of metadata.
    This columns contain single line of text, dropdownlist, lookup columns and managed metadata columns[taxonomy] also.
    so, would like to know which is the best approach for uploading.
    curretnly I am  trying to use the traditional SSOM, server oject model.Would like to know which is the best approach for uploading files into doclibs.
    I am having hundreds of sub sites with 30+ doc libs within those sub sites. Currently  its taking few minutes to upload the  files in my dev env. am just wondering, what would happen if  the no of subsites reaches hundred!
    am looking from the performance perspective.
    my thought process is :
    1) Implement Client OM
    2) REST API
    Has anyone tried these approaches before, and which approach provides better  performance.
    if anyone has sample source code or links, pls provide the same 
    and if there any restrictions on the size of the file  uploaded?
    any suggestions are appreciated!

    Try below:
    http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx
    http://stackoverflow.com/questions/9847935/upload-a-document-to-a-sharepoint-list-from-client-side-object-model
    http://www.codeproject.com/Articles/103503/How-to-upload-download-a-document-in-SharePoint
    public void UploadDocument(string siteURL, string documentListName,
    string documentListURL, string documentName,
    byte[] documentStream)
    using (ClientContext clientContext = new ClientContext(siteURL))
    //Get Document List
    List documentsList = clientContext.Web.Lists.GetByTitle(documentListName);
    var fileCreationInformation = new FileCreationInformation();
    //Assign to content byte[] i.e. documentStream
    fileCreationInformation.Content = documentStream;
    //Allow owerwrite of document
    fileCreationInformation.Overwrite = true;
    //Upload URL
    fileCreationInformation.Url = siteURL + documentListURL + documentName;
    Microsoft.SharePoint.Client.File uploadFile = documentsList.RootFolder.Files.Add(
    fileCreationInformation);
    //Update the metadata for a field having name "DocType"
    uploadFile.ListItemAllFields["DocType"] = "Favourites";
    uploadFile.ListItemAllFields.Update();
    clientContext.ExecuteQuery();
    If this helped you resolve your issue, please mark it Answered

  • Best approach to posting to FB60:  Use BAPI_ACC_DOCUMENT_POST or BDC?

    Good day, everyone.
    I need to develop an ABAP processing program to read an inbound file of non-PO-related invoices and post them to t-code FB60.  I've spent the past day doing a lot of researching, and it looks like the two most mentioned methods I've found are using a BAPI (BAPI_ACC_DOCUMENT_POST) or just using BDC.
    I've only just become familiar with t-code FB60 and posting very simple, straight-forward invoices (just data on the "Basic Data" tab along with the G/L info line(s) below; we might have to zero out the withholding tax on the "Withholding tax" tab, but not sure yet).  At this point, it's not expected that the types of invoices we'll be posting will be more complex than this.  Obviously, I'll be creating a report indicating any invoices that failed to post.
    I'm trying to determine which route would be the best way to go.  Would you use the BAPI or the BDC approach?  Why that approach over the other one?
    Thank you!
    Dave

    In continuing my research, I've just learned that FB60 is an "Enjoy" transaction, and apparently it isn't advisable to use BDC in a batch approach with any "Enjoy" transaction.  Alternatives appear to be to use a BAPI or write BDC against an older (classical) version of FB60.  I'll look into these possibilities.

  • Best approach to develop office add-in

    Hello,
    i'm a .net programmer and i've developed addins for outlook/ word and excel with VS 2008 + .net 3.5 + VSTO.
    There were many problem initially with the VSTO addin and i faced lot of difficulties to solve them specially when working with both Outlook and Word.
    My client has Adobe Acrobat installed on every machine and no doubt the performance of Acrobat addin in office application is superb. On the other hand VSTO addins take time to load and the performance is specially low when tehre is a interaction between VB6 and MS Office application.
    Many times the Outlook addin gets disabled if outlook is not running and VB6 code creates new mail item to send and display it to user. Many times mail window freezes and many such problems.
    Now the question i've here is can anyone tell me the best approach to develop Office addin like how and in what language Acrobat addin is developed? or best practice to develop it with VSTO and which is best with a why?
    Thanks,
    Hemant

    Hi,
    In many cases, if your structure is very complex, you can not get direct nested xml after content conversion. In that case, in the mapping we need to handle the generation of nested strutcure. So you use Java or xslt mapping etc.. if it is not possible via graphical mapping. Also you can do this in the adapter module.
    Here you go with good example- Generic Structure-
    /people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter
    Also file content conversion - limitations-
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652b710
    Rgds,
    Moorthy

  • What is the best approach to process data on row by row basis ?

    Hi Gurus,
    I need to code stored proc to process sales_orders into Invoices. I
    think that I must do row by row operation, but if possible I don't want
    to use cursor. The algorithm is below :
    for all sales_orders with status = "open"
    check for credit limit
    if over credit limit -> insert row log_table; process next order
    check for overdue
    if there is overdue invoice -> insert row to log_table; process
    next order
    check all order_items for stock availability
    if there is item that has not enough stock -> insert row to
    log_table; process next order
    if all check above are passed:
    create Invoice (header + details)
    end_for
    What is the best approach to process data on row by row basis like
    above ?
    Thank you for your help,
    xtanto

    Processing data row by row is not the fastest method out there. You'll be sending much more SQL statements towards the database than needed. The advice is to use SQL, and if not possible or too complex, use PL/SQL with bulk processing.
    In this case a SQL only solution is possible.
    The example below is oversimplified, but it shows the idea:
    SQL> create table sales_orders
      2  as
      3  select 1 no, 'O' status, 'Y' ind_over_credit_limit, 'N' ind_overdue, 'N' ind_stock_not_available from dual union all
      4  select 2, 'O', 'N', 'N', 'N' from dual union all
      5  select 3, 'O', 'N', 'Y', 'Y' from dual union all
      6  select 4, 'O', 'N', 'Y', 'N' from dual union all
      7  select 5, 'O', 'N', 'N', 'Y' from dual
      8  /
    Tabel is aangemaakt.
    SQL> create table log_table
      2  ( sales_order_no number
      3  , message        varchar2(100)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> create table invoices
      2  ( sales_order_no number
      3  )
      4  /
    Tabel is aangemaakt.
    SQL> select * from sales_orders
      2  /
            NO STATUS IND_OVER_CREDIT_LIMIT IND_OVERDUE IND_STOCK_NOT_AVAILABLE
             1 O      Y                     N           N
             2 O      N                     N           N
             3 O      N                     Y           Y
             4 O      N                     Y           N
             5 O      N                     N           Y
    5 rijen zijn geselecteerd.
    SQL> insert
      2    when ind_over_credit_limit = 'Y' then
      3         into log_table (sales_order_no,message) values (no,'Over credit limit')
      4    when ind_overdue = 'Y' and ind_over_credit_limit = 'N' then
      5         into log_table (sales_order_no,message) values (no,'Overdue')
      6    when ind_stock_not_available = 'Y' and ind_overdue = 'N' and ind_over_credit_limit = 'N' then
      7         into log_table (sales_order_no,message) values (no,'Stock not available')
      8    else
      9         into invoices (sales_order_no) values (no)
    10  select * from sales_orders where status = 'O'
    11  /
    5 rijen zijn aangemaakt.
    SQL> select * from invoices
      2  /
    SALES_ORDER_NO
                 2
    1 rij is geselecteerd.
    SQL> select * from log_table
      2  /
    SALES_ORDER_NO MESSAGE
                 1 Over credit limit
                 3 Overdue
                 4 Overdue
                 5 Stock not available
    4 rijen zijn geselecteerd.Hope this helps.
    Regards,
    Rob.

Maybe you are looking for