service-mcas, once again

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

service-mcas, once again

Ruth Hoffman
Hello All:

I was hoping someone could answer a few questions for me:

If I can  ->
1) Configure & connect to an IMAP store (I see the JavaMailContainer log
messages appear regularly in the logfile - and I am seeing the correct
number of messages on my IMAP server)
2) See my service-mca being read by the ServiceMcaUtil with the correct
ruleName (as configured in my service-mca)
3) See the JavaMailContainer read the config for all outstanding mca(s)
[~JavaMailContainer.java line 112]
4) I can see the mca rules in service.serviceMCAs under webtools

Why is not my service being executed? (I know its not being executed
because I put a debug log message as the very first executable
statement.) This service is just the testMca that points to
CommonServices.mcaTest.

I'm using all the code and config templates that come with OFBiz.
Nothing fancy here...

Or,  perhaps someone could point me to the OFBiz code checks the
service-mca cache looking for  service-mcas to invoke. [Or, do the
service-mca's not work that way. Are they somehow different in that they
are not in a queue somewhere, waiting to be invoked?]

TIA
Ruth

Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

BJ Freeman

#2 what does your mca say? did you change the smca_test.xml?

Ruth Hoffman sent the following on 8/5/2006 10:47 AM:

> Hello All:
>
> I was hoping someone could answer a few questions for me:
>
> If I can  ->
> 1) Configure & connect to an IMAP store (I see the JavaMailContainer log
> messages appear regularly in the logfile - and I am seeing the correct
> number of messages on my IMAP server)
> 2) See my service-mca being read by the ServiceMcaUtil with the correct
> ruleName (as configured in my service-mca)
> 3) See the JavaMailContainer read the config for all outstanding mca(s)
> [~JavaMailContainer.java line 112]
> 4) I can see the mca rules in service.serviceMCAs under webtools
>
> Why is not my service being executed? (I know its not being executed
> because I put a debug log message as the very first executable
> statement.) This service is just the testMca that points to
> CommonServices.mcaTest.
>
> I'm using all the code and config templates that come with OFBiz.
> Nothing fancy here...
>
> Or,  perhaps someone could point me to the OFBiz code checks the
> service-mca cache looking for  service-mcas to invoke. [Or, do the
> service-mca's not work that way. Are they somehow different in that they
> are not in a queue somewhere, waiting to be invoked?]
>
> TIA
> Ruth
>
>
Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Ruth Hoffman
Hi BJ:
Here it be (just hoping that it will match everything/anything):

<service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
    <mca mail-rule-name="testRule1">
     <!--
        <condition-field field-name="to" operator="matches" value="*.*"/>
        <condition-field field-name="subject" operator="matches"
value="*"/>
    -->
        <action service="testMca" mode="sync"/>
    </mca>
</service-mca>

 and ...

<service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
    <mca mail-rule-name="testRule1">
        <condition-field field-name="to" operator="matches" value="*.*"/>
        <condition-field field-name="subject" operator="matches"
value="*"/>
        <action service="testMca" mode="sync"/>
    </mca>
</service-mca>

Ruth

BJ Freeman wrote:

>
> #2 what does your mca say? did you change the smca_test.xml?
>
> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>
>> Hello All:
>>
>> I was hoping someone could answer a few questions for me:
>>
>> If I can  ->
>> 1) Configure & connect to an IMAP store (I see the JavaMailContainer
>> log messages appear regularly in the logfile - and I am seeing the
>> correct number of messages on my IMAP server)
>> 2) See my service-mca being read by the ServiceMcaUtil with the
>> correct ruleName (as configured in my service-mca)
>> 3) See the JavaMailContainer read the config for all outstanding
>> mca(s) [~JavaMailContainer.java line 112]
>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>
>> Why is not my service being executed? (I know its not being executed
>> because I put a debug log message as the very first executable
>> statement.) This service is just the testMca that points to
>> CommonServices.mcaTest.
>>
>> I'm using all the code and config templates that come with OFBiz.
>> Nothing fancy here...
>>
>> Or,  perhaps someone could point me to the OFBiz code checks the
>> service-mca cache looking for  service-mcas to invoke. [Or, do the
>> service-mca's not work that way. Are they somehow different in that
>> they are not in a queue somewhere, waiting to be invoked?]
>>
>> TIA
>> Ruth
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Scott Gray
Hi Ruth

