how to throw a message in activiti - events

I want to throw and catch intermediate message catch event in activiti. But I don't know how to implement it. The following is my bpmn where I link between web service with other human talks by intermediate message event.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
<message id="msg" name="msg"></message>
<process id="process" isExecutable="true">
<startEvent id="start" name="start" activiti:initiator="initiator"></startEvent>
<serviceTask id="upload" name="upload project" activiti:exclusive="false" activiti:class="fitman.services.MyAuthUser_WS"></serviceTask>
<userTask id="provide" name="provide project details" activiti:assignee="${initiator}">
<extensionElements>
<activiti:formProperty id="user" name="user" type="user" required="true"></activiti:formProperty>
<activiti:formProperty id="name" name="name" type="string"></activiti:formProperty>
<activiti:formProperty id="toAddress" name="toAddress" type="string"></activiti:formProperty>
<activiti:formProperty id="subject" name="subject" type="string"></activiti:formProperty>
<activiti:formProperty id="textBody" name="textBody" type="string"></activiti:formProperty>
</extensionElements>
</userTask>
<sequenceFlow id="sid-8D423749-D7C6-4617-843B-FC4B62CC2E0A" sourceRef="start" targetRef="provide"></sequenceFlow>
<sequenceFlow id="sid-50642463-711F-4AD0-ABFC-F1A383392D4D" sourceRef="provide" targetRef="upload"></sequenceFlow>
<sequenceFlow id="sid-9611F0F0-6CC0-4F56-8A7B-35624A0BB2D2" sourceRef="upload" targetRef="msg1"></sequenceFlow>
<userTask id="validate" name="validate" activiti:assignee="msg1"></userTask>
<sequenceFlow id="sid-B4044992-C9F3-47C8-A206-99CABAC46B6D" sourceRef="msg1" targetRef="validate"></sequenceFlow>
<endEvent id="end"></endEvent>
<sequenceFlow id="sid-163DD9FE-3708-4A6B-85FC-EB1E2354182B" sourceRef="validate" targetRef="end"></sequenceFlow>
<intermediateCatchEvent id="msg1" name="msg1">
<messageEventDefinition messageRef="msg"></messageEventDefinition>
</intermediateCatchEvent>
</process>
</definitions>
What I am doing wrong or any idea how to implement it.
Now I am using signal, but still unable to start other user task after catching it; What I am doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
<signal id="newMsg" name="newMsg"></signal>
<process id="model1" isExecutable="true">
<startEvent id="start" activiti:initiator="initiator"></startEvent>
<userTask id="task1" name="task1" activiti:assignee="${initiator}">
<extensionElements>
<activiti:formProperty id="a" name="a" type="string"></activiti:formProperty>
</extensionElements>
</userTask>
<sequenceFlow id="sid-16842953-EA94-42A2-B116-C68A98C85090" sourceRef="start" targetRef="task1"></sequenceFlow>
<sequenceFlow id="sid-E2E35140-E272-4D5C-88A1-CD1039E6672B" sourceRef="task1" targetRef="serv1"></sequenceFlow>
<sequenceFlow id="sid-9E02B791-B3C0-4B62-81BB-DA10424469DF" sourceRef="serv1" targetRef="s1"></sequenceFlow>
<intermediateCatchEvent id="s1" name="s1">
<signalEventDefinition signalRef="newMsg"></signalEventDefinition>
</intermediateCatchEvent>
<userTask id="task2" name="task2" activiti:assignee="s1">
<extensionElements>
<activiti:formProperty id="prenom" name="prenom" type="string"></activiti:formProperty>
<activiti:taskListener event="create" class="fitman.services.MyTaskListener"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="sid-BC7E1EC1-6839-4440-A123-4127C00FAAA3" sourceRef="s1" targetRef="task2"></sequenceFlow>
<sequenceFlow id="sid-5A09EDC9-7B1F-4BAD-8D3B-DEB53A01768A" sourceRef="task2" targetRef="serv2"></sequenceFlow>
<sequenceFlow id="sid-1DCF980A-AB99-4839-A5BA-8900A1AA0D51" sourceRef="serv2" targetRef="end"></sequenceFlow>
<serviceTask id="serv1" name="serv1" activiti:class="fitman.services.MyAuthUser_WS"></serviceTask>
<serviceTask id="serv2" name="serv2" activiti:class="fitman.services.MyAuthUser_WS"></serviceTask>
<endEvent id="end" name="end"></endEvent>
</process>
</definitions>

