Need to create a work unit message longer than 60 characters.

 2 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Randy Jacoy
Veteran Member
Posts: 46
Veteran Member
    We have a portal form that our users use to add a message to a work unit.  The call is as follows:

    http:///bpm/inbasket?FUNCTION=workdetail&RDUSER=&WORKUNIT=1518&APPRODLINE=LOGAN&UPTYPE=MSG&UPDTACTION=A&MSGID=uniqid1234&MSGCONTENT=This is a test message.

    This call adds an entry to tables WFMSGHDR and WFMSGDTL in the LOGAN database.  Looking in the WFMSGDTL table you'll see that the MESSAGE (MSGCONTENT above) field size is 60 characters.  Our users want to add messages longer than 60 characters.  I can see that there is a MESSAGE_SEQ and MESSAGE_APPEND field that would imply you could insert multiple WFMSGDTL records for the same message however I have not been able to get that to work using the above call and I can't find any documentation on how to do it. 

    I tried sending a message longer than 60 characters using the above call but it failed (even though the return from the call was "OK").  The only way I knew it failed was the fact that the message didn't appear when I checked messages for that work unit.  I also tried breaking up the message into 60 character chunks and sending them with the above call using the same MSGID for each chunk.  The first chunk would work however subsequent calls using the same MSGID would fail silently.  It seems to me that I should be able to specify an append flag or a sequence number but I can't for the life of me figure out how.  I know it can be done because you can do it in Process Flow Administrator (Workunit messages).  Any help would be greatly appreciated.
    Steven Gray
    Advanced Member
    Posts: 21
    Advanced Member
      Not sure why yours does not work, but I notice the &RDUSER= is missing a value. Here is an example I used to create a list that displays as an Inbasket message. The 60 char max is observed within each MESSAGE field, and a new MSG-SEQ is added for the line continuation . The "EOL" forces a newline when the message is displayed. I also attempt to delete the message before it is added.

      vURL = host + "/bpm/inbasket?FUNCTION=workdetail"
      vURL += "&RDUSER=lawson"
      vURL += "&WORKUNIT=" + oWorkUnit
      vURL += "&APPRODLINE=" + appProdline
      vURL += "&UPTYPE=MSG"
      vURL += "&UPDTACTION=A"
      vURL += "&MSGID=DeptList"
      vURL += "&MSGCONTENT=Forward+to+Department+ApproversEOL"
      vURL += URLEncoder("DeptApprover1: " + vName1 + "EOL")
      vURL += URLEncoder("DeptApprover2: " + vName2 + "EOL")
      vURL += URLEncoder("DeptApprover3: " + vName3 + "EOL")
      vURL += URLEncoder("DeptApprover4: " + vName4 + "EOL")
      vURL += URLEncoder("DeptApprover5: " + vName5 + "EOL")
      vURL += URLEncoder("DeptApprover6: " + vName6 + "EOL")

      Hope this helps.
      Randy Jacoy
      Veteran Member
      Posts: 46
      Veteran Member
        Steven,

        Thank you for your reply.  We do populate the RDUSER field; I just removed the userid for posting purposes.

        Your inbasket add looks identical to mine.  The only difference I saw was that your MSGID (DeptList) was 8 characters alpha as opposed to the 10 digits numeric I was using.  I hard coded a MSGID of 8 characters and it worked as you described; the message was added and the sequence number was incremented by 1 for each 60 character segment.  I then tried a 10 character MSGID and that worked too.  Finally I tried a 10 digit numeric MSGID (which is what we normally use) and it still worked!  In fact it worked every time.  I swear we used to get an error when the message exceeded 60 characters but now it seems to be working.  I'll chalk it up to sunspots or something.  Thank you for posting your code It prompted me to do additional testing which let me discover the function was working correctly.