By chance i'm working through the mca stuff as well, if you have a look
in ServiceMcaCondition.java the 'matches' operator uses a regular
expression which is defined in the value field, so I think your value
needs to be ".*"  I don't know much about regex so for testing I'm just
using the "not-empty" operator for now, like so:

<service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
    <mca mail-rule-name="newNZHLCust">
        <condition-field field-name="subject" operator="not-empty"/>
        <action service="testMca" mode="sync"/>
    </mca>
</service-mca>

seems to work.

Regards
Scott


Ruth Hoffman wrote:

> Hi BJ:
> Here it be (just hoping that it will match everything/anything):
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>
>    <mca mail-rule-name="testRule1">
>     <!--        <condition-field field-name="to" operator="matches"
> value="*.*"/>
>        <condition-field field-name="subject" operator="matches"
> value="*"/>
>    -->
>        <action service="testMca" mode="sync"/>
>    </mca>
> </service-mca>
>
> and ...
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>
>    <mca mail-rule-name="testRule1">        <condition-field
> field-name="to" operator="matches" value="*.*"/>
>        <condition-field field-name="subject" operator="matches"
> value="*"/>
>        <action service="testMca" mode="sync"/>
>    </mca>
> </service-mca>
>
> Ruth
>
> BJ Freeman wrote:
>
>>
>> #2 what does your mca say? did you change the smca_test.xml?
>>
>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>
>>> Hello All:
>>>
>>> I was hoping someone could answer a few questions for me:
>>>
>>> If I can  ->
>>> 1) Configure & connect to an IMAP store (I see the JavaMailContainer
>>> log messages appear regularly in the logfile - and I am seeing the
>>> correct number of messages on my IMAP server)
>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>> correct ruleName (as configured in my service-mca)
>>> 3) See the JavaMailContainer read the config for all outstanding
>>> mca(s) [~JavaMailContainer.java line 112]
>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>
>>> Why is not my service being executed? (I know its not being executed
>>> because I put a debug log message as the very first executable
>>> statement.) This service is just the testMca that points to
>>> CommonServices.mcaTest.
>>>
>>> I'm using all the code and config templates that come with OFBiz.
>>> Nothing fancy here...
>>>
>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>> service-mca cache looking for  service-mcas to invoke. [Or, do the
>>> service-mca's not work that way. Are they somehow different in that
>>> they are not in a queue somewhere, waiting to be invoked?]
>>>
>>> TIA
>>> Ruth
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Ruth Hoffman
Hi Scott:
Tried this, but it doesn't seem to make any difference. In my case,
testMca ==> CommonServices.mcaTest never executes...or at least never
prints out debug messages. I do, however, keep connecting to my IMAP
server without fail.

Do you happen to know if the service-mca gets triggered only after a
successful connect to the IMAP store? Or is there something else that
triggers it?

TIA
Ruth

Thanks for you suggestion
Ruth

Scott Gray wrote:

> Hi Ruth
>
> By chance i'm working through the mca stuff as well, if you have a
> look in ServiceMcaCondition.java the 'matches' operator uses a regular
> expression which is defined in the value field, so I think your value
> needs to be ".*"  I don't know much about regex so for testing I'm
> just using the "not-empty" operator for now, like so:
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>
>    <mca mail-rule-name="newNZHLCust">
>        <condition-field field-name="subject" operator="not-empty"/>
>        <action service="testMca" mode="sync"/>
>    </mca>
> </service-mca>
>
> seems to work.
>
> Regards
> Scott
>
>
> Ruth Hoffman wrote:
>
>> Hi BJ:
>> Here it be (just hoping that it will match everything/anything):
>>
>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        
>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>
>>    <mca mail-rule-name="testRule1">
>>     <!--        <condition-field field-name="to" operator="matches"
>> value="*.*"/>
>>        <condition-field field-name="subject" operator="matches"
>> value="*"/>
>>    -->
>>        <action service="testMca" mode="sync"/>
>>    </mca>
>> </service-mca>
>>
>> and ...
>>
>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        
>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>
>>    <mca mail-rule-name="testRule1">        <condition-field
>> field-name="to" operator="matches" value="*.*"/>
>>        <condition-field field-name="subject" operator="matches"
>> value="*"/>
>>        <action service="testMca" mode="sync"/>
>>    </mca>
>> </service-mca>
>>
>> Ruth
>>
>> BJ Freeman wrote:
>>
>>>
>>> #2 what does your mca say? did you change the smca_test.xml?
>>>
>>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>>
>>>> Hello All:
>>>>
>>>> I was hoping someone could answer a few questions for me:
>>>>
>>>> If I can  ->
>>>> 1) Configure & connect to an IMAP store (I see the
>>>> JavaMailContainer log messages appear regularly in the logfile -
>>>> and I am seeing the correct number of messages on my IMAP server)
>>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>>> correct ruleName (as configured in my service-mca)
>>>> 3) See the JavaMailContainer read the config for all outstanding
>>>> mca(s) [~JavaMailContainer.java line 112]
>>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>>
>>>> Why is not my service being executed? (I know its not being
>>>> executed because I put a debug log message as the very first
>>>> executable statement.) This service is just the testMca that points
>>>> to CommonServices.mcaTest.
>>>>
>>>> I'm using all the code and config templates that come with OFBiz.
>>>> Nothing fancy here...
>>>>
>>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>>> service-mca cache looking for  service-mcas to invoke. [Or, do the
>>>> service-mca's not work that way. Are they somehow different in that
>>>> they are not in a queue somewhere, waiting to be invoked?]
>>>>
>>>> TIA
>>>> Ruth
>>>>
>>>>
>>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Scott Gray
Hi Ruth