I would recommend you use a signal event rather than a message event unless the event is coming from outside the BPMN environment. Signal events can be both emitted and caught from within a process instance where regular message events require a handler be configured within the application infrastructure.
If a tre message event is required, then you should consider looking into the camel task module as this allows you to both send and receive messages from a number of source/targets.

Related

Is there any specific reason for spring integration raise this INFO when processing the flow

I created the flow below and it's working normally but all the time this information is printed in the log file.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-5.2.xsd
http://www.springframework.org/schema/integration/http
http://www.springframework.org/schema/integration/http/spring-integration-http-5.2.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
<task:executor id="taskExecutorRecursaoRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<task:executor id="taskExecutorProcessamentoRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<task:executor id="taskExecutorSplitterRendaVariavel" pool-size="15-20" queue-capacity="100"/>
<int:channel id="xxx-consolidador-movimentacao-renda-variavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-recursao-renda-variavel" task-executor="taskExecutorSplitterRendaVariavel"/>
<int:channel id="xxx-consolidador-channel-segrega-renda-variavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-renda-variavel-recursao-movimentacao" task-executor="taskExecutorRecursaoRendaVariavel"/>
<int:publish-subscribe-channel id="xxx-consolidador-splitter-renda-variavel-processa-movimentacao" task-executor="taskExecutorProcessamentoRendaVariavel"/>
<int:channel id="xxx-consolidador-direct-channel-movimentacao-renda-variavel"/>
<int:channel id="xxx-consolidador-request-ativo-renda-variavel"/>
<int:channel id="xxx-consolidador-request-movimentacao-renda-variavel"/>
<int:channel id="xxx-consolidador-request-notifica-renda-variavel"/>
<int:channel id="xxx-consolidador-filter-channel-renda-variavel"/>
<int-http:outbound-gateway
url="${xxxx.xxxxx.movimentacao-rendavariavel}?startDate={dtInitPosicao}&endDate={dtenddate}&page={page}&recordPerPage=${RECORDS_PER_PAGE:250}&cblc={cblc}&cpfCnpj={cpf}"
http-method="GET"
expected-response-type="br.com.xxxxx.ciar.xxx.xxx.xxx.integration.response.ResponseRendaVariavelMovimentacao"
request-channel="xxx-consolidador-movimentacao-renda-variavel"
reply-channel="xxx-consolidador-splitter-recursao-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, cpf, cblc, dtInitPosicao, dtenddate, page">
<int-http:uri-variable name="cpf" expression="headers.cpf"/>
<int-http:uri-variable name="cblc" expression="headers.cblc"/>
<int-http:uri-variable name="dtInitPosicao" expression="headers.dtinitposicao"/>
<int-http:uri-variable name="dtenddate" expression="headers.dtenddate"/>
<int-http:uri-variable name="page" expression="headers.page"/>
</int-http:outbound-gateway>
<int:splitter input-channel="xxx-consolidador-splitter-recursao-renda-variavel"
output-channel="xxx-consolidador-channel-segrega-renda-variavel">
<bean class="br.com.xxx.ciar.xxx.renda.variavel.integration.splitter.SplitterRecursaoRendaVariavel"/>
</int:splitter>
<int:header-value-router id="recursaoRendaVariavel" input-channel="xxx-consolidador-channel-segrega-renda-variavel"
header-name="recursao" resolution-required="false">
<int:mapping value="true" channel="xxx-consolidador-splitter-renda-variavel-recursao-movimentacao"/>
</int:header-value-router>
<int:header-value-router id="processaRendaVariavel" input-channel="agora-consolidador-channel-segrega-renda-variavel"
header-name="processa" resolution-required="false">
<int:mapping value="true" channel="xxxx-consolidador-splitter-renda-variavel-processa-movimentacao"/>
</int:header-value-router>
<int:header-filter input-channel="xxx-consolidador-splitter-renda-variavel-processa-movimentacao"
output-channel="xxx-consolidador-filter-channel-renda-variavel"
header-names="Authorization, authorization"/>
<int:splitter input-channel="xxx-consolidador-filter-channel-renda-variavel"
output-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel">
<bean class="br.com.xxx.ciar.xxxx.renda.variavel.integration.splitter.RendaVariavelMovimentacaoSplitter"/>
</int:splitter>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="1">
<int:mapping value="ativos" channel="xxx-consolidador-request-ativo-renda-variavel"/>
</int:header-value-router>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="2">
<int:mapping value="posicao" channel="xxx-consolidador-request-movimentacao-renda-variavel"/>
</int:header-value-router>
<int:header-value-router input-channel="xxx-consolidador-direct-channel-movimentacao-renda-variavel" header-name="type" order="3">
<int:mapping value="notifica" channel="xxx-consolidador-request-notifica-renda-variavel"/>
</int:header-value-router>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.ativos}"
channel="xxx-consolidador-request-ativo-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.movimento-rendavariavel}"
channel="xxx-consolidador-request-movimentacao-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
<int-http:outbound-channel-adapter
http-method="POST"
url="${xxxx.notifica}"
channel="xxx-consolidador-request-notifica-renda-variavel"
rest-template="restTemplate"
mapped-request-headers="Authorization, DESTINO_URL">
</int-http:outbound-channel-adapter>
</beans>
2021-11-05 17:55:16,811 [taskExecutorSplitterRendaVariavel-1] INFO o.s.i.d.UnicastingDispatcher - An exception was thrown by 'bean 'org.springframework.integration.config.RouterFactoryBean#6' for component 'recursaoRendaVariavel'; defined in: 'file []'; from source: ''int:header-value-router' with id='recursaoRendaVariavel''' while handling 'GenericMessage [payload=br.com.bradesco.ciar.agora.renda.variavel.integration.response.ResponseRendaVariavelMovimentacao#2a5ae9, headers={Transfer-Encoding=chunked, http_requestMethod=GET, sequenceNumber=1, processa=true, sequenceSize=2, dtenddate=20211105, Pragma=no-cache, http_statusCode=200 OK, Date=1636145712000, dtinitposicao=20211101, Cache-Control=no-cache, no-store, max-age=0, must-revalidate, cblc=161254, cpf=21333240899, http_requestUrl=http://localhost:8083/renda-variavel/xxxxxxxxxx, contentType=application/json;charset=utf-8, timestamp=1636145716810}]': No channel resolved by router 'recursaoRendaVariavel' and no 'defaultOutputChannel' defined.. Failing over to the next subscriber.
Your <int:channel id="xxx-consolidador-channel-segrega-renda-variavel"/> is a DirectChannel with a UnicastingDispatcher, which has a logic to failover to the next subscriber, if the current one has failed. The logic is like this:
if (!isLast && this.failover) {
logExceptionBeforeFailOver(ex, handler, message);
}
We log that message to inform you that this might not be an expected behavior. For example that was an accident to add another subscriber to this channel. The whole exception info is present there to let you know that your logic in the router has failed: you probably didn't expect that No channel resolved by router 'recursaoRendaVariavel' for your use-case.
From here, if you really think that your flow is doing OK failing over to the next subscriber for that router error, then you just can ignore such an INFO message in the logs or turn off INFO for org.springframework.integration at all.

