on 10-27-2014 4:54 PM
Hi Everyone,
CPS build version M33.104.
Our BW process chains end up in console state and we are planning to reply all operator messages by the end of day.
I using the following snippet to get all the reply expressions, and then set it to error.
//Set process chain to Error in the operator message reply);
jcsOut.println(op.getReplyExpression());
String[] ar = op.getReplyExpression().split("\\|");
jcsOut.println("");
for(int i=0;i<ar.length;i++)
{
if(ar[i].contains("SetError"))
{
op.setReply(ar[0].replace("^", "").replace("\\", ""));
jcsOut.println(op.getReply());
jcsSession.persist();
jcsOut.println("Replied");
}
}
but it doesn't work. Event though i'm getting all the reply expressions, it doesn't return all.
The below is the output for the line 2 in above snippet, while the actual operator message had at least 8 replies.
BW_H_BI_BW_ZMC_OPS_TD_EWM_ACQ1
@specialhandler@ProcessChainRestart
Please help me fix this issue.
Thanks
Nanda
adding more screenshots:
the following process chain has the following replies available:
but the output of getReplyExpression(); has only one expression as shown below:
BW_D_BI_BW_ZMC_FGL_MD
@specialhandler@ProcessChainRestart
PS:.
There were 7 process chains in console state, out of them the script was able to reply successfully for the first process chain, but failed getting the full reply for the rest of the 6 process chains.
Successful getReplyExpression() below:
BW_D_BI_BW_ZMC_FAA_MD
^@locale@:com\.redwood\.scheduler\.sap\.job\.restart\.ProcessChain\.reply\.SetError|@locale@:com\.redwood\.scheduler\.sap\.job\.restart\.ProcessChain\.reply\.SetCompleted|@locale@:com\.redwood\.scheduler\.sap\.job\.restart\.ProcessChain\.reply\.RestartAllError|-- #914478 / ZMC_FAA_MD|---- #914511 / ZMC_FAA_MD|---- #914523 / ZPC_FAA_MD_ATTR|------ #914538 / ZPC_FAA_MD_ATTR|------ #914548 / ZPAK_DGXQEMDLFN6EQIW9L1IPW6MNR|------ #914558 / DTP_00O2TR1UHHNNYTK2W2NC7QX9Y|------ #914569 / DTP_00O2TR1UHHNNYTK30P2F0Y0AE|------ #914581 / ZPAK_DGXM59X8NY5YW295SC0FXNP6F|------ #914680 / DTP_00O2TR1UHHNNYT993HY7HQPRQ|------ #914693 / ZPAK_DHGCLV9QGYG9QM5YE1TC84UNR|------ #914748 / DTP_00O2TR1UHHNNZ1WX1C924EOZA|---- #914863 / ZPC_FAA_MD_TEXT|---- #914864 / ZPC_FAA_TD_ASSET_DELTA$
Please help me fix this.
thanks
Nanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi HP,
I did raise with SAP support initially, which was then forwarded to Redwood support.
The reason for that behavior is that, not all the operator message replies are persisted, so in that case, we should use getMapOfReplies() to get the map .
thanks for your suggestion, it solves the problem without any hassle.
@locale@:com.redwood.scheduler.sap.job.restart.ProcessChain.reply.SetError
Out of curiosity though,
i was able to obtain the return for getMapOfReplies() in a Map, but i couldn't figure out, how do i retrieve a specific reply from the map, into a string, so that i can reply to that operator message.
Please throw some light on it.
thanks
Nanda
Hi Nanda,
This is just a simple Java Map, like an excel spreadsheet with two columns. Each column in the Map holds a Java object, which you must know. [From API docs:] The key in the map is the value that must be set as the reply, the value is the string to be displayed to the user (which is already translated if it can be translated).
You can use containsKey(Object key) and containsValue(Object value) to check if the map contains a key or value.
You can iterate through the Map, but first you must make it a Set out of it:
Map myMap = opsmsg.getMapOfReplies();
Iterator entries = myMap.entrySet().iterator();
while (entries.hasNext())
{
Entry thisEntry = (Entry) entries.next();
Object key = thisEntry.getKey();
Object value = thisEntry.getValue();
// ...
}
Regards,
HP
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.