Are any messages getting downloaded? (they show up in the console)
The process goes like this:
1. JavaMailContainer: Pollertask run() -> checkMessages() ->
processMessage()
2. ServiceMcaUtil: evalRules()
3. ServiceMcaRule: eval()

checkMessages() downloads all messages but then only calls
processMessage() if the SEEN flag hasn't been set, so if your messages
have already been read/seen then they won't get checked against the mcas.

Regards
Scott

Ruth Hoffman wrote:

> Hi Scott:
> Tried this, but it doesn't seem to make any difference. In my case,
> testMca ==> CommonServices.mcaTest never executes...or at least never
> prints out debug messages. I do, however, keep connecting to my IMAP
> server without fail.
>
> Do you happen to know if the service-mca gets triggered only after a
> successful connect to the IMAP store? Or is there something else that
> triggers it?
>
> TIA
> Ruth
>
> Thanks for you suggestion
> Ruth
>
> Scott Gray wrote:
>
>> Hi Ruth
>>
>> By chance i'm working through the mca stuff as well, if you have a
>> look in ServiceMcaCondition.java the 'matches' operator uses a
>> regular expression which is defined in the value field, so I think
>> your value needs to be ".*"  I don't know much about regex so for
>> testing I'm just using the "not-empty" operator for now, like so:
>>
>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        
>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>
>>    <mca mail-rule-name="newNZHLCust">
>>        <condition-field field-name="subject" operator="not-empty"/>
>>        <action service="testMca" mode="sync"/>
>>    </mca>
>> </service-mca>
>>
>> seems to work.
>>
>> Regards
>> Scott
>>
>>
>> Ruth Hoffman wrote:
>>
>>> Hi BJ:
>>> Here it be (just hoping that it will match everything/anything):
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>
>>>    <mca mail-rule-name="testRule1">
>>>     <!--        <condition-field field-name="to" operator="matches"
>>> value="*.*"/>
>>>        <condition-field field-name="subject" operator="matches"
>>> value="*"/>
>>>    -->
>>>        <action service="testMca" mode="sync"/>
>>>    </mca>
>>> </service-mca>
>>>
>>> and ...
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>
>>>    <mca mail-rule-name="testRule1">        <condition-field
>>> field-name="to" operator="matches" value="*.*"/>
>>>        <condition-field field-name="subject" operator="matches"
>>> value="*"/>
>>>        <action service="testMca" mode="sync"/>
>>>    </mca>
>>> </service-mca>
>>>
>>> Ruth
>>>
>>> BJ Freeman wrote:
>>>
>>>>
>>>> #2 what does your mca say? did you change the smca_test.xml?
>>>>
>>>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>>>
>>>>> Hello All:
>>>>>
>>>>> I was hoping someone could answer a few questions for me:
>>>>>
>>>>> If I can  ->
>>>>> 1) Configure & connect to an IMAP store (I see the
>>>>> JavaMailContainer log messages appear regularly in the logfile -
>>>>> and I am seeing the correct number of messages on my IMAP server)
>>>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>>>> correct ruleName (as configured in my service-mca)
>>>>> 3) See the JavaMailContainer read the config for all outstanding
>>>>> mca(s) [~JavaMailContainer.java line 112]
>>>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>>>
>>>>> Why is not my service being executed? (I know its not being
>>>>> executed because I put a debug log message as the very first
>>>>> executable statement.) This service is just the testMca that
>>>>> points to CommonServices.mcaTest.
>>>>>
>>>>> I'm using all the code and config templates that come with OFBiz.
>>>>> Nothing fancy here...
>>>>>
>>>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>>>> service-mca cache looking for  service-mcas to invoke. [Or, do the
>>>>> service-mca's not work that way. Are they somehow different in
>>>>> that they are not in a queue somewhere, waiting to be invoked?]
>>>>>
>>>>> TIA
>>>>> Ruth
>>>>>
>>>>>
>>>>
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Ruth Hoffman
Hi Scott:
Thanks for the quick reply - now I know where to check...and how this is
suppose to work...I lost the trail after checkMessages....thanks again.
Ruth

