首页 \ 问答 \ 使用Java类在PeopleCode中调用多个CI(Invoking Multiple CI's within PeopleCode using Java Classes)

使用Java类在PeopleCode中调用多个CI(Invoking Multiple CI's within PeopleCode using Java Classes)

我正在尝试在PeopleSoft中上传一些数据并通过Application Engine将其提取到公开的CI。

每行数据的Instantiation / GetKeys / Save / Cancel需要花费大量时间。 最接近的方法是对数据进行分块并运行并行进程。 通常,我们可以同时运行的进程数量有限制。 例如:如果限制为5,则意味着我们可以将整个过程(每行上传5次)完成。

即新处理时间=旧处理时间/ 5;

不幸的是,我可以做到这一点,这不是用户想要的。

他们希望它的速度非常快。 我希望在PeopleCode中使用一些Java类,看看我们是否可以创建多个线程来暴露每个线程的CI。 比如说,如果我们可以同时运行100个线程,那会更快。 是否有任何人对如何合并某些Java并利用多线程的功能有一些建议。

感谢您提前的时间!


I am trying to upload some data in PeopleSoft and fetching it to the exposed CI through Application Engine.

The Instantiation/GetKeys/Save/Cancel for each row of data takes a lot of time. The closest way to do it is to chunk the data and run parallel processes. Usually there is a limit on the number of processes that we can run at the same time. For example: If the limit is 5, it means we can make the entire process, for uploading each row, by 5 times.

i.e. New Processing Time = Old Processing Time/5;

I can do that, unfortunately, that is not what the users want.

They want it to be blazingly fast. I was hoping to use some Java classes within PeopleCode and see if we can create multiple threads exposing CI per thread. Say, what if we can have 100 threads running at the same time, which could be lot more faster. Does any one has some suggestions on how to incorporate some Java and leverage the features of multithreading.

Thanks for your time in advance!


原文:https://stackoverflow.com/questions/21997264
更新时间:2022-05-03 11:05

最满意答案

如果我理解正确的话,你是在问如何把最后一行作为第一行,并将其余的按下。 这应该这样做:

<table id="mytable">
...
</table>

<script type="text/javascript">
    var tbl = document.getElementById('mytable');
    var rows = tbl.getElementsByTagName('tr');
    var firstRow = rows[0];
    var lastRow = rows[rows.length];
    firstRow.parentNode.insertBefore(lastRow.parentNode.removeChild(lastRow), firstRow);
</script>

假设你的表没有嵌套表。 在这一点上,这需要更聪明一些。 这也假设你没有使用TBODY和THEAD节点。 但我相信你可以从那里得到想法并加以改进。


The best way to solve this in Javascript is:

Give the Tr.. a unique name. for eg: X_Y,X_Z,A_Y,A_Z

Now add a hidden lable or text Box which gives the sorting order from the server i.e When the page renders I want to sort it All the Tr's that have a ID starting with A should come first and All the Z's should come second.

<asp:label id="lblFirstSortOrder" runat="server" style="display:none;">A,X</label>
<asp:label id="lblSecondSortOrder" runat="server" style="display:none;">Z,Y</label>

When the page renders..the order should be A_Z,A_Y,X_Z,X_Y

Before Rendering this is table that comes from the aspx file:

<table>
<tr id='Tr_Heading'>
  <td>A</td>
  <td>B</td>
</tr>
<tr id="Tr_X_Y">
  <td>GH</td>
  <td>GH1</td>
</tr>
<tr id="tr_X_Z">
  <td>HU</td>
  <td>HU1</td>
</tr>
<tr id="tr_A_Z">
  <td>JI</td>
  <td>JI1</td>
</tr>
<tr id="tr_A_Y">
  <td>JI</td>
  <td>JI1</td>
</tr>

Script:

function SortAndArrange()
{
var firstList = document.getElementById('lblFirstSortOrder').value;
var secondList = document.getElementById('lblSecondSortOrder').value;
var firstTypes = new Array();
firstTypes = firstList.split(',');
var secondLists = new Array();
secondLists = secondList.split(',');
var refNode = document.getElementById('Tbl_' + firstTypes[0] + "_" + secondTypes[0]);
for (var i = 0; i<firstTypes.length; i++)
{
  for (var j = 0; j< secondTypes.length;j++)
  {
     var TrName = 'Tbl_'+firstTypes[i]+'_'+secondTypes[j];
     var FirstSecondTrs = document.getElementById(TrName);
     if (FirstSecondTrs)
     {
       FirstSecondTrs.parentNode.removeChild(FirstSecondTrs);        
       insertAfter(refNode,FirstSecondTrs);
       refNode = FirstSecondTrs;
     }
  }
 }
}
function insertAfter( referenceNode, newNode )
{   
 referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );
}

I hope you guys get the idea.. for me the sorting order will always come from the server and not from the user of the page...

Thanks a Lot for all the answers.. Apprecite it. Helped me get to this solution.

Thanks, Ben

相关问答

更多
  • 这是转动df的情况。 尝试这样的事情: df.pivot(index='stime', columns='sensors', values='slevel') 有关详细信息,请参阅: http : //pandas.pydata.org/pandas-docs/stable/reshaping.html This is a case of pivoting the df. Try something like this: df.pivot(index='stime', columns='sensors', ...
  • 假设OP正在寻求颠倒data.frame的顺序,然后与原始data.frame交织,并且每个用户有一个偶数行,这里是一个使用data.table的解决方案 library(data.table) dt <- data.table(user="use1", Event=c("start", "start", "stop", "stop"), count=seq_len(4)) dt[, { #number of rows for this user n <- .N ...
  • 基本上,您将匹配原始字符串中的模式,提取感兴趣的片段并重新排列它们。 常用的工具是正则表达式 。 在你的例子中: var s = "Smith, John - PPP"; var r = s.replace(/^([^,]+), ?([^ ]+).*$/, "$2 $1"); r将保留替换字符串。 警告: 正则表达式是一个有用的工具。 他们不是灵丹妙药。 仔细检查您即将使用的工具是否适合手头的任务(螺丝刀也是有用的,除非您尝试使用它将钉子钉在墙上)! 特别是,在不使用更强大的工具的情况下,针对半结构化数据 ...
  • 听起来就像你需要查找splice()方法。 它允许您在任何索引处添加和删除数组中的一个到多个项目。 这里有它的参考。 https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/splice Sounds like you need to look up splice() method. It allows you to add and remove one to many items within a ...
  • 如果我理解正确的话,你是在问如何把最后一行作为第一行,并将其余的按下。 这应该这样做: ...