FHIR - Consent Resource - Giving Hl7.Fhir.Serialization.ComplexTypeReader error

I am not a techie but have assumed some responsibilities in someone's absence.
Trying to push below Consent FHIR Resource:
<Consent xmlns="http://hl7.org/fhir">
<id value="123" />
<status value="inactive" />
<scope>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/consentscope" />
<code value="patient-privacy" />
</coding>
</scope>
<category>
<coding>
<system value="http://loinc.org" />
<code value="59284-0" />
</coding>
</category>
<patient>
<reference value="Patient/41" />
<display value="John Stifiles" />
</patient>
<policyRule>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/consentpolicycodes" />
<code value="cric" />
</coding>
</policyRule>
<provision>
<type value="deny" />
<period>
<start value="2021-09-27" />
<end value="2021-09-27" />
</period>
</provision>
</Consent>
This is passed with no errors from inferno.healthit.gov/validator/ but when I run through my integrator (it hits HL7 validator), I get a variety of errors - Encountered unknown member 'Scope' or Encountered unknown member 'Patient', etc.
This is a Consent resource that conforms to FHIR version R4. Inferno runs FHIR R4 as well, so that works.
However, if you try and validate this resource against FHIR STU3, you will get the errors you mentioned, since the Consent resource structure significantly changed from STU3 to R4. Please check your integrator and make sure it runs FHIR R4 as well.