Scott Gray wrote:

> Hi Ruth
>
> Are any messages getting downloaded? (they show up in the console)
> The process goes like this:
> 1. JavaMailContainer: Pollertask run() -> checkMessages() ->
> processMessage()
> 2. ServiceMcaUtil: evalRules()
> 3. ServiceMcaRule: eval()
>
> checkMessages() downloads all messages but then only calls
> processMessage() if the SEEN flag hasn't been set, so if your messages
> have already been read/seen then they won't get checked against the mcas.
>
> Regards
> Scott
>
> Ruth Hoffman wrote:
>
>> Hi Scott:
>> Tried this, but it doesn't seem to make any difference. In my case,
>> testMca ==> CommonServices.mcaTest never executes...or at least never
>> prints out debug messages. I do, however, keep connecting to my IMAP
>> server without fail.
>>
>> Do you happen to know if the service-mca gets triggered only after a
>> successful connect to the IMAP store? Or is there something else that
>> triggers it?
>>
>> TIA
>> Ruth
>>
>> Thanks for you suggestion
>> Ruth
>>
>> Scott Gray wrote:
>>
>>> Hi Ruth
>>>
>>> By chance i'm working through the mca stuff as well, if you have a
>>> look in ServiceMcaCondition.java the 'matches' operator uses a
>>> regular expression which is defined in the value field, so I think
>>> your value needs to be ".*"  I don't know much about regex so for
>>> testing I'm just using the "not-empty" operator for now, like so:
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>
>>>    <mca mail-rule-name="newNZHLCust">
>>>        <condition-field field-name="subject" operator="not-empty"/>
>>>        <action service="testMca" mode="sync"/>
>>>    </mca>
>>> </service-mca>
>>>
>>> seems to work.
>>>
>>> Regards
>>> Scott
>>>
>>>
>>> Ruth Hoffman wrote:
>>>
>>>> Hi BJ:
>>>> Here it be (just hoping that it will match everything/anything):
>>>>
>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        
>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>
>>>>    <mca mail-rule-name="testRule1">
>>>>     <!--        <condition-field field-name="to" operator="matches"
>>>> value="*.*"/>
>>>>        <condition-field field-name="subject" operator="matches"
>>>> value="*"/>
>>>>    -->
>>>>        <action service="testMca" mode="sync"/>
>>>>    </mca>
>>>> </service-mca>
>>>>
>>>> and ...
>>>>
>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        
>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>
>>>>    <mca mail-rule-name="testRule1">        <condition-field
>>>> field-name="to" operator="matches" value="*.*"/>
>>>>        <condition-field field-name="subject" operator="matches"
>>>> value="*"/>
>>>>        <action service="testMca" mode="sync"/>
>>>>    </mca>
>>>> </service-mca>
>>>>
>>>> Ruth
>>>>
>>>> BJ Freeman wrote:
>>>>
>>>>>
>>>>> #2 what does your mca say? did you change the smca_test.xml?
>>>>>
>>>>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>>>>
>>>>>> Hello All:
>>>>>>
>>>>>> I was hoping someone could answer a few questions for me:
>>>>>>
>>>>>> If I can  ->
>>>>>> 1) Configure & connect to an IMAP store (I see the
>>>>>> JavaMailContainer log messages appear regularly in the logfile -
>>>>>> and I am seeing the correct number of messages on my IMAP server)
>>>>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>>>>> correct ruleName (as configured in my service-mca)
>>>>>> 3) See the JavaMailContainer read the config for all outstanding
>>>>>> mca(s) [~JavaMailContainer.java line 112]
>>>>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>>>>
>>>>>> Why is not my service being executed? (I know its not being
>>>>>> executed because I put a debug log message as the very first
>>>>>> executable statement.) This service is just the testMca that
>>>>>> points to CommonServices.mcaTest.
>>>>>>
>>>>>> I'm using all the code and config templates that come with OFBiz.
>>>>>> Nothing fancy here...
>>>>>>
>>>>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>>>>> service-mca cache looking for  service-mcas to invoke. [Or, do
>>>>>> the service-mca's not work that way. Are they somehow different
>>>>>> in that they are not in a queue somewhere, waiting to be invoked?]
>>>>>>
>>>>>> TIA
>>>>>> Ruth
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

