Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:41:11+00:00 2026-06-15T13:41:11+00:00

In my JADE program, one agent needs to send an ACL message to another

  • 0

In my JADE program, one agent needs to send an ACL message to another agent. For the agent sending the message (agent1) it stores a String[] array of values that it has to send.

However, in order to actually send the ACL message the content must only be a String and nothing else. The method used add content to the message is the following :
msg.setContent(String str)

So the problem is I have a range of values stored in agent1 , which are all in an array. I have to send these values in ONE message so I can’t send several messages with each element of the array. In my current “Test” array I only put two elements so this is what I’m doing so far:

msg.setContent(theArray[0] + theArray[1]);

Now when the receiving agent (agent2) opens this message and gets the content it’s obviously just a concatenation of the two elements of the array I sent from agent1.

How do I get agent2 to split this one String back into an array of String[] ? I have looked at the method

split(String regex)

for the String value of the message content. So I’m thinking since each element of the array in Agent1 starts with a Capital letter, then maybe I could enter a regular expression to split String as soon as a capital letter is encountered.

However I’m not sure how to do this, or if it’s even a good idea. Please provide any suggestions.

Relevant API doc:

http://jade.cselt.it/doc/api/jade/lang/acl/ACLMessage.html#setContent(java.lang.String)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:41:12+00:00Added an answer on June 15, 2026 at 1:41 pm

    You can use JSON as an interchange format in order to send pretty much anything as String over the wire.

    Here is an example using org.json.

    Collection c = Arrays.asList(str);
    org.json.JSonArray arr = new org.json.JSonArray(c);
    msg.sendContents(arr.toString());
    

    On the other side:

    String s = getContents();
    org.json.JSonArray arr = new org.json.JSonArray(s);
    String[] strs = new String[arr.length()];
    for (int i = 0; i < arr.length(); i++) {
        strs[i] = arr.getString(i);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to using Jade -- and it's awesome so far. But one
Would anyone please advise how in jade for nodejs I can truncate a string
I have this in a jade file h2 HTML Before: code#before <div id=message><p>New content
I have this piece of code in one of my .jade files: each item
Coming from an academic background in mutli-agent systems (developed in Java using JADE )
I am trying to create a JADE message with ACLMessage reqMsg = new ACLMessage(ACLMessage.REQUEST);
I my jade view I give the array 'arr': server.js app('/', function (req, res)
I have a jade template for my node.js project. I would like to send
After learning that JADE does not support Mobile Agent concept but supports only traditional
in jade one can write: div.container and it compiles into: <div class=container></div> But what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.