CRM solution import failed "an item with the same key has already been added"

I have a strange behaviour in one of our CRM-Organizations.
When I export a solution (which only contains the account-entity) as an unmanaged solution it works.
But when I reimport this very same solution without changing anything I get this error
"an item with the same key has already been added".
I found out that I have to remove the Attribute "ownerid" from the solution (and one relationship) and then it works...
this is the attribute
<attribute PhysicalName="OwnerId">
<Type>owner</Type>
<Name>ownerid</Name>
<LogicalName>ownerid</LogicalName>
<RequiredLevel>systemrequired</RequiredLevel>
<DisplayMask>ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
<ImeMode>auto</ImeMode>
<ValidForReadApi>1</ValidForReadApi>
<ValidForCreateApi>1</ValidForCreateApi>
<IsCustomField>0</IsCustomField>
<IsAuditEnabled>1</IsAuditEnabled>
<IsSecured>0</IsSecured>
<IntroducedVersion>5.0.0.0</IntroducedVersion>
<SourceType>0</SourceType>
<LookupStyle>single</LookupStyle>
<LookupTypes>
<LookupType id="00000000-0000-0000-0000-000000000000">8</LookupType>
<LookupType id="00000000-0000-0000-0000-000000000000">9</LookupType>
</LookupTypes>
<displaynames>
<displayname description="Vertriebsverantwortlicher" languagecode="1031" />
<displayname description="Owner" languagecode="1033" />
<displayname description="Właściciel" languagecode="1045" />
</displaynames>
<Descriptions>
<Description description="Geben Sie den Benutzer oder das Team ein, der bzw. das mit der Verwaltung des Datensatzes betraut ist. Dieses Feld wird aktualisiert, wenn der Datensatz einem anderen Benutzer zugewiesen wird." languagecode="1031" />
<Description description="Enter the user or team who is assigned to manage the record. This field is updated every time the record is assigned to a different user." languagecode="1033" />
<Description description="Wprowadź nazwę użytkownika lub zespołu, który zarządza rekordem. To pole jest aktualizowane za każdym razem, gdy rekord zostanie przypisany do innego użytkownika." languagecode="1045" />
</Descriptions>
</attribute>
I also checked the serverlogs and found this:
<importexportxml start="635818108905329459" stop="635818109069971342" progress="22.2222222222222" processed="true">
<solutionManifests>
<solutionManifest languagecode="1031" id="Firma_Transfer" LocalizedName="Firma_Transfer" processed="true">
<UniqueName>Firma_Transfer</UniqueName>
<LocalizedNames>
<LocalizedName description="Firma_Transfer" languagecode="1031" />
</LocalizedNames>
<Descriptions />
<Version>1.0.0</Version>
<Managed>0</Managed>
<Publisher>
<UniqueName>myorg</UniqueName>
<LocalizedNames>
<LocalizedName description="Myorg" languagecode="1031" />
</LocalizedNames>
<Descriptions />
<EMailAddress />
<SupportingWebsiteUrl />
<Addresses>
<Address>
<City />
<Country />
<Line1 />
<Line2 />
<PostalCode />
<StateOrProvince />
<Telephone1 />
</Address>
</Addresses>
</Publisher>
<results />
<result result="success" errorcode="0" errortext="" datetime="13:08:12.07" datetimeticks="635818072920798192" />
</solutionManifest>
</solutionManifests>
<upgradeSolutionPackageInformation>
<upgradeRequired>0</upgradeRequired>
<upgradeValid>1</upgradeValid>
<fileVersion>7.0.1.129</fileVersion>
<currentVersion>7.0.1.129</currentVersion>
<fileSku>OnPremise</fileSku>
<currentSku>OnPremise</currentSku>
</upgradeSolutionPackageInformation>
<entities>
<entity LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="true">
<result result="failure" errorcode="0x80044150" errortext="Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt." datetime="13:08:26.96" datetimeticks="635818073069658863" />
</entity>
</entities>
<nodes />
<settings />
<dashboards />
<securityroles />
<workflows />
<templates />
<optionSets />
<ConnectionRoles />
<SolutionPluginAssemblies />
<SdkMessageProcessingSteps />
<ServiceEndpoints />
<webResources />
<reports />
<FieldSecurityProfiles />
<convertrules />
<routingrules />
<Slas />
<languages>
<language>
<result result="success" errorcode="0" errortext="" datetime="13:08:11.07" datetimeticks="635818072910798185" />
</language>
</languages>
<entitySubhandlers>
<savedQuery LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<formXml LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false">
</formXml>
<entityCustomResources LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<entityRibbon LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false"/>
<savedQueryVisualization LocalizedName="Firma" OriginalName="Firma" Description="" id="Account" processed="false">
</savedQueryVisualization>
</entitySubhandlers>
<rootComponents>
<rootComponent processed="false" />
</rootComponents>
<dependencies>
<dependency processed="false" />
</dependencies>
All I found in the internet pointed to an problem with an attribute (missmatching type, ...) but in my case this is the same organization and no transfer from dev to prod or something like that...
We are using CRM 2015 but we had this problem in 2011 already.
Has anybody a solution for this? we don't want to edit the customization.XML everytime before importing a solution...
this is the database-field
[OwnerId] [uniqueidentifier] NOT NULL CONSTRAINT [DF_AccountBase_OwnerId] DEFAULT ('00000000-0000-0000-0000-000000000000')
thanks
Tobias
Your database field for OwnerId looks fine. Delete any custom fields with common names from your destination organization and try the import again. For instance, if you have new_LastEmailDate on both, or any custom field that performs the same function as a custom field in the solution, delete it from the destination. One of your custom fields is being recognized as a new addition of an existing field, probably due to capitalization. If you're writing it in from the new solution, you don't need it in the destination anyway and a non-conflicting copy will be replaced.
This happens for me when I try to reinstall a CRM 2016 Outlook that has been offline with a previous version of CRM. Uninstalling CRM and SQL server related items, cleaning up the registry deleting all folder and files related to the installation. I think it's worth mentioning that the installations works against the same CRM environment on other PC's.
The error you are seeing is very generic, but the fact that you know which attribute is causing the issue makes things a lot easier. It is usually possible to fix this type of issue by making direct database changes to repair corrupted metadata (unsupported!), but it requires a SQL developer with decent knowledge of how the CRM metadata tables work. If you have such a person I could provide additional guidance, otherwise you should create a case with Microsoft.