BJ Freeman
In reply to this post by Ruth Hoffman
I have quite a few, each calling a different email service.

the catch all is
<!--every thing else not processed will get processed here -->
         <mca mail-rule-name="catchallRule">
         <condition-field field-name="to" operator="matches" value=".*"/>
         <condition-field field-name="subject" operator="matches"
value=".*"/>
         <action service="storeIncomingEmail" mode="sync"/>
     </mca>
       


Ruth Hoffman sent the following on 8/5/2006 2:27 PM:

> Hi BJ:
> Here it be (just hoping that it will match everything/anything):
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>    <mca mail-rule-name="testRule1">
>     <!--        <condition-field field-name="to" operator="matches"
> value="*.*"/>
>        <condition-field field-name="subject" operator="matches" value="*"/>
>    -->
>        <action service="testMca" mode="sync"/>
>    </mca>
> </service-mca>
>
> and ...
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>    <mca mail-rule-name="testRule1">        <condition-field
> field-name="to" operator="matches" value="*.*"/>
>        <condition-field field-name="subject" operator="matches" value="*"/>
>        <action service="testMca" mode="sync"/>
>    </mca>
> </service-mca>
>
> Ruth
>
> BJ Freeman wrote:
>
>>
>> #2 what does your mca say? did you change the smca_test.xml?
>>
>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>
>>> Hello All:
>>>
>>> I was hoping someone could answer a few questions for me:
>>>
>>> If I can  ->
>>> 1) Configure & connect to an IMAP store (I see the JavaMailContainer
>>> log messages appear regularly in the logfile - and I am seeing the
>>> correct number of messages on my IMAP server)
>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>> correct ruleName (as configured in my service-mca)
>>> 3) See the JavaMailContainer read the config for all outstanding
>>> mca(s) [~JavaMailContainer.java line 112]
>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>
>>> Why is not my service being executed? (I know its not being executed
>>> because I put a debug log message as the very first executable
>>> statement.) This service is just the testMca that points to
>>> CommonServices.mcaTest.
>>>
>>> I'm using all the code and config templates that come with OFBiz.
>>> Nothing fancy here...
>>>
>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>> service-mca cache looking for  service-mcas to invoke. [Or, do the
>>> service-mca's not work that way. Are they somehow different in that
>>> they are not in a queue somewhere, waiting to be invoked?]
>>>
>>> TIA
>>> Ruth
>>>
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: service-mcas, once again

Ruth Hoffman
In reply to this post by Scott Gray
Hi Scott:
Thanks again. My problem was exactly as you suspected. For my part, I
did not read far enough down in JavaMailContainer to see where the
service was being invoked. My bad - I assumed that since I was
connecting to the mail store ok, and I could see that check messages was
working, the service must be invoked somewhere outside of the
JavaMailContainer.

Hopefully this will help anyone else who is trying to understand how the
service mca's work:
they are triggered by code in the JavaMailContainer. All the rules that
are written as <mca mail-rule-name...> are directions to the
JavaMailContainer on what to do after it receives valid, incoming
messages [where valid is currently defined as not already seen]. I guess
I just totally missed that part -  hopefully others aren't as dense as I am.

I much appreciate the time you've taken to explain this to me.
Ruth

Scott Gray wrote:

