Reading the workflow for a page throws an error

27 views
Skip to first unread message

Bart Maes

unread,
Jul 14, 2015, 10:16:18 AM7/14/15
to smar...@googlegroups.com
Hi,

I'm trying to read the workflow for a given page.
Being able to read the id and headline without any problem, I thought reading the workflow would be a piece of cake too.
But unfortunately, I get the following error when I try to do so.

Error occured. Message=Missing value for attribute structureworkflow Source=erminas SmartAPI Stacktrace=   at erminas.SmartAPI.CMS.RedDotObject.EnsuredInit[T](T& variable, String attributeName, Func`2 converter) in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\CMS\IRedDotObject.cs:line 174
   at erminas.SmartAPI.CMS.Project.Workflows.Workflow.LoadXml() in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\CMS\Project\Workflows\IWorkflow.cs:line 101
   at erminas.SmartAPI.CMS.Project.Workflows.Workflow..ctor(IProject project, XmlElement xmlElement) in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\CMS\Project\Workflows\IWorkflow.cs:line 40
   at erminas.SmartAPI.CMS.Project.ProjectWorkflow.<GetWorkflows>b__0(XmlElement curWorkflow) in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\CMS\Project\IProjectWorkflows.cs:line 47
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at erminas.SmartAPI.CMS.Project.ProjectWorkflow.GetWorkflows() in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\CMS\Project\IProjectWorkflows.cs:line 46
   at erminas.SmartAPI.Utils.CachedCollections.CachedList`1.EnsureListIsLoaded() in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\Utils\CachedCollections\CachedList.cs:line 97
   at erminas.SmartAPI.Utils.CachedCollections.IndexedRDList`2.GetByGuid(Guid guid) in c:\Program Files\TeamCity\buildAgent\work\da03f6a03d945cb1\SmartAPI\erminas.SmartAPI\Utils\CachedCollections\IndexedRDList.cs:line 59

I also tried to use the extended search capabilities, and tried to add a workflowfilter, but this also generates an error.

Any idea what causes this behavior?

Regards,
Bart Maes

Hilmar Bunjes

unread,
Jul 14, 2015, 11:37:13 AM7/14/15
to smar...@googlegroups.com, bartm...@gmail.com
Hi,
we're investigating and reply as soon as we found the error.

Best,
Hilmar

Jonas Jacobi

unread,
Jul 15, 2015, 4:10:42 AM7/15/15
to smar...@googlegroups.com
Hi Bart,
it looks like the structureworkflow attribute is missing in the RQL response.
I'm not really sure, if this can be expected (haven't seen that myself before), or if there is something else wrong.
It would be awesome, if you could sent me a log file of when that error happens.
You can activate logging by adding the following snippet into the configuration section of your application/web.conf

 <log4net>
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="smartapi.log" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <datePattern value="yyyyMMdd" />
      <maxSizeRollBackups value="20" />
      <maximumFileSize value="10MB" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="RollingLogFileAppender"  />
    </root>
  </log4net>

You can either post the log here or send it to jonas....@erminas.de .
Oh and we be nice to hear which version of the OTWSM you use.

TIA and cheers
Jonas


Bart Maes

unread,
Jul 15, 2015, 8:52:13 AM7/15/15
to smar...@googlegroups.com
Hi Jonas,

We use Management Server 11.2 Build 11.2.2.895.
Adding the snippet into the app.config of my console application doesn't seem to do the trick.
I'm not seeing any log file being created anywhere.
I'll keep trying to get the logging working, but I'm running out of ideas.

Cheers,
Bart

--
More information about SmartAPI: http://www.smartapi.de
---
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "SmartAPI" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an smartapi+u...@googlegroups.com.
Wenn Sie in dieser Gruppe einen Beitrag posten möchten, senden Sie eine E-Mail an smar...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Jonas Jacobi

unread,
Jul 15, 2015, 8:58:15 AM7/15/15
to smar...@googlegroups.com

Hi Bart,

 

try adding

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

To your AssemblyInfo.cs.

 

Mit freundlichen Grüßen / Best regards,

Jonas Jacobi


erminas
SmartAPI: Freie .NET RQL Bibliothek

 

erminas GmbH

Nadorster Str. 60

26123 Oldenburg

 

Tel.: +49 (0)441 249 287-13

Fax: +49 (0)441 249 287-91

jonas....@erminas.de

http://www.erminas.de

 

Registergericht: Amtsgericht Oldenburg, HRB 209480

Geschäftsführer: Hilmar Bunjes

Bart Maes

unread,
Jul 15, 2015, 9:16:05 AM7/15/15
to smar...@googlegroups.com
Hi Jonas,

I already added this entry earlier today.

This is what my app.config file looks like right now:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="log4net"
      type="log4net.Config.Log4NetConfigurationSectionHandler,
            log4net"/>
  </configSections> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
  <log4net>
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">

      <file value="smartapi.log" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <datePattern value="yyyyMMdd" />
      <maxSizeRollBackups value="20" />
      <maximumFileSize value="10MB" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="RollingLogFileAppender"  />
    </root>
  </log4net>
</configuration>

Best regards,
Bart

Jonas Jacobi

unread,
Jul 15, 2015, 9:50:55 AM7/15/15
to smar...@googlegroups.com

Hi Bart,

 

file looks good on first sight.

You could also try adding

log4net.Config.XmlConfigurator.Configure();

to the your application startup code.

Maybe change the path of the logfile to some absolute path at  a directory you have write permissions for.

 

Mit freundlichen Grüßen / Best regards,

Jonas Jacobi



Bart Maes

unread,
Jul 16, 2015, 3:58:37 AM7/16/15
to smar...@googlegroups.com
Hi jonas,

Forgot to answer the first question in your mail:
the logging works thanks to the addition of the instruction log4net.Config.XmlConfigurator.Configure();

Best regards,
Bart

Jonas Jacobi

unread,
Aug 12, 2015, 3:36:55 AM8/12/15
to SmartAPI
Bart and I could track down the problem and it is now solved in Version 1.0.5.0
Thank you again for your report!
Reply all
Reply to author
Forward
0 new messages