how to design a fallback for a spring integration service activator with circuit breaker?

when a circuit breaker advice is triggered, this takes care not to overload the failing integration service.
How do i fallback to a different service activator when the circuit is open? and when the circuit becomes closed need to fallback to primary activator
Is there a way to implement this with the framework? or some custom code has to be written
You can use an inline gateway to catch the exceptions and send them to an error channel; you can then use a router on the error flow to decide how to proceed further. Hopefully the following is reasonably easy to follow...
<int:service-activator input-channel="inbound" ref="gw" />
<int:gateway id="gw" default-request-channel="toPrimary"
error-channel="failures"
default-reply-timeout="0" />
<int:service-activator input-channel="toPrimary" expression=" 1 / 0 ">
<int:request-handler-advice-chain>
<bean class="org.springframework.integration.handler.advice.RequestHandlerCircuitBreakerAdvice">
<property name="threshold" value="2" />
<property name="halfOpenAfter" value="10000" />
</bean>
</int:request-handler-advice-chain>
</int:service-activator>
<!-- Error flow -->
<int:publish-subscribe-channel id="failures" />
<int:logging-channel-adapter id="failing" channel="failures" />
<int:recipient-list-router input-channel="failures" default-output-channel="nullChannel" >
<int:recipient channel="circuitFailures" selector-expression="payload.message.contains('Expression evaluation failed: 1 / 0') || payload.cause.message.contains('Circuit Breaker is Open')" />
</int:recipient-list-router>
<int:chain input-channel="circuitFailures" output-channel="loggingChannel">
<int:transformer expression="payload.failedMessage" />
<int:service-activator expression="payload + ' failed'" />
</int:chain>
<int:logging-channel-adapter id="loggingChannel" log-full-message="false" logger-name="tapInbound"
level="INFO" />