> Hi Ruth
>
> Are any messages getting downloaded? (they show up in the console)
> The process goes like this:
> 1. JavaMailContainer: Pollertask run() -> checkMessages() ->
> processMessage()
> 2. ServiceMcaUtil: evalRules()
> 3. ServiceMcaRule: eval()
>
> checkMessages() downloads all messages but then only calls
> processMessage() if the SEEN flag hasn't been set, so if your messages
> have already been read/seen then they won't get checked against the mcas.
>
> Regards
> Scott
>
> Ruth Hoffman wrote:
>
>> Hi Scott:
>> Tried this, but it doesn't seem to make any difference. In my case,
>> testMca ==> CommonServices.mcaTest never executes...or at least never
>> prints out debug messages. I do, however, keep connecting to my IMAP
>> server without fail.
>>
>> Do you happen to know if the service-mca gets triggered only after a
>> successful connect to the IMAP store? Or is there something else that
>> triggers it?
>>
>> TIA
>> Ruth
>>
>> Thanks for you suggestion
>> Ruth
>>
>> Scott Gray wrote:
>>
>>> Hi Ruth
>>>
>>> By chance i'm working through the mca stuff as well, if you have a
>>> look in ServiceMcaCondition.java the 'matches' operator uses a
>>> regular expression which is defined in the value field, so I think
>>> your value needs to be ".*"  I don't know much about regex so for
>>> testing I'm just using the "not-empty" operator for now, like so:
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>
>>>    <mca mail-rule-name="newNZHLCust">
>>>        <condition-field field-name="subject" operator="not-empty"/>
>>>        <action service="testMca" mode="sync"/>
>>>    </mca>
>>> </service-mca>
>>>
>>> seems to work.
>>>
>>> Regards
>>> Scott
>>>
>>>
>>> Ruth Hoffman wrote:
>>>
>>>> Hi BJ:
>>>> Here it be (just hoping that it will match everything/anything):
>>>>
>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        
>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>
>>>>    <mca mail-rule-name="testRule1">
>>>>     <!--        <condition-field field-name="to" operator="matches"
>>>> value="*.*"/>
>>>>        <condition-field field-name="subject" operator="matches"
>>>> value="*"/>
>>>>    -->
>>>>        <action service="testMca" mode="sync"/>
>>>>    </mca>
>>>> </service-mca>
>>>>
>>>> and ...
>>>>
>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        
>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>
>>>>    <mca mail-rule-name="testRule1">        <condition-field
>>>> field-name="to" operator="matches" value="*.*"/>
>>>>        <condition-field field-name="subject" operator="matches"
>>>> value="*"/>
>>>>        <action service="testMca" mode="sync"/>
>>>>    </mca>
>>>> </service-mca>
>>>>
>>>> Ruth
>>>>
>>>> BJ Freeman wrote:
>>>>
>>>>>
>>>>> #2 what does your mca say? did you change the smca_test.xml?
>>>>>
>>>>> Ruth Hoffman sent the following on 8/5/2006 10:47 AM:
>>>>>
>>>>>> Hello All:
>>>>>>
>>>>>> I was hoping someone could answer a few questions for me:
>>>>>>
>>>>>> If I can  ->
>>>>>> 1) Configure & connect to an IMAP store (I see the
>>>>>> JavaMailContainer log messages appear regularly in the logfile -
>>>>>> and I am seeing the correct number of messages on my IMAP server)
>>>>>> 2) See my service-mca being read by the ServiceMcaUtil with the
>>>>>> correct ruleName (as configured in my service-mca)
>>>>>> 3) See the JavaMailContainer read the config for all outstanding
>>>>>> mca(s) [~JavaMailContainer.java line 112]
>>>>>> 4) I can see the mca rules in service.serviceMCAs under webtools
>>>>>>
>>>>>> Why is not my service being executed? (I know its not being
>>>>>> executed because I put a debug log message as the very first
>>>>>> executable statement.) This service is just the testMca that
>>>>>> points to CommonServices.mcaTest.
>>>>>>
>>>>>> I'm using all the code and config templates that come with OFBiz.
>>>>>> Nothing fancy here...
>>>>>>
>>>>>> Or,  perhaps someone could point me to the OFBiz code checks the
>>>>>> service-mca cache looking for  service-mcas to invoke. [Or, do
>>>>>> the service-mca's not work that way. Are they somehow different
>>>>>> in that they are not in a queue somewhere, waiting to be invoked?]
>>>>>>
>>>>>> TIA
>>>>>> Ruth
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

API

Andrew Sykes
In reply to this post by BJ Freeman
Hi Folks,

Sorry for the interruption to the API hosting recently.

We almost have an automated build now, anyway it's back up...

http://www.ofbiz.eu
--
Kind Regards
Andrew Sykes <[hidden email]>
Sykes Development Ltd
http://www.sykesdevelopment.com