What is the "Organize Usings" menu ID in Visual Studio 2010?

I'm creating a Visual Studio 2010 extension using a Package template, not an Add-in.
I want to add a menu item to the "Organize Usings" menu group that appears when you right-click in a .cs file. To do this, I need the guid and the id of that menu group.
<Button guid="myCmdSet" id="myButton" priority="0x0100" type="Button">
<Parent guid="guidSHLMainMenu (I think?)" id="???" />
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<CommandName>myCommand</CommandName>
<ButtonText>Do Stuff</ButtonText>
</Strings>
</Button>
I have looked here and here and here. Basically all around MSDN. Are these published, and does anyone know what they are?
EDIT: I found the related menu via this method, but I still don't have a way to find the menu group GUID/ID, which is what I really want.
OMG, I've spend 3 hours on this :D Here's the solution:
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<Extern href="stdidcmd.h"/>
<Extern href="vsshlids.h"/>
<Extern href="msobtnid.h"/>
<Commands package="guidVSPackage1Pkg">
<Buttons>
<Button guid="guidCSharpGrpId" id="mySuperCommand" priority="0x0200" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_CTX_ORGANIZE" />
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<CommandName>mySuperCommand</CommandName>
<ButtonText>My super command</ButtonText>
</Strings>
</Button>
</Buttons>
<Bitmaps>
<Bitmap guid="guidImages" href="Resources\Images_32bit.bmp" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/>
</Bitmaps>
</Commands>
<Symbols>
<!-- This is the package guid. -->
<GuidSymbol name="guidVSPackage1Pkg" value="{F066e284-dcab-11d2-b551-00c04f68d4db}" />
<GuidSymbol name="guidCSharpGrpId" value="{5d7e7f65-a63f-46ee-84f1-990b2cab23f9}">
<IDSymbol name="IDG_CSHARP_CTX_ORGANIZE" value="0x3618" />
<IDSymbol name="mySuperCommand" value="0x0100" />
</GuidSymbol>
<GuidSymbol name="guidImages" value="{cff24f4c-767f-48ee-aff4-6bdf8218cba0}" >
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
</GuidSymbol>
</Symbols>
</CommandTable>
You must place guidCSharpGrpId and IDG_CSHARP_CTX_ORGANIZE because they're not available in "standard" set of id's. By "standard" I'mean those placed in VisualStudioIntegration\Common\Inc directory within *.h files. They're hidden in cslangsvcui.dll library.
To get these ID's I've used VS Command Table PowerToy. You can download it from here:
http://archive.msdn.microsoft.com/VSCTPowerToy
Check this also as this thread:
http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/697245ac-1596-4d6a-b55c-f5b01b69a583
In case that this solution won't work for you because some guids, etc. I've put zipped project on my SkyDrive:
https://skydrive.live.com/#cid=6A19F3A9B7B8E017&id=6A19F3A9B7B8E017!16486
Hope this helps